From 78ff071ca331601c9faedaa85d390d0f5fcb16d6 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Thu, 20 Jul 2017 20:38:30 +0100 Subject: [PATCH] Refactor VIFPortIDMixin: rename This prepares the ground for addition of a VIF mixin without support for interacting with neutron, by explicitly showing that the current VIF mixin class is for neutron network interfaces. Change-Id: Ic0707c310c736c78f6f4fa0345311e99f7203a58 --- ironic/drivers/modules/network/common.py | 2 +- ironic/drivers/modules/network/flat.py | 4 ++-- ironic/drivers/modules/network/neutron.py | 2 +- ironic/tests/unit/drivers/modules/network/test_common.py | 6 +++--- ironic/tests/unit/drivers/modules/network/test_flat.py | 2 +- ironic/tests/unit/drivers/modules/network/test_neutron.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ironic/drivers/modules/network/common.py b/ironic/drivers/modules/network/common.py index d5e5f4afac..f1e20413b6 100644 --- a/ironic/drivers/modules/network/common.py +++ b/ironic/drivers/modules/network/common.py @@ -291,7 +291,7 @@ def plug_port_to_tenant_network(task, port_like_obj, client=None): raise exception.NetworkError(msg) -class VIFPortIDMixin(object): +class NeutronVIFPortIDMixin(object): def port_changed(self, task, port_obj): """Handle any actions required when a port changes diff --git a/ironic/drivers/modules/network/flat.py b/ironic/drivers/modules/network/flat.py index baf3d416bc..bdb6486fb4 100644 --- a/ironic/drivers/modules/network/flat.py +++ b/ironic/drivers/modules/network/flat.py @@ -30,8 +30,8 @@ LOG = log.getLogger(__name__) CONF = cfg.CONF -class FlatNetwork(common.VIFPortIDMixin, neutron.NeutronNetworkInterfaceMixin, - base.NetworkInterface): +class FlatNetwork(common.NeutronVIFPortIDMixin, + neutron.NeutronNetworkInterfaceMixin, base.NetworkInterface): """Flat network interface.""" def __init__(self): diff --git a/ironic/drivers/modules/network/neutron.py b/ironic/drivers/modules/network/neutron.py index 9d67e61238..fef7e76d89 100644 --- a/ironic/drivers/modules/network/neutron.py +++ b/ironic/drivers/modules/network/neutron.py @@ -28,7 +28,7 @@ LOG = log.getLogger(__name__) CONF = cfg.CONF -class NeutronNetwork(common.VIFPortIDMixin, +class NeutronNetwork(common.NeutronVIFPortIDMixin, neutron.NeutronNetworkInterfaceMixin, base.NetworkInterface): """Neutron v2 network interface""" diff --git a/ironic/tests/unit/drivers/modules/network/test_common.py b/ironic/tests/unit/drivers/modules/network/test_common.py index 9245514737..fc5c44d5e8 100644 --- a/ironic/tests/unit/drivers/modules/network/test_common.py +++ b/ironic/tests/unit/drivers/modules/network/test_common.py @@ -436,13 +436,13 @@ class TestCommonFunctions(db_base.DbTestCase): task, self.port) -class TestVifPortIDMixin(db_base.DbTestCase): +class TestNeutronVifPortIDMixin(db_base.DbTestCase): def setUp(self): - super(TestVifPortIDMixin, self).setUp() + super(TestNeutronVifPortIDMixin, self).setUp() self.config(enabled_drivers=['fake']) mgr_utils.mock_the_extension_manager() - self.interface = common.VIFPortIDMixin() + self.interface = common.NeutronVIFPortIDMixin() self.node = obj_utils.create_test_node(self.context, network_interface='neutron') self.port = obj_utils.create_test_port( diff --git a/ironic/tests/unit/drivers/modules/network/test_flat.py b/ironic/tests/unit/drivers/modules/network/test_flat.py index deb02ac3fb..1c4228dbb2 100644 --- a/ironic/tests/unit/drivers/modules/network/test_flat.py +++ b/ironic/tests/unit/drivers/modules/network/test_flat.py @@ -24,7 +24,7 @@ from ironic.tests.unit.db import base as db_base from ironic.tests.unit.objects import utils CONF = cfg.CONF -VIFMIXINPATH = 'ironic.drivers.modules.network.common.VIFPortIDMixin' +VIFMIXINPATH = 'ironic.drivers.modules.network.common.NeutronVIFPortIDMixin' class TestFlatInterface(db_base.DbTestCase): diff --git a/ironic/tests/unit/drivers/modules/network/test_neutron.py b/ironic/tests/unit/drivers/modules/network/test_neutron.py index e4cee72d4d..2836b9c265 100644 --- a/ironic/tests/unit/drivers/modules/network/test_neutron.py +++ b/ironic/tests/unit/drivers/modules/network/test_neutron.py @@ -28,7 +28,7 @@ from ironic.tests.unit.objects import utils CONF = cfg.CONF CLIENT_ID1 = '20:00:55:04:01:fe:80:00:00:00:00:00:00:00:02:c9:02:00:23:13:92' CLIENT_ID2 = '20:00:55:04:01:fe:80:00:00:00:00:00:00:00:02:c9:02:00:23:13:93' -VIFMIXINPATH = 'ironic.drivers.modules.network.common.VIFPortIDMixin' +VIFMIXINPATH = 'ironic.drivers.modules.network.common.NeutronVIFPortIDMixin' class NeutronInterfaceTestCase(db_base.DbTestCase):