Skip to content
Snippets Groups Projects
Commit cf632f3e authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

QA: Better initialization of a global dictionary


The global 'cfg' variable is initialized to an empty dictionary, so there
is no more need to disable some pylint checks.

Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 906a0346
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ _INSTANCE_CHECK_KEY = "instance-check"
_ENABLED_HV_KEY = "enabled-hypervisors"
cfg = None
cfg = {}
options = None
......@@ -80,7 +80,7 @@ def Validate():
def get(name, default=None):
return cfg.get(name, default) # pylint: disable=E1103
return cfg.get(name, default)
class Either:
......@@ -149,7 +149,7 @@ def TestEnabled(tests, _cfg=None):
_cfg = cfg
# Get settings for all tests
cfg_tests = _cfg.get("tests", {}) # pylint: disable=E1103
cfg_tests = _cfg.get("tests", {})
# Get default setting
default = cfg_tests.get("default", True)
......@@ -162,7 +162,7 @@ def GetInstanceCheckScript():
"""Returns path to instance check script or C{None}.
"""
return cfg.get(_INSTANCE_CHECK_KEY, None) # pylint: disable=E1103
return cfg.get(_INSTANCE_CHECK_KEY, None)
def GetEnabledHypervisors():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment