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
This commit is contained in:
parent
d88f3a34dd
commit
395c5b5b42
|
@ -54,6 +54,8 @@ class APIVersionRequest(object):
|
|||
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
|
||||
|
||||
|
|
|
@ -347,16 +347,18 @@ ComputeFeaturesGroup = [
|
|||
"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"),
|
||||
|
|
|
@ -177,8 +177,8 @@ class InvalidStructure(TempestException):
|
|||
|
||||
|
||||
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):
|
||||
|
|
Loading…
Reference in New Issue