Makes microversions config option clear about 'None'
If StrOpt option is explicitly set as None, oslo config
will return it as string "None" which should be invalid
configuration.
Example-
min_microversion = None will be end up with 'None'.
This commit makes that clear in config and raise exception
for the same.
Partially implements blueprint api-microversions-testing-support
Change-Id: I81e86faca6f8c0ffb7da22154a62236ac25cf0c0
diff --git a/tempest/common/api_version_request.py b/tempest/common/api_version_request.py
index 72a11ea..d8a5b56 100644
--- a/tempest/common/api_version_request.py
+++ b/tempest/common/api_version_request.py
@@ -54,6 +54,8 @@
None value should be used to create Null APIVersionRequest,
which is equal to 0.0
"""
+ # NOTE(gmann): 'version_string' as String "None" will be considered as
+ # invalid version string.
self.ver_major = 0
self.ver_minor = 0
diff --git a/tempest/config.py b/tempest/config.py
index 26dda2d..a6212fb 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -347,16 +347,18 @@
"The format is 'X.Y', where 'X' and 'Y' are int values. "
"Tempest selects tests based on the range between "
"min_microversion and max_microversion. "
- "If both values are None, Tempest avoids tests which "
- "require a microversion."),
+ "If both values are not specified, Tempest avoids tests "
+ "which require a microversion. Valid values are string "
+ "with format 'X.Y' or string 'latest'"),
cfg.StrOpt('max_microversion',
default=None,
help="Upper version of the test target microversion range. "
"The format is 'X.Y', where 'X' and 'Y' are int values. "
"Tempest selects tests based on the range between "
"min_microversion and max_microversion. "
- "If both values are None, Tempest avoids tests which "
- "require a microversion."),
+ "If both values are not specified, Tempest avoids tests "
+ "which require a microversion. Valid values are string "
+ "with format 'X.Y' or string 'latest'"),
cfg.BoolOpt('disk_config',
default=True,
help="If false, skip disk config tests"),
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index 8537898..1d725af 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -177,8 +177,8 @@
class InvalidAPIVersionString(TempestException):
- msg_fmt = ("API Version String %(version)s is of invalid format. Must "
- "be of format MajorNum.MinorNum.")
+ message = ("API Version String %(version)s is of invalid format. Must "
+ "be of format MajorNum.MinorNum or string 'latest'.")
class CommandFailed(Exception):