Commit 0b38cf6e authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Don't pass sstore to LUs anymore

sstore is no longer used in LUs.

Reviewed-by: iustinp
parent a42872ff
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment