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 f2cfb3e..9db4885 100644 (file)
@@ -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
@@ -117,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'),
@@ -140,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'),
@@ -168,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()
@@ -229,11 +228,13 @@ class PlanetlabOVSPort(LinuxApplication):
         command = " ".join(command)
         command = self.replace_paths(command)
         return command
-        
-    def verify_connection(self):
+       
+    def verify_connection(self, remote_endpoint, connection_app_home, 
+                connection_run_home):
         self.ovsswitch.ovs_status()
 
-    def terminate_connection(self):
+    def terminate_connection(self, endpoint, connection_app_home, 
+                connection_run_home):
         return True
 
     def check_status(self):