From 67d41db5fa76139d7fbd16f684001aac84da4f58 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Wed, 4 Sep 2019 10:09:46 -0600 Subject: [PATCH] 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 --- tripleoclient/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tripleoclient/utils.py b/tripleoclient/utils.py index 5f07883ac..7060fa4ae 100644 --- a/tripleoclient/utils.py +++ b/tripleoclient/utils.py @@ -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()