log if 'flat' interface and no cleaning network

Commit cde11611d9 added a TODO (in
Ocata) to raise DriverLoadError if using 'flat' network interface
and cleaning_network config option is not set.

After discussions, we decided to keep the logging behaviour,
because one could use a flat network and not do any cleaning.
The logging message is updated to reflect this.

Change-Id: Ida3f3a349655bffc3ed0a307a3c18fbd69b42271
Fixes-Bug: 1661082
This commit is contained in:
Ruby Loo
2017-02-07 00:20:05 +00:00
parent 77bcccf98c
commit e3bd99f93a
2 changed files with 3 additions and 7 deletions

View File

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