applied the except and raise fixers to the master branch to close the gap with py3
[nepi.git] / src / nepi / resources / planetlab / openvswitch / ovs.py
index 7797465..a3cf2fa 100644 (file)
@@ -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.