diff options
-rw-r--r-- | INFO | 1 | ||||
-rw-r--r-- | apex/settings/network_settings.py | 7 | ||||
-rw-r--r-- | apex/tests/test_apex_network_settings.py | 3 |
3 files changed, 9 insertions, 2 deletions
@@ -24,5 +24,6 @@ Dan Radez (dradez@redhat.com) Tim Rozet (trozet@redhat.com) Michael Chapman (michapma@redhat.com) Feng Pan (fpan@redhat.com) +Ricardo Noriega (rnoriega@redhat.com) Link to TSC approval of the project: http://ircbot.wl.linuxfoundation.org/meetings/opnfv-meeting/2015/opnfv-meeting.2015-07-14-14.00.html 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 |