Merge "Remove transition logic for old tempest option renaming"
diff --git a/neutron_tempest_plugin/api/base.py b/neutron_tempest_plugin/api/base.py
index e17cf5e..4bcc6d2 100644
--- a/neutron_tempest_plugin/api/base.py
+++ b/neutron_tempest_plugin/api/base.py
@@ -595,15 +595,11 @@
# Generate subnet CIDRs starting from configured values
ip_version = ip_version or cls._ip_version
if ip_version == const.IP_VERSION_4:
- mask_bits = mask_bits or config.safe_get_config_value(
- 'network', 'project_network_mask_bits')
- cidr = netaddr.IPNetwork(config.safe_get_config_value(
- 'network', 'project_network_cidr'))
+ mask_bits = mask_bits or CONF.network.project_network_mask_bits
+ cidr = netaddr.IPNetwork(CONF.network.project_network_cidr)
elif ip_version == const.IP_VERSION_6:
- mask_bits = config.safe_get_config_value(
- 'network', 'project_network_v6_mask_bits')
- cidr = netaddr.IPNetwork(config.safe_get_config_value(
- 'network', 'project_network_v6_cidr'))
+ mask_bits = CONF.network.project_network_v6_mask_bits
+ cidr = netaddr.IPNetwork(CONF.network.project_network_v6_cidr)
else:
raise ValueError('Invalid IP version: {!r}'.format(ip_version))
diff --git a/neutron_tempest_plugin/api/test_routers.py b/neutron_tempest_plugin/api/test_routers.py
index 7758b1a..1430b81 100644
--- a/neutron_tempest_plugin/api/test_routers.py
+++ b/neutron_tempest_plugin/api/test_routers.py
@@ -38,9 +38,9 @@
def resource_setup(cls):
super(RoutersTest, cls).resource_setup()
cls.tenant_cidr = (
- config.safe_get_config_value('network', 'project_network_cidr')
+ CONF.network.project_network_cidr
if cls._ip_version == 4 else
- config.safe_get_config_value('network', 'project_network_v6_cidr'))
+ CONF.network.project_network_v6_cidr)
@decorators.idempotent_id('c72c1c0c-2193-4aca-eeee-b1442640eeee')
@tutils.requires_ext(extension="standard-attr-description",
diff --git a/neutron_tempest_plugin/config.py b/neutron_tempest_plugin/config.py
index 55d9d9e..23757c1 100644
--- a/neutron_tempest_plugin/config.py
+++ b/neutron_tempest_plugin/config.py
@@ -259,19 +259,3 @@
name='designate_feature_enabled', title='Enabled Designate Features')
CONF.register_group(dns_feature_group)
CONF.register_opts(DnsFeatureGroup, group="designate_feature_enabled")
-
-config_opts_translator = {
- 'project_network_cidr': 'tenant_network_cidr',
- 'project_network_v6_cidr': 'tenant_network_v6_cidr',
- 'project_network_mask_bits': 'tenant_network_mask_bits',
- 'project_network_v6_mask_bits': 'tenant_network_v6_mask_bits'}
-
-
-def safe_get_config_value(group, name):
- """Safely get Oslo config opts from Tempest, using old and new names."""
- conf_group = getattr(CONF, group)
-
- try:
- return getattr(conf_group, name)
- except cfg.NoSuchOptError:
- return getattr(conf_group, config_opts_translator[name])