Commit 8352f71a authored by Robert Schmidt's avatar Robert Schmidt

Show output of CustomCommand if it would make the pipeline fail

parent 31e6b581
...@@ -265,17 +265,19 @@ class RANManagement(): ...@@ -265,17 +265,19 @@ class RANManagement():
cmd.close() cmd.close()
logging.debug(f'CustomCommand: {self.command} returnCode: {ret.returncode}') logging.debug(f'CustomCommand: {self.command} returnCode: {ret.returncode}')
status = 'OK' status = 'OK'
message = '' message = []
if ret.returncode != 0 and not self.command_fail: if ret.returncode != 0 and not self.command_fail:
message = ret.stdout message = [ret.stdout]
logging.warning(f'CustomCommand output: {message}') logging.warning(f'CustomCommand output: {message}')
status = 'Warning' status = 'Warning'
if self.command_fail: # important command since it would make the pipeline fail, so show output in HTML
message = [ret.stdout]
if ret.returncode != 0 and self.command_fail: if ret.returncode != 0 and self.command_fail:
message = ret.stdout message = [ret.stdout]
logging.error(f'CustomCommand failed: output: {message}') logging.error(f'CustomCommand failed: output: {message}')
status = 'KO' status = 'KO'
self.prematureExit = True self.prematureExit = True
HTML.CreateHtmlTestRowQueue(self.command, status, [message]) HTML.CreateHtmlTestRowQueue(self.command, status, message)
def checkBuildeNB(self, lIpAddr, lUserName, lPassWord, lSourcePath, testcaseId, HTML): def checkBuildeNB(self, lIpAddr, lUserName, lPassWord, lSourcePath, testcaseId, HTML):
HTML.testCase_id=testcaseId HTML.testCase_id=testcaseId
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment