osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29429 )
Change subject: obs: don't print verbose output twice on error ......................................................................
obs: don't print verbose output twice on error
When running in verbose mode, it's enough that the output is displayed while the command is running. Don't print it again on error.
Change-Id: I4fcf2421a6f82bd94ba098b39f58e5d3f18aa8fd --- M scripts/obs/lib/__init__.py 1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/29/29429/1
diff --git a/scripts/obs/lib/__init__.py b/scripts/obs/lib/__init__.py index a07a072..f2790d0 100644 --- a/scripts/obs/lib/__init__.py +++ b/scripts/obs/lib/__init__.py @@ -87,12 +87,17 @@
def exit_error_cmd(completed, error_msg): """ :param completed: return from run_cmd() below """ + global cmds_verbose + print() print(f"ERROR: {error_msg}") print() print(f"*** command ***\n{completed.args}\n") print(f"*** returncode ***\n{completed.returncode}\n") - print(f"*** output ***\n{completed.output}") + + if not cmds_verbose: + print(f"*** output ***\n{completed.output}") + print("*** python trace ***") raise RuntimeError("shell command related error, find details right above" " this python trace")