X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Finterface.py;h=26a1549e80cfe58dbacf64a9538c9da29cd10994;hb=4b0e922489532434f0968647886021542b77cece;hp=6fab54a53a3989ce00659c23d3ad270625d70296;hpb=6a8c7da45f7d745ea47c5020b13dfb8ada0931db;p=nepi.git diff --git a/src/nepi/resources/linux/interface.py b/src/nepi/resources/linux/interface.py index 6fab54a5..26a1549e 100644 --- a/src/nepi/resources/linux/interface.py +++ b/src/nepi/resources/linux/interface.py @@ -18,7 +18,8 @@ # Author: Alina Quereilhac from nepi.execution.attribute import Attribute, Types, Flags -from nepi.execution.resource import ResourceManager, clsinit, ResourceState +from nepi.execution.resource import ResourceManager, clsinit, ResourceState, \ + reschedule_delay from nepi.resources.linux.node import LinuxNode from nepi.resources.linux.channel import LinuxChannel @@ -31,11 +32,12 @@ import time # TODO: UP, MTU attributes! -reschedule_delay = "0.5s" @clsinit class LinuxInterface(ResourceManager): _rtype = "LinuxInterface" + _help = "Controls network devices on Linux hosts through the ifconfig tool" + _backend = "linux" @classmethod def _register_attributes(cls): @@ -110,7 +112,7 @@ class LinuxInterface(ResourceManager): mtu = self.get("mtu") # Get current interfaces information - (out, err), proc = self.node.execute("ifconfig", sudo = True) + (out, err), proc = self.node.execute("ifconfig", sudo = True, tty = True) if err and proc.poll(): msg = " Error retrieving interface information " @@ -240,7 +242,7 @@ class LinuxInterface(ResourceManager): self.discover() self.provision() except: - self._state = ResourceState.FAILED + self.fail() raise super(LinuxInterface, self).deploy()