Fixing static lock messup with Ns3 DCE Manager
[nepi.git] / src / nepi / resources / linux / ns3 / ns3simulation.py
index 51da3a2..2abdb6f 100644 (file)
@@ -32,9 +32,6 @@ import os
 import time
 import threading
 
-## TODO: Clean up DCE part. All that is DCE specific should go
-##       in the linux ns3dceapplication.py
-
 @clsinit_copy
 class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
     _rtype = "linux::ns3::Simulation"
@@ -139,6 +136,7 @@ class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
         self._home = "ns3-simu-%s" % self.guid
         self._socket_name = "ns3-%s.sock" % os.urandom(4).encode('hex')
         self._enable_dce = None
+        self._dce_helper = None
 
     @property
     def socket_name(self):
@@ -350,10 +348,17 @@ class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
                 rm = self.ec.get_resource(guid)
                 if isinstance(rm, rclass):
                     self._enable_dce = True
+
+                    from nepi.resources.ns3.ns3dcehelper import NS3DceHelper
+                    self._dce_helper = NS3DceHelper(self)
                     break
 
         return self._enable_dce
 
+    @property
+    def dce_helper(self):
+        return self._dce_helper
+        
     @property
     def _start_command(self):
         command = []