From: Alina Quereilhac Date: Fri, 3 Jun 2011 00:54:24 +0000 (+0200) Subject: Bug fix: in netns DesignOnly attributes should not be set in the python objects X-Git-Tag: nepi_v2_1~46 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0c33af0ee268cd12a5d4ef1fc65960aa0fff98fc;p=nepi.git Bug fix: in netns DesignOnly attributes should not be set in the python objects --- diff --git a/src/nepi/testbeds/netns/execute.py b/src/nepi/testbeds/netns/execute.py index 2ec1a72c..c6de813c 100644 --- a/src/nepi/testbeds/netns/execute.py +++ b/src/nepi/testbeds/netns/execute.py @@ -32,6 +32,10 @@ class TestbedController(testbed_impl.TestbedController): def set(self, guid, name, value, time = TIME_NOW): super(TestbedController, self).set(guid, name, value, time) # TODO: take on account schedule time for the task + factory_id = self._create[guid] + factory = self._factories[factory_id] + if factory.box_attributes.is_attribute_design_only(name): + return element = self._elements.get(guid) if element: setattr(element, name, value) diff --git a/src/nepi/testbeds/ns3/execute.py b/src/nepi/testbeds/ns3/execute.py index 1e5a8b93..bdc05539 100644 --- a/src/nepi/testbeds/ns3/execute.py +++ b/src/nepi/testbeds/ns3/execute.py @@ -55,14 +55,12 @@ class TestbedController(testbed_impl.TestbedController): self._condition = threading.Condition() self._simulator_thread = threading.Thread(target = self._simulator_run, args = [self._condition]) - self._simulator_thread.setDaemon(True) self._simulator_thread.start() def stop(self, time = TIME_NOW): super(TestbedController, self).stop(time) - # BUG!!!! RealtimeSimulatorImpl never stops simulation with Stop()!!! - self.ns3.Simulator.Stop() - #self._stop_simulation(time) + #self.ns3.Simulator.Stop() + self._stop_simulation(time) def set(self, guid, name, value, time = TIME_NOW): super(TestbedController, self).set(guid, name, value, time) @@ -133,14 +131,10 @@ class TestbedController(testbed_impl.TestbedController): element.Cleanup() self._elements.clear() if self.ns3: - self.ns3.Simulator.Stop() - ################################################## - # BUG!!!! RealtimeSimulatorImpl never stops simulation with Stop()!!! - # self._stop_simulation("0s") - # if self._simulator_thread: - # print "Joining thread" - # self._simulator_thread.join() - ################################################# + #self.ns3.Simulator.Stop() + self._stop_simulation("0s") + if self._simulator_thread: + self._simulator_thread.join() self.ns3.Simulator.Destroy() self._ns3 = None sys.stdout.flush()