applied the except and raise fixers to the master branch to close the gap with py3
[nepi.git] / src / nepi / resources / ns3 / ns3node.py
index 0e5da2e..ca63c3c 100644 (file)
@@ -3,9 +3,8 @@
 #    Copyright (C) 2014 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
@@ -58,7 +57,7 @@ class NS3BaseNode(NS3Base):
             if not self._simulation:
                 msg = "Node not connected to simulation"
                 self.error(msg)
-                raise RuntimeError, msg
+                raise RuntimeError(msg)
 
         return self._simulation
          
@@ -101,7 +100,7 @@ class NS3BaseNode(NS3Base):
             if not devices: 
                 msg = "Node not connected to devices"
                 self.error(msg)
-                raise RuntimeError, msg
+                raise RuntimeError(msg)
 
             self._devices = devices
 
@@ -185,7 +184,11 @@ class NS3BaseNode(NS3Base):
 
         container_uuid = self.simulation.create("NodeContainer")
         self.simulation.invoke(container_uuid, "Add", self.uuid)
-        with dceapp.dce_manager_lock:
-            self.simulation.invoke(dceapp.dce_manager_helper_uuid, 
-                    "Install", container_uuid)
+        
+        dce_helper = self.simulation.dce_helper
+
+        with dce_helper.dce_manager_lock:
+            dce_manager_uuid = dce_helper.dce_manager_uuid
+
+            self.simulation.invoke(dce_manager_uuid, "Install", container_uuid)