Merge "Log a warning when reset fails" into stable/stein

This commit is contained in:
Zuul 2019-09-06 18:46:09 +00:00 committed by Gerrit Code Review
commit 8e4592f0df
1 changed files with 7 additions and 1 deletions

View File

@ -2042,5 +2042,11 @@ def reset_cmdline():
# only try to reset if stdout is a terminal, skip if not (e.g. CI) # only try to reset if stdout is a terminal, skip if not (e.g. CI)
if not sys.stdout.isatty(): if not sys.stdout.isatty():
return 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() sys.stdout.flush()