applied the except and raise fixers to the master branch to close the gap with py3
[nepi.git] / src / nepi / resources / planetlab / openvswitch / ovsport.py
index 6ec1a12..9db4885 100644 (file)
@@ -116,12 +116,12 @@ class PlanetlabOVSPort(LinuxApplication):
         if not self.get('port_name'):
             msg = "The port name is not assigned"
             self.error(msg)
-            raise AttributeError, msg
+            raise AttributeError(msg)
 
         if not self.ovsswitch:
             msg = "The OVSwitch RM is not running"
             self.error(msg)
-            raise AttributeError, msg
+            raise AttributeError(msg)
 
         command = "sliver-ovs create-port %s %s" % (
                 self.ovsswitch.get('bridge_name'),
@@ -139,7 +139,7 @@ class PlanetlabOVSPort(LinuxApplication):
         except RuntimeError:
             msg = "Could not create ovs-port"           
             self.debug(msg)
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
 
         self.info("Created port %s on switch %s" % (
             self.get('port_name'),
@@ -167,7 +167,7 @@ class PlanetlabOVSPort(LinuxApplication):
         if err != "":
             msg = "Error retrieving the local endpoint of the port"
             self.error(msg)
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
 
         if out:
             self._port_number = out.strip()