Merge "Log a warning when reset fails"

This commit is contained in:
Zuul 2019-09-05 13:47:59 +00:00 committed by Gerrit Code Review
commit bed34acf2e
1 changed files with 7 additions and 1 deletions

View File

@ -1935,7 +1935,13 @@ def reset_cmdline():
# only try to reset if stdout is a terminal, skip if not (e.g. CI)
if not sys.stdout.isatty():
return
sys.stdout.write(run_command(['reset', '-I']))
output = ''
try:
output = run_command(['reset', '-I'])
except RuntimeError as e:
LOG.warning('Unable to reset command line. Try manually running '
'"reset" if the command line is broken.')
sys.stdout.write(output)
sys.stdout.flush()