Merge "Fix the docstring of skip_unless_config()"
diff --git a/tempest/config.py b/tempest/config.py
index db94e6c..3e0f28f 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -1390,7 +1390,7 @@
def skip_unless_config(*args):
- """Decorator to raise a skip if a config opt doesn't exist and is False
+ """Decorator to raise a skip if a config opt doesn't exist or is False
:param str group: The first arg, the option group to check
:param str name: The second arg, the option name to check
@@ -1407,21 +1407,21 @@
if not hasattr(CONF, group):
msg = "Config group %s doesn't exist" % group
raise testtools.TestCase.skipException(msg)
- else:
- conf_group = getattr(CONF, group)
- if not hasattr(conf_group, name):
- msg = "Config option %s.%s doesn't exist" % (group,
- name)
- raise testtools.TestCase.skipException(msg)
+
+ conf_group = getattr(CONF, group)
+ if not hasattr(conf_group, name):
+ msg = "Config option %s.%s doesn't exist" % (group,
+ name)
+ raise testtools.TestCase.skipException(msg)
+
+ value = getattr(conf_group, name)
+ if not value:
+ if len(args) == 3:
+ msg = args[2]
else:
- value = getattr(conf_group, name)
- if not value:
- if len(args) == 3:
- msg = args[2]
- else:
- msg = "Config option %s.%s is false" % (group,
- name)
- raise testtools.TestCase.skipException(msg)
+ msg = "Config option %s.%s is false" % (group,
+ name)
+ raise testtools.TestCase.skipException(msg)
return f(self, *func_args, **func_kwargs)
return wrapper
return decorator