X-Git-Url: http://git.onelab.eu/?p=nepi.git;a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Fplanetlab%2Fopenvswitch%2Fovs.py;h=a3cf2faeeaa2cbc64f7bca88fb6e1b3e7d56e3fc;hp=7797465c13918a98b2d64b5fb7677dc6f05cc3fb;hb=6285ca51026efb69642eea9dfc7c480e722d84a9;hpb=cb5d027b813a27d7de263653e1a8e0cef5490f0a diff --git a/src/nepi/resources/planetlab/openvswitch/ovs.py b/src/nepi/resources/planetlab/openvswitch/ovs.py index 7797465c..a3cf2fae 100644 --- a/src/nepi/resources/planetlab/openvswitch/ovs.py +++ b/src/nepi/resources/planetlab/openvswitch/ovs.py @@ -88,7 +88,7 @@ class PlanetlabOVSSwitch(LinuxApplication): if not nodes or len(nodes) != 1: msg = "PlanetlabOVSSwitch must be connected to exactly one PlanetlabNode" #self.error(msg) - raise RuntimeError, msg + raise RuntimeError(msg) self._node = nodes[0] @@ -148,7 +148,7 @@ class PlanetlabOVSSwitch(LinuxApplication): except RuntimeError: msg = "Command sliver-ovs does not exist on the VM" self.debug(msg) - raise RuntimeError, msg + raise RuntimeError(msg) def servers_on(self): """ Start the openvswitch servers and check it @@ -179,7 +179,7 @@ class PlanetlabOVSSwitch(LinuxApplication): except RuntimeError: msg = "Failed to start ovs-server on VM" self.debug(msg) - raise RuntimeError, msg + raise RuntimeError(msg) command = "ps -A | grep ovsdb-server" shfile = os.path.join(self.app_home, "ovsdb_status.sh") @@ -194,7 +194,7 @@ class PlanetlabOVSSwitch(LinuxApplication): except RuntimeError: msg = "ovsdb-server not running on VM" self.debug(msg) - raise RuntimeError, msg + raise RuntimeError(msg) self.info("Server OVS Started...") @@ -206,7 +206,7 @@ class PlanetlabOVSSwitch(LinuxApplication): if not (self.get("bridge_name") and self.get("virtual_ip_pref")): msg = "No assignment in one or both attributes" self.error(msg) - raise AttributeError, msg + raise AttributeError(msg) command = "sliver-ovs create-bridge '%s' '%s'" % ( self.get("bridge_name"), @@ -224,7 +224,7 @@ class PlanetlabOVSSwitch(LinuxApplication): except RuntimeError: msg = "No such pltap netdev\novs-appctl: ovs-vswitchd: server returned an error" self.debug(msg) - raise RuntimeError, msg + raise RuntimeError(msg) self.info(" Bridge %s Created and Assigned to %s" %\ (self.get("bridge_name"), self.get("virtual_ip_pref")) ) @@ -259,7 +259,7 @@ class PlanetlabOVSSwitch(LinuxApplication): except RuntimeError: msg = "SSH connection in the method assign_controller" self.debug(msg) - raise RuntimeError, msg + raise RuntimeError(msg) self.info("Controller assigned to the bridge %s" % self.get("bridge_name")) @@ -279,7 +279,7 @@ class PlanetlabOVSSwitch(LinuxApplication): except RuntimeError: msg = "Error when checking the status of the OpenVswitch" self.debug(msg) - raise RuntimeError, msg + raise RuntimeError(msg) def do_release(self): """ Delete the bridge and close the server.