FIX: VPP PIDs can also be separated by spaces not only by line breaks 04/17804/3
authorJan Gelety <jgelety@cisco.com>
Mon, 25 Feb 2019 11:21:41 +0000 (12:21 +0100)
committerJan Gelety <jgelety@cisco.com>
Mon, 25 Feb 2019 13:18:26 +0000 (13:18 +0000)
Change-Id: I6a5e8732be224927aa965cdf6b93998aa8699639
Signed-off-by: Jan Gelety <jgelety@cisco.com>
resources/libraries/python/DUTSetup.py

index a20b2d7..631bff4 100644 (file)
@@ -176,19 +176,17 @@ class DUTSetup(object):
                                    'on node: {0}\n {1}'.
                                    format(node['host'], stdout + stderr))
 
-            if len(stdout.splitlines()) == 1:
+            pid_list = stdout.split()
+            if len(pid_list) == 1:
                 return int(stdout)
-            elif not stdout.splitlines():
+            elif not pid_list:
                 logger.debug("No VPP PID found on node {0}".
                              format(node['host']))
                 continue
             else:
                 logger.debug("More then one VPP PID found on node {0}".
                              format(node['host']))
-                ret_list = list()
-                for line in stdout.splitlines():
-                    ret_list.append(int(line))
-                return ret_list
+                return [int(pid) for pid in pid_list]
 
         return None