Call start after initscript change. set_disklimit() workaround.
[nodemanager.git] / accounts.py
index fe0af53..12084c2 100644 (file)
@@ -29,6 +29,11 @@ import logger
 import tools
 
 
+# When this variable is true, start after any ensure_created
+startingup = False
+# Cumulative delay for starts when startingup is true
+cumstartdelay = 0
+
 # shell path -> account class association
 shell_acct_class = {}
 # account type -> account class association
@@ -64,10 +69,11 @@ class Account:
     def __init__(self, rec):
         self.name = rec['name']
         self.keys = ''
+        self.initscriptchanged = False
         self.configure(rec)
 
     @staticmethod
-    def create(name): abstract
+    def create(name, vref = None): abstract
     @staticmethod
     def destroy(name): abstract
 
@@ -116,7 +122,11 @@ 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 next_class != curr_class: self._acct.start()
+        if startingup:
+            self._acct.start(delay=cumstartdelay)
+            cumstartdelay += 2
+        elif next_class != curr_class or self._acct.initscriptchanged:
+            self._acct.start()
 
     def ensure_destroyed(self): self._q.put((self._ensure_destroyed,))
     def _ensure_destroyed(self): self._destroy(self._get_class())