Commit f9329a6c authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

qa_config: Remove exclusive storage flag from config

Commit 6a0f22e1

 added the ability to track the status of the cluster-wide
flag for exclusive storage. It did so in a way which modifies the
in-memory configuration dictionary. This patch changes the code to use a
plain global variable as a temporary solution until a configuration
object is added.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent 595149d5
......@@ -35,8 +35,9 @@ import qa_error
_INSTANCE_CHECK_KEY = "instance-check"
_ENABLED_HV_KEY = "enabled-hypervisors"
# Key to store the cluster-wide run-time value of the exclusive storage flag
_EXCLUSIVE_STORAGE_KEY = "_exclusive_storage"
#: Cluster-wide run-time value of the exclusive storage flag
_exclusive_storage = None
cfg = {}
......@@ -247,14 +248,16 @@ def SetExclusiveStorage(value):
"""Set the expected value of the exclusive_storage flag for the cluster.
"""
cfg[_EXCLUSIVE_STORAGE_KEY] = bool(value)
global _exclusive_storage # pylint: disable=W0603
_exclusive_storage = bool(value)
def GetExclusiveStorage():
"""Get the expected value of the exclusive_storage flag for the cluster.
"""
val = cfg.get(_EXCLUSIVE_STORAGE_KEY)
val = _exclusive_storage
assert val is not None
return val
......
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