From 72337b9c4393ae3b487290f9b85165aa4c613dae Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 28 Mar 2024 18:12:52 +0100 Subject: [PATCH] Minor fixes to CI python scripts - enhanced CustomCommand logging - print ParseError --- ci-scripts/main.py | 4 ++-- ci-scripts/ran.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 2387032e37..6fc0ad7f1a 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -579,8 +579,8 @@ elif re.match('^InitiateHtml$', mode, re.IGNORECASE): if (os.path.isfile(xml_test_file)): try: xmlTree = ET.parse(xml_test_file) - except: - print("Error while parsing file: " + xml_test_file) + except Exception as e: + print(f"Error: {e} while parsing file: {xml_test_file}.") xmlRoot = xmlTree.getroot() HTML.htmlTabRefs.append(xmlRoot.findtext('htmlTabRef',default='test-tab-' + str(count))) HTML.htmlTabNames.append(xmlRoot.findtext('htmlTabName',default='test-tab-' + str(count))) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index afa6036c7e..031de4b70e 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -264,7 +264,7 @@ class RANManagement(): cmd = cls_cmd.getConnection(self.node) ret = cmd.run(self.command) cmd.close() - logging.debug(f"Custum command : {self.command} on node : {self.node} returnCode : {ret.returncode}") + logging.debug(f"CustomCommand: {self.command} on node: {self.node} - {'OK, command succeeded' if ret.returncode == 0 else f'Error, return code: {ret.returncode}'}") status = 'OK' message = [] if ret.returncode != 0 and not self.command_fail: