diff options
author | Jan Gelety <jgelety@cisco.com> | 2019-02-25 12:21:41 +0100 |
---|---|---|
committer | Jan Gelety <jgelety@cisco.com> | 2019-02-25 13:18:26 +0000 |
commit | b29ed928da60345000a7d9c2b8d9c60c232e83fc (patch) | |
tree | b40ffeade6a50a7864df327aa9f6c2ed4af44860 /resources/libraries/python/DUTSetup.py | |
parent | 53153e114017d193cdf9b88f21f4eac31bad72b7 (diff) |
FIX: VPP PIDs can also be separated by spaces not only by line breaks
Change-Id: I6a5e8732be224927aa965cdf6b93998aa8699639
Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'resources/libraries/python/DUTSetup.py')
-rw-r--r-- | resources/libraries/python/DUTSetup.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/resources/libraries/python/DUTSetup.py b/resources/libraries/python/DUTSetup.py index a20b2d7056..631bff4e4a 100644 --- a/resources/libraries/python/DUTSetup.py +++ b/resources/libraries/python/DUTSetup.py @@ -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 |