New list config option to list network features without API extension
Historically Neutron had API extensions to make it clear what feature is available and what is not. There are however features without new API extensions, see [1] and [2]. To avoid having lots of config options that makes it possible in a branchless tempest to detect if a given feature is available or not on a given Neutron branch this patch proposes a list config option similar to api_extensions: available_features. available_features is a list option with the special all entry, and new tests that depend on API extensionless features can use this to be skipped on older branches. [1] https://review.opendev.org/750355 [2] https://review.opendev.org/743695 Change-Id: I9d4be68db0f18dcaded4bfe78f5a314cb450987a
This commit is contained in:
parent
711e9f21c8
commit
f9bb8b8b21
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
New config option to ``network-feature-enabled``: ``available_features``.
|
||||||
|
This is a list which can contain features that are not discoverable
|
||||||
|
through Neutron API, or it can be the special entry ``all``.
|
@ -128,3 +128,18 @@ def is_extension_enabled(extension_name, service):
|
|||||||
if extension_name in config_dict[service]:
|
if extension_name in config_dict[service]:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def is_network_feature_enabled(feature_name):
|
||||||
|
"""A function that will check the list of available network features
|
||||||
|
|
||||||
|
"""
|
||||||
|
list_of_features = CONF.network_feature_enabled.available_features
|
||||||
|
|
||||||
|
if not list_of_features:
|
||||||
|
return False
|
||||||
|
if list_of_features[0] == 'all':
|
||||||
|
return True
|
||||||
|
if feature_name in list_of_features:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
@ -790,6 +790,13 @@ NetworkFeaturesGroup = [
|
|||||||
"entry all which indicates every extension is enabled. "
|
"entry all which indicates every extension is enabled. "
|
||||||
"Empty list indicates all extensions are disabled. "
|
"Empty list indicates all extensions are disabled. "
|
||||||
"To get the list of extensions run: 'neutron ext-list'"),
|
"To get the list of extensions run: 'neutron ext-list'"),
|
||||||
|
cfg.ListOpt('available_features',
|
||||||
|
default=['all'],
|
||||||
|
help="A list of available network features with a special "
|
||||||
|
"entry all that indicates every feature is available. "
|
||||||
|
"Empty list indicates all features are disabled."
|
||||||
|
"This list can contain features that are not "
|
||||||
|
"discoverable through API."),
|
||||||
cfg.BoolOpt('ipv6_subnet_attributes',
|
cfg.BoolOpt('ipv6_subnet_attributes',
|
||||||
default=False,
|
default=False,
|
||||||
help="Allow the execution of IPv6 subnet tests that use "
|
help="Allow the execution of IPv6 subnet tests that use "
|
||||||
|
Loading…
Reference in New Issue
Block a user