summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeng Pan <fpan@redhat.com>2018-05-29 17:13:01 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-05-29 17:13:01 +0000
commitf0268bd12aab93870a8f2f322f75ccf3965ca476 (patch)
treeaf1851d40e13fc8ba910daf357b9b20dabbdfb15
parent23fc66e5bce6fe634d6e99cfa89d0424a47e66a1 (diff)
parent42a9303a21a46f9e9b1997ab4c0beceb6b0bf438 (diff)
Merge "Default ctlplane to native VLAN"
-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