diff --git a/hooks/neutron_ovs_utils.py b/hooks/neutron_ovs_utils.py index e1c70d58..d3c9d5eb 100644 --- a/hooks/neutron_ovs_utils.py +++ b/hooks/neutron_ovs_utils.py @@ -393,6 +393,7 @@ def configure_ovs(): if ext_port_ctx and ext_port_ctx['ext_port']: add_bridge_port(EXT_BRIDGE, ext_port_ctx['ext_port']) + bridgemaps = None if not use_dpdk(): portmaps = DataPortContext()() bridgemaps = parse_bridge_mappings(config('bridge-mappings')) @@ -420,7 +421,8 @@ def configure_ovs(): target = config('ipfix-target') bridges = [INT_BRIDGE, EXT_BRIDGE] - bridges.extend(bridgemaps.values()) + if bridgemaps: + bridges.extend(bridgemaps.values()) if target: for bridge in bridges: diff --git a/tox.ini b/tox.ini index 5faefea6..c5765bae 100644 --- a/tox.ini +++ b/tox.ini @@ -27,6 +27,11 @@ basepython = python3.5 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt +[testenv:py36] +basepython = python3.6 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + [testenv:pep8] basepython = python2.7 deps = -r{toxinidir}/requirements.txt diff --git a/unit_tests/test_neutron_ovs_utils.py b/unit_tests/test_neutron_ovs_utils.py index 0be557c8..81bbf25a 100644 --- a/unit_tests/test_neutron_ovs_utils.py +++ b/unit_tests/test_neutron_ovs_utils.py @@ -501,11 +501,12 @@ class TestNeutronOVSUtils(CharmTestCase): any_order=True ) + @patch.object(nutils, 'use_dvr') @patch('charmhelpers.contrib.openstack.context.config') - def test_configure_ovs_enable_ipfix(self, mock_config): + def test_configure_ovs_enable_ipfix(self, mock_config, mock_use_dvr): + mock_use_dvr.return_value = False mock_config.side_effect = self.test_config.get self.config.side_effect = self.test_config.get - self.test_config.set('plugin', 'ovs') self.test_config.set('ipfix-target', '127.0.0.1:80') nutils.configure_ovs() self.enable_ipfix.assert_has_calls([