X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=accounts.py;h=a6dd6d269f88685221d099144f35220cad5b7cfd;hb=3e745a161b33bb6dfa2fcdec593866904d62a153;hp=3711a0d46dfbd430ad13cc6720eb1ccb392227d0;hpb=3d91a2d9f6ad2ec10711942f178f74bca4d2d2d9;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: