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']))
 
             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']))
             raise RuntimeError("More then one VPP PID found on node {0}".
                                format(node['host']))
-        return int(stdout)
 
     @staticmethod
     def get_vpp_pids(nodes):
 
     @staticmethod
     def get_vpp_pids(nodes):