applied the except and raise fixers to the master branch to close the gap with py3
[nepi.git] / src / nepi / resources / planetlab / tap.py
index 61ff3d6..56517c3 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
@@ -51,7 +50,7 @@ class PlanetlabTap(LinuxTap):
     def node(self):
         node = self.get_connected(PlanetlabNode.get_rtype())
         if node: return node[0]
-        raise RuntimeError, "TAP/TUN devices must be connected to Node"
+        raise RuntimeError("TAP/TUN devices must be connected to Node")
 
     def upload_sources(self):
         scripts = []
@@ -141,7 +140,7 @@ class PlanetlabTap(LinuxTap):
                 (out, err), proc = self.node.check_errors(exec_run_home)
                 
                 if err.strip():
-                    raise RuntimeError, err
+                    raise RuntimeError(err)
 
             if out:
                 vif_name = out.strip()
@@ -152,7 +151,7 @@ class PlanetlabTap(LinuxTap):
         else:
             msg = "Couldn't retrieve vif_name"
             self.error(msg, out, err)
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
 
         return vif_name