X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Fnping.py;h=544b4d9d5d2e05593686baf3df057c6ddbd35928;hb=5a00a5d04a1d1ecd4cafd5582f7747f84985cd3f;hp=ec874bc2c4dff482f20d50b7877651a086b5cc2c;hpb=99d8b2a4431d8fafd0385e189375106d46f1abd9;p=nepi.git diff --git a/src/nepi/resources/linux/nping.py b/src/nepi/resources/linux/nping.py index ec874bc2..544b4d9d 100644 --- a/src/nepi/resources/linux/nping.py +++ b/src/nepi/resources/linux/nping.py @@ -18,7 +18,7 @@ # Author: Alina Quereilhac from nepi.execution.attribute import Attribute, Flags, Types -from nepi.execution.resource import clsinit_copy, failtrap +from nepi.execution.resource import clsinit_copy from nepi.resources.linux.application import LinuxApplication from nepi.util.timefuncs import tnow @@ -34,84 +34,84 @@ class LinuxNPing(LinuxApplication): "Sets nping -c option. " "Stop after a given number of rounds. ", type = Types.Integer, - flags = Flags.ExecReadOnly) + flags = Flags.Design) e = Attribute("e", "Sets nping -e option. " "Set the network interface to be used.", - flags = Flags.ExecReadOnly) + flags = Flags.Design) delay = Attribute("delay", "Sets nping --delay option. " "Delay between probes ", - flags = Flags.ExecReadOnly) + flags = Flags.Design) rate = Attribute("rate", "Sets nping --rate option. " "Send probes at a given rate ", - flags = Flags.ExecReadOnly) + flags = Flags.Design) ttl = Attribute("ttl", "Sets nping --ttl option. " "Time To Live. ", - flags = Flags.ExecReadOnly) + flags = Flags.Design) p = Attribute("p", "Sets nping -p option. " "Target ports. ", type = Types.Integer, - flags = Flags.ExecReadOnly) + flags = Flags.Design) tcp = Attribute("tcp", "Sets nping --tcp option. " "TCP mode. ", type = Types.Bool, default = False, - flags = Flags.ExecReadOnly) + flags = Flags.Design) udp = Attribute("udp", "Sets nping --udp option. " "UDP mode. ", type = Types.Bool, default = False, - flags = Flags.ExecReadOnly) + flags = Flags.Design) icmp = Attribute("icmp", "Sets nping --icmp option. " "ICMP mode. ", type = Types.Bool, default = False, - flags = Flags.ExecReadOnly) + flags = Flags.Design) arp = Attribute("arp", "Sets nping --arp option. " "ARP mode. ", type = Types.Bool, default = False, - flags = Flags.ExecReadOnly) + flags = Flags.Design) traceroute = Attribute("traceroute", "Sets nping --traceroute option. " "Traceroute mode. ", type = Types.Bool, default = False, - flags = Flags.ExecReadOnly) + flags = Flags.Design) countinuous = Attribute("continuous", "Run nping in a while loop", type = Types.Bool, default = False, - flags = Flags.ExecReadOnly) + flags = Flags.Design) print_timestamp = Attribute("printTimestamp", "Print timestamp before running nping", type = Types.Bool, default = False, - flags = Flags.ExecReadOnly) + flags = Flags.Design) target = Attribute("target", "nping target host (host that will be pinged)", - flags = Flags.ExecReadOnly) + flags = Flags.Design) cls._register_attribute(c) cls._register_attribute(e) @@ -133,8 +133,7 @@ class LinuxNPing(LinuxApplication): self._home = "nping-%s" % self.guid self._sudo_kill = True - @failtrap - def deploy(self): + def do_deploy(self): if not self.get("command"): self.set("command", self._start_command) @@ -147,7 +146,7 @@ class LinuxNPing(LinuxApplication): if not self.get("depends"): self.set("depends", "nmap") - super(LinuxNPing, self).deploy() + super(LinuxNPing, self).do_deploy() @property def _start_command(self):