Commit 6a0f22e 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.
---
qa/qa_config.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/qa/qa_config.py b/qa/qa_config.py
index cf69750..4d13a84 100644
--- a/qa/qa_config.py
+++ b/qa/qa_config.py
@@ -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
--
1.8.1