osmith submitted this change.

View Change

Approvals: pespin: Looks good to me, but someone else must approve osmith: Looks good to me, approved msuraev: Looks good to me, but someone else must approve Jenkins Builder: Verified
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(-)

diff --git a/scripts/obs/lib/__init__.py b/scripts/obs/lib/__init__.py
index d66aa3b..58fe0e4 100644
--- a/scripts/obs/lib/__init__.py
+++ b/scripts/obs/lib/__init__.py
@@ -88,12 +88,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")

To view, visit change 29429. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I4fcf2421a6f82bd94ba098b39f58e5d3f18aa8fd
Gerrit-Change-Number: 29429
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: msuraev <msuraev@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged