summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2018-05-23 16:09:47 -0400
committerTim Rozet <trozet@redhat.com>2018-05-31 18:13:51 +0000
commit073cf28764cd3700916f57e43741ff20e4af57e5 (patch)
tree54445a3211944efeaaaf71678223f3cd7e1891df
parentfd7f3285fa0d872f3eb23ded248e45bf720ebda7 (diff)
Default ctlplane to native VLAN
We were not setting any vlan type value for the admin network. This caused an issue when deploying and trying to use a single collapsed network (no net isolation). The issue occurred when trying to create an external neutron network. We happen to check if the phys type is flat or vlan using this attribute to decide what kind of phys type to use for the neutron network. JIRA: APEX-606 Change-Id: I4e24dd5e8b99cef920b8203b820a77d0021631cc Signed-off-by: Tim Rozet <trozet@redhat.com> (cherry picked from commit 42a9303a21a46f9e9b1997ab4c0beceb6b0bf438)
-rw-r--r--apex/settings/network_settings.py7
-rw-r--r--apex/tests/test_apex_network_settings.py3
2 files changed, 8 insertions, 2 deletions
diff --git a/apex/settings/network_settings.py b/apex/settings/network_settings.py
index f6566834..36d143cb 100644
--- a/apex/settings/network_settings.py
+++ b/apex/settings/network_settings.py
@@ -167,10 +167,13 @@ class NetworkSettings(dict):
"""
_network = self.get_network(network)
# if vlan not defined then default it to native
- if network is not ADMIN_NETWORK:
- for role in ROLES:
+ for role in ROLES:
+ if network is not ADMIN_NETWORK:
if 'vlan' not in _network['nic_mapping'][role]:
_network['nic_mapping'][role]['vlan'] = 'native'
+ else:
+ # ctlplane network must be native
+ _network['nic_mapping'][role]['vlan'] = 'native'
cidr = _network.get('cidr')
diff --git a/apex/tests/test_apex_network_settings.py b/apex/tests/test_apex_network_settings.py
index 5e2fa072..764c9ef4 100644
--- a/apex/tests/test_apex_network_settings.py
+++ b/apex/tests/test_apex_network_settings.py
@@ -112,6 +112,9 @@ class TestNetworkSettings:
# remove vlan from storage net
storage_net_nicmap['compute'].pop('vlan', None)
assert_is_instance(NetworkSettings(ns), NetworkSettings)
+ for role in ('compute', 'controller'):
+ assert_equal(ns['networks'][ADMIN_NETWORK]['nic_mapping'][
+ role]['vlan'], 'native')
# TODO
# need to manipulate interfaces some how