lib: Fix stopRouter not to fail for case if daemon was never started

Fixes the issue for topotest to fail ot end of skipped LDP test on
a system without MPLS support

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
This commit is contained in:
Martin Winter 2017-05-30 20:24:20 -07:00 committed by Donald Sharp
parent 9e05a644e9
commit c8cff3ced1

View File

@ -173,7 +173,7 @@ class Router(Node):
if rundaemons is not None:
for d in StringIO.StringIO(rundaemons):
daemonpid = self.cmd('cat %s' % d.rstrip()).rstrip()
if pid_exists(int(daemonpid)):
if (daemonpid.isdigit() and pid_exists(int(daemonpid))):
self.cmd('kill -7 %s' % daemonpid)
self.waitOutput()
def removeIPs(self):