X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=accounts.py;h=a6dd6d269f88685221d099144f35220cad5b7cfd;hb=54d24023edce344ad1790c3bf89e93817c3c98e6;hp=3711a0d46dfbd430ad13cc6720eb1ccb392227d0;hpb=23d70016c30b00fe6bbc0ca5eb143ff6254e7089;p=nodemanager.git diff --git a/accounts.py b/accounts.py index 3711a0d..a6dd6d2 100644 --- a/accounts.py +++ b/accounts.py @@ -95,7 +95,7 @@ class Account: def start(self, delay=0): pass def stop(self): pass - + def is_running(self): pass class Worker: # these semaphores are acquired before creating/destroying an account @@ -128,7 +128,7 @@ class Worker: finally: self._create_sem.release() if not isinstance(self._acct, next_class): self._acct = next_class(rec) else: self._acct.configure(rec) - if startingup: + if startingup or not self.is_running(): csd_lock.acquire() global cumstartdelay delay = cumstartdelay @@ -147,6 +147,8 @@ class Worker: def stop(self): self._q.put((self._stop,)) def _stop(self): self._acct.stop() + def is_running(self): self._acct.is_running() + def _destroy(self, curr_class): self._acct = None if curr_class: