X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Fccn%2Fccnping.py;h=934db3cde205ec44019cdd351b9084c8e12e0018;hb=09ac796bac9aa2c41c5ad830f404fe128fffb22d;hp=2e3f4854540e714222ff03ca4ff7f7ea2074a628;hpb=13478d7a3880e0e542f77affe3a65cce52c7c77d;p=nepi.git diff --git a/src/nepi/resources/linux/ccn/ccnping.py b/src/nepi/resources/linux/ccn/ccnping.py index 2e3f4854..934db3cd 100644 --- a/src/nepi/resources/linux/ccn/ccnping.py +++ b/src/nepi/resources/linux/ccn/ccnping.py @@ -18,8 +18,8 @@ # Author: Alina Quereilhac from nepi.execution.attribute import Attribute, Flags, Types -from nepi.execution.resource import ResourceManager, clsinit_copy, ResourceState, \ - reschedule_delay +from nepi.execution.resource import ResourceManager, clsinit_copy, \ + ResourceState, reschedule_delay from nepi.resources.linux.ccn.ccnpingserver import LinuxCCNPingServer from nepi.util.timefuncs import tnow, tdiffsec @@ -38,7 +38,7 @@ class LinuxCCNPing(LinuxCCNPingServer): count = Attribute("c", "Total number of pings", - type = Types.Integer, + type = Types.Double, flags = Flags.ExecReadOnly) number = Attribute("n", @@ -65,14 +65,14 @@ class LinuxCCNPing(LinuxCCNPingServer): if ccnpingserver: return ccnpingserver[0] return None - def start(self): + def do_start(self): if not self.ccnpingserver or \ self.ccnpingserver.state < ResourceState.STARTED: self.debug("---- RESCHEDULING START---- ccnpingserver state %s " % \ self.ccnpingserver.state ) self.ec.schedule(reschedule_delay, self.start) else: - super(LinuxCCNPing, self).start() + super(LinuxCCNPing, self).do_start() @property def _start_command(self): @@ -84,7 +84,7 @@ class LinuxCCNPing(LinuxCCNPingServer): if self.get("n"): args.append("-n %d" % self.get("n")) if self.get("i"): - args.append("-i %d" % self.get("i")) + args.append("-i %.2f" % self.get("i")) command = " ".join(args)