Log a warning when reset fails

We attempt a reset but if the installation is being run in a non-tty
friendly way, reset may fail.  Since this isn't really a blocking issue
we shouldn't fail out of the installation but rather log a warning
indicating that the user may need to perform some action.

Change-Id: I26f41457b712810b54d4108f735a1db3c88ae8ce
Closes-Bug: #1842677
(cherry picked from commit 67d41db5fa)
This commit is contained in:
Alex Schultz 2019-09-04 10:09:46 -06:00
parent 85188ebf67
commit 4e2851561f
1 changed files with 7 additions and 1 deletions

View File

@ -2041,5 +2041,11 @@ 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()