X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Finterface.py;h=04d79593289f5729d4742f95af76d4fb110210e1;hb=6285ca51026efb69642eea9dfc7c480e722d84a9;hp=af527b9bbb2effe9e162811434fad56dad0246b8;hpb=741b99fe027fe6b54846a0703d26510d9b40a135;p=nepi.git diff --git a/src/nepi/resources/linux/interface.py b/src/nepi/resources/linux/interface.py index af527b9b..04d79593 100644 --- a/src/nepi/resources/linux/interface.py +++ b/src/nepi/resources/linux/interface.py @@ -3,9 +3,8 @@ # Copyright (C) 2013 INRIA # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -38,7 +37,7 @@ import time class LinuxInterface(ResourceManager): _rtype = "linux::Interface" _help = "Controls network devices on Linux hosts through the ifconfig tool" - _backend = "linux" + _platform = "linux" @classmethod def _register_attributes(cls): @@ -118,7 +117,7 @@ class LinuxInterface(ResourceManager): if err and proc.poll(): msg = " Error retrieving interface information " self.error(msg, out, err) - raise RuntimeError, "%s - %s - %s" % (msg, out, err) + raise RuntimeError("%s - %s - %s" % (msg, out, err)) # Check if an interface is found matching the RM attributes ifaces = out.split("\n\n") @@ -180,7 +179,7 @@ class LinuxInterface(ResourceManager): if not self.get("deviceName"): msg = "Unable to resolve interface " self.error(msg) - raise RuntimeError, msg + raise RuntimeError(msg) super(LinuxInterface, self).do_discover() @@ -210,7 +209,7 @@ class LinuxInterface(ResourceManager): if err and proc.poll(): msg = "Error configuring interface with command '%s'" % cmd self.error(msg, out, err) - raise RuntimeError, "%s - %s - %s" % (msg, out, err) + raise RuntimeError("%s - %s - %s" % (msg, out, err)) if ip6 and mask6: cmd = "ifconfig %(devname)s inet6 add %(ip6)s/%(mask6)d" % ({ @@ -223,7 +222,7 @@ class LinuxInterface(ResourceManager): if err and proc.poll(): msg = "Error seting ipv6 for interface using command '%s' " % cmd self.error(msg, out, err) - raise RuntimeError, "%s - %s - %s" % (msg, out, err) + raise RuntimeError("%s - %s - %s" % (msg, out, err)) super(LinuxInterface, self).do_provision()