From e3bd99f93ad31d0e019612ed6557646d8f9975ac Mon Sep 17 00:00:00 2001 From: Ruby Loo Date: Tue, 7 Feb 2017 00:20:05 +0000 Subject: [PATCH] log if 'flat' interface and no cleaning network Commit cde11611d93946a1c79e406dc429aa5e742da729 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 --- ironic/drivers/modules/network/flat.py | 8 ++------ ironic/tests/unit/drivers/modules/network/test_flat.py | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ironic/drivers/modules/network/flat.py b/ironic/drivers/modules/network/flat.py index ec4ea8eff3..6942e2d766 100644 --- a/ironic/drivers/modules/network/flat.py +++ b/ironic/drivers/modules/network/flat.py @@ -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. diff --git a/ironic/tests/unit/drivers/modules/network/test_flat.py b/ironic/tests/unit/drivers/modules/network/test_flat.py index d6380fff1c..deb02ac3fb 100644 --- a/ironic/tests/unit/drivers/modules/network/test_flat.py +++ b/ironic/tests/unit/drivers/modules/network/test_flat.py @@ -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)