Don't pass sstore to LUs anymore
authorMichael Hanselmann <hansmi@google.com>
Wed, 1 Oct 2008 17:37:05 +0000 (17:37 +0000)
committerMichael Hanselmann <hansmi@google.com>
Wed, 1 Oct 2008 17:37:05 +0000 (17:37 +0000)
sstore is no longer used in LUs.

Reviewed-by: iustinp

lib/cmdlib.py
lib/mcpu.py

index 7ffdc89..038f5a2 100644 (file)
@@ -56,7 +56,6 @@ class LogicalUnit(object):
     - redefine HPATH and HTYPE
     - optionally redefine their run requirements:
         REQ_MASTER: the LU needs to run on the master node
-        REQ_WSSTORE: the LU needs a writable SimpleStore
         REQ_BGL: the LU needs to hold the Big Ganeti Lock exclusively
 
   Note that all commands require root permissions.
@@ -66,10 +65,9 @@ class LogicalUnit(object):
   HTYPE = None
   _OP_REQP = []
   REQ_MASTER = True
-  REQ_WSSTORE = False
   REQ_BGL = True
 
-  def __init__(self, processor, op, context, sstore):
+  def __init__(self, processor, op, context):
     """Constructor for LogicalUnit.
 
     This needs to be overriden in derived classes in order to check op
@@ -79,7 +77,6 @@ class LogicalUnit(object):
     self.proc = processor
     self.op = op
     self.cfg = context.cfg
-    self.sstore = sstore
     self.context = context
     # Dicts used to declare locking needs to mcpu
     self.needed_locks = None
index 7b65252..2f60fd7 100644 (file)
@@ -34,7 +34,6 @@ from ganeti import constants
 from ganeti import errors
 from ganeti import rpc
 from ganeti import cmdlib
-from ganeti import ssconf
 from ganeti import logger
 from ganeti import locking
 
@@ -187,18 +186,13 @@ class Processor(object):
     if lu_class is None:
       raise errors.OpCodeUnknown("Unknown opcode")
 
-    if lu_class.REQ_WSSTORE:
-      sstore = ssconf.WritableSimpleStore()
-    else:
-      sstore = ssconf.SimpleStore()
-
     # Acquire the Big Ganeti Lock exclusively if this LU requires it, and in a
     # shared fashion otherwise (to prevent concurrent run with an exclusive LU.
     self.context.glm.acquire(locking.LEVEL_CLUSTER, [locking.BGL],
                              shared=not lu_class.REQ_BGL)
     try:
       self.exclusive_BGL = lu_class.REQ_BGL
-      lu = lu_class(self, op, self.context, sstore)
+      lu = lu_class(self, op, self.context)
       lu.ExpandNames()
       assert lu.needed_locks is not None, "needed_locks not set by LU"
       result = self._LockAndExecLU(lu, locking.LEVEL_INSTANCE)