From f9329a6c3e72464f73abddbf24d2c214d17c1e74 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Mon, 4 Feb 2013 17:05:29 +0100
Subject: [PATCH] qa_config: Remove exclusive storage flag from config

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 as a temporary solution until a configuration
object is added.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
---
 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 cf697509f..4d13a8483 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
 
-- 
GitLab