Previously if a service mapped to a network which was disabled, the
disabled network would fallback to using the ctlplane network. With the
recent change in THT, this is no longer the case:
https://review.openstack.org/#/c/614457/
With the above change, now any service pointing to a disabled network
now results in an empty string value being given for network variables.
This patch sets the service netmap in network-enviornment.yaml
appropriately based on which networks are enabled in apex.
Change-Id: Idf2919935aa707da6ca48968a04cf6653923d19d
Signed-off-by: Tim Rozet <trozet@redhat.com>
for flag in IPV6_FLAGS:
self[param_def][flag] = True
for flag in IPV6_FLAGS:
self[param_def][flag] = True
+ self._update_service_netmap(net_settings.enabled_network_list)
+
def _get_vlan(self, network):
if isinstance(network['nic_mapping'][CONTROLLER]['vlan'], int):
return network['nic_mapping'][CONTROLLER]['vlan']
def _get_vlan(self, network):
if isinstance(network['nic_mapping'][CONTROLLER]['vlan'], int):
return network['nic_mapping'][CONTROLLER]['vlan']
prefix = ''
self[reg][key] = self.tht_dir + prefix + postfix
prefix = ''
self[reg][key] = self.tht_dir + prefix + postfix
+ def _update_service_netmap(self, network_list):
+ if 'ServiceNetMap' not in self[param_def]:
+ return
+ for service, network in self[param_def]['ServiceNetMap'].items():
+ if network not in network_list:
+ self[param_def]['ServiceNetMap'][service] = 'ctlplane'
+
class NetworkEnvException(Exception):
def __init__(self, value):
class NetworkEnvException(Exception):
def __init__(self, value):
e = NetworkEnvException("test")
print(e)
assert_is_instance(e, NetworkEnvException)
e = NetworkEnvException("test")
print(e)
assert_is_instance(e, NetworkEnvException)
+
+ def test_service_netmap(self):
+ ns = copy(self.ns)
+ ns.enabled_network_list = ['admin']
+ ne = NetworkEnvironment(ns, os.path.join(TEST_BUILD_DIR, NET_ENV_FILE))
+ for network in ne['parameter_defaults']['ServiceNetMap'].values():
+ assert_equal(network, 'ctlplane')