PAL: Get TG IP address from output_info.xml 62/21262/1
authorTibor Frank <tifrank@cisco.com>
Tue, 13 Aug 2019 10:24:18 +0000 (12:24 +0200)
committerTibor Frank <tifrank@cisco.com>
Tue, 13 Aug 2019 10:26:54 +0000 (10:26 +0000)
Change-Id: I566c0e436fbe50e5e72da35be6a2afc81e8a33b6
Signed-off-by: Tibor Frank <tifrank@cisco.com>
(cherry picked from commit b763901692e207a8f07386bb3bcba254cdeaa790)

resources/tools/presentation/input_data_parser.py

index 3b3be9f..bae7b5e 100644 (file)
@@ -387,14 +387,12 @@ class ExecutionChecker(ResultVisitor):
         :returns: Nothing.
         """
 
-        if msg.message.count("Arguments:"):
-            message = str(msg.message).replace(' ', '').replace('\n', '').\
-                replace("'", '"').replace('b"', '"').\
-                replace("honeycom", "honeycomb")
-            message = loads(message[11:-1])
+        if msg.message.count("Setup of TG node"):
+            reg_tg_ip = re.compile(
+                r'Setup of TG node (\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}) done')
             try:
-                self._testbed = message["TG"]["host"]
-            except (KeyError, ValueError):
+                self._testbed = str(re.search(reg_tg_ip, msg.message).group(1))
+            except (KeyError, ValueError, IndexError, AttributeError):
                 pass
             finally:
                 self._data["metadata"]["testbed"] = self._testbed

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.