diff --git a/daemon/core/session.py b/daemon/core/session.py index 7529decb..ef5da166 100644 --- a/daemon/core/session.py +++ b/daemon/core/session.py @@ -77,6 +77,8 @@ class Session(object): self._state = None self._hooks = {} self._state_hooks = {} + self.add_state_hook(coreapi.CORE_EVENT_RUNTIME_STATE, + self.runtime_state_hook) self.setstate(state=coreapi.CORE_EVENT_DEFINITION_STATE, info=False, sendevent=False) # dict of configuration items from /etc/core/core.conf config file @@ -344,6 +346,10 @@ class Session(object): except KeyError: pass + def runtime_state_hook(self, state): + if state == coreapi.CORE_EVENT_RUNTIME_STATE: + self.emane.poststartup() + def getenviron(self, state=True): ''' Get an environment suitable for a subprocess.Popen call. This is the current process environment with some session-specific @@ -614,7 +620,6 @@ class Session(object): # allow time for processes to start time.sleep(0.125) self.validatenodes() - self.emane.poststartup() # assume either all nodes have booted already, or there are some # nodes on slave servers that will be booted and those servers will # send a node status response message