still making both branches closer
[nepi.git] / src / nepi / resources / linux / tap.py
index 9aba916..d7bad1c 100644 (file)
@@ -107,7 +107,7 @@ class LinuxTap(LinuxApplication):
     def node(self):
         node = self.get_connected(LinuxNode.get_rtype())
         if node: return node[0]
-        raise RuntimeError, "linux::TAP/TUN devices must be connected to a linux::Node"
+        raise RuntimeError("linux::TAP/TUN devices must be connected to a linux::Node")
 
     @property
     def gre_enabled(self):
@@ -243,7 +243,7 @@ class LinuxTap(LinuxApplication):
         else:
             msg = " Failed to execute command '%s'" % command
             self.error(msg, out, err)
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
 
     def do_stop(self):
         command = self.get('command') or ''
@@ -315,7 +315,7 @@ class LinuxTap(LinuxApplication):
         
         if proc.poll() or err:
             self.error(msg, out, err)
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
     
         # Wait for pid file to be generated
         pid, ppid = self.node.wait_pid(connection_run_home, 
@@ -331,7 +331,7 @@ class LinuxTap(LinuxApplication):
             if err:
                 msg = " Failed to start command '%s' " % command
                 self.error(msg, out, err)
-                raise RuntimeError, msg
+                raise RuntimeError(msg)
         
         return True
 
@@ -366,7 +366,7 @@ class LinuxTap(LinuxApplication):
         
         if proc.poll():
             self.error(msg, out, err)
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
     
         # Wait for pid file to be generated
         self._pid, self._ppid = self.node.wait_pid(
@@ -384,7 +384,7 @@ class LinuxTap(LinuxApplication):
             if err:
                 msg = " Failed to start command '%s' " % command
                 self.error(msg, out, err)
-                raise RuntimeError, msg
+                raise RuntimeError(msg)
 
         return self.wait_file(connection_run_home, "local_port")
 
@@ -412,7 +412,7 @@ class LinuxTap(LinuxApplication):
             if proc.poll() and err:
                 msg = " Failed to Kill the Tap"
                 self.error(msg, out, err)
-                raise RuntimeError, msg
+                raise RuntimeError(msg)
 
     def check_status(self):
         return self.node.status(self._pid, self._ppid)
@@ -422,7 +422,7 @@ class LinuxTap(LinuxApplication):
         result = None
         delay = 1.0
 
-        for i in xrange(20):
+        for i in range(20):
             (out, err), proc = self.node.check_output(home, filename)
             if out:
                 result = out.strip()
@@ -433,7 +433,7 @@ class LinuxTap(LinuxApplication):
         else:
             msg = "Couldn't retrieve %s" % filename
             self.error(msg, out, err)
-            raise RuntimeError, msg
+            raise RuntimeError(msg)
 
         return result