Use "No VPP PID found on node X" when vpp pid is not returned 97/5897/1
authorJan Gelety <jgelety@cisco.com>
Tue, 28 Mar 2017 16:20:52 +0000 (18:20 +0200)
committerJan Gelety <jgelety@cisco.com>
Tue, 28 Mar 2017 16:20:52 +0000 (18:20 +0200)
Change-Id: Idfe6d674355bf57fdc24219cdaf8664ec23dfce9
Signed-off-by: Jan Gelety <jgelety@cisco.com>
resources/libraries/python/DUTSetup.py

index 1f87f03..275a546 100644 (file)
@@ -123,10 +123,14 @@ class DUTSetup(object):
             raise RuntimeError('Not possible to get PID of VPP process on node:'
                                ' {}'.format(node['host']))
 
-        if len(stdout.splitlines()) != 1:
+        if len(stdout.splitlines()) == 1:
+            return int(stdout)
+        elif len(stdout.splitlines()) == 0:
+            raise RuntimeError("No VPP PID found on node {0}".
+                               format(node['host']))
+        else:
             raise RuntimeError("More then one VPP PID found on node {0}".
                                format(node['host']))
-        return int(stdout)
 
     @staticmethod
     def get_vpp_pids(nodes):

©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.