Merge "log if 'flat' interface and no cleaning network"

This commit is contained in:
Jenkins
2017-02-07 20:46:14 +00:00
committed by Gerrit Code Review
2 changed files with 3 additions and 7 deletions

View File

@@ -36,16 +36,12 @@ class FlatNetwork(common.VIFPortIDMixin, neutron.NeutronNetworkInterfaceMixin,
def __init__(self): def __init__(self):
cleaning_net = CONF.neutron.cleaning_network cleaning_net = CONF.neutron.cleaning_network
# TODO(vdrok): Switch to DriverLoadError in Ocata
if not cleaning_net: if not cleaning_net:
LOG.warning(_LW( LOG.warning(_LW(
'Please specify a valid UUID or name for ' 'Please specify a valid UUID or name for '
'[neutron]/cleaning_network configuration option so that ' '[neutron]/cleaning_network configuration option so that '
'this interface is able to perform cleaning. It will be ' 'this interface is able to perform cleaning. Otherwise, '
'required starting with the Ocata release, and if not ' 'cleaning operations will fail to start.'))
'specified then, the conductor service will fail to start if '
'"flat" is in the list of values for '
'[DEFAULT]enabled_network_interfaces configuration option.'))
def validate(self, task): def validate(self, task):
"""Validates the network interface. """Validates the network interface.

View File

@@ -68,7 +68,7 @@ class TestFlatInterface(db_base.DbTestCase):
mock_p_changed.assert_called_once_with(task, port) mock_p_changed.assert_called_once_with(task, port)
@mock.patch.object(flat_interface, 'LOG') @mock.patch.object(flat_interface, 'LOG')
def test_init_incorrect_cleaning_net(self, mock_log): def test_init_no_cleaning_network(self, mock_log):
self.config(cleaning_network=None, group='neutron') self.config(cleaning_network=None, group='neutron')
flat_interface.FlatNetwork() flat_interface.FlatNetwork()
self.assertTrue(mock_log.warning.called) self.assertTrue(mock_log.warning.called)