From 3a881f581e5d1f9eda83a1aff667c1508705acbb Mon Sep 17 00:00:00 2001 From: Lucia Guevgeozian Odizzio Date: Wed, 5 Mar 2014 16:59:59 +0100 Subject: [PATCH] Fixing _do_ping so it uses a string --- src/nepi/resources/planetlab/node.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/nepi/resources/planetlab/node.py b/src/nepi/resources/planetlab/node.py index eb229cdb..1118854e 100644 --- a/src/nepi/resources/planetlab/node.py +++ b/src/nepi/resources/planetlab/node.py @@ -169,6 +169,15 @@ class PlanetlabNode(LinuxNode): "year"], flags = Flags.Filter) +# plblacklist = Attribute("blacklist", "Take into account the file plblacklist \ +# in the user's home directory under .nepi directory. This file \ +# contains a list of PL nodes to blacklist, and at the end \ +# of the experiment execution the new blacklisted nodes are added.", +# type = Types.Bool, +# default = True, +# flags = Flags.ReadOnly) +# + cls._register_attribute(ip) cls._register_attribute(pl_url) cls._register_attribute(pl_ptn) @@ -588,12 +597,11 @@ class PlanetlabNode(LinuxNode): ip = self._get_ip(node_id) if not ip: return ping_ok - command = ['ping', '-c4'] - command.append(ip) + command = "ping -c4 %s" % ip (out, err) = lexec(command) - if not out.find("2 received") or not out.find("3 received") or not \ - out.find("4 received") < 0: + if not str(out).find("2 received") or not str(out).find("3 received") or not \ + str(out).find("4 received") < 0: ping_ok = True return ping_ok -- 2.47.0