diff --git a/hooks/neutron_ovs_utils.py b/hooks/neutron_ovs_utils.py index cc027884..f086102f 100644 --- a/hooks/neutron_ovs_utils.py +++ b/hooks/neutron_ovs_utils.py @@ -700,6 +700,10 @@ def configure_ovs(): ifdata=generate_external_ids(br), portdata=generate_external_ids(br)) else: + log('{} is a Linux bridge: using Linux bridges in the ' + 'data-port config is deprecated for removal after ' + '21.10 release of OpenStack charms.'.format(port), + level=WARNING) add_ovsbridge_linuxbridge( br, port, ifdata=generate_external_ids(br), portdata=generate_external_ids(br)) diff --git a/unit_tests/test_neutron_ovs_utils.py b/unit_tests/test_neutron_ovs_utils.py index d221fd7e..a897fe53 100644 --- a/unit_tests/test_neutron_ovs_utils.py +++ b/unit_tests/test_neutron_ovs_utils.py @@ -70,6 +70,7 @@ TO_PATCH = [ 'is_container', 'is_unit_paused_set', 'deferrable_svc_restart', + 'log', ] head_pkg = 'linux-headers-3.15.0-5-generic' @@ -660,8 +661,22 @@ class TestNeutronOVSUtils(CharmTestCase): _nics.return_value = ['br-juju'] self.add_bridge.reset_mock() self.add_bridge_port.reset_mock() + expected_ifdata = { + 'external-ids': { + 'charm-neutron-openvswitch': 'br-foo' + } + } nutils.configure_ovs() - self.assertTrue(self.add_ovsbridge_linuxbridge.called) + self.add_ovsbridge_linuxbridge.assert_called_once_with( + 'br-foo', + 'br-juju', + ifdata=expected_ifdata, + portdata=expected_ifdata, + ) + self.log.assert_called_with( + 'br-juju is a Linux bridge: using Linux bridges in the data-port ' + 'config is deprecated for removal after 21.10 release of OpenStack' + ' charms.', level='WARNING') @patch.object(nutils, 'use_dvr') @patch('charmhelpers.contrib.network.ovs.charm_name')