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
This commit is contained in:
parent
5ea8d9f354
commit
78ff071ca3
@ -291,7 +291,7 @@ def plug_port_to_tenant_network(task, port_like_obj, client=None):
|
|||||||
raise exception.NetworkError(msg)
|
raise exception.NetworkError(msg)
|
||||||
|
|
||||||
|
|
||||||
class VIFPortIDMixin(object):
|
class NeutronVIFPortIDMixin(object):
|
||||||
|
|
||||||
def port_changed(self, task, port_obj):
|
def port_changed(self, task, port_obj):
|
||||||
"""Handle any actions required when a port changes
|
"""Handle any actions required when a port changes
|
||||||
|
@ -30,8 +30,8 @@ LOG = log.getLogger(__name__)
|
|||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
|
|
||||||
|
|
||||||
class FlatNetwork(common.VIFPortIDMixin, neutron.NeutronNetworkInterfaceMixin,
|
class FlatNetwork(common.NeutronVIFPortIDMixin,
|
||||||
base.NetworkInterface):
|
neutron.NeutronNetworkInterfaceMixin, base.NetworkInterface):
|
||||||
"""Flat network interface."""
|
"""Flat network interface."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -28,7 +28,7 @@ LOG = log.getLogger(__name__)
|
|||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
|
|
||||||
|
|
||||||
class NeutronNetwork(common.VIFPortIDMixin,
|
class NeutronNetwork(common.NeutronVIFPortIDMixin,
|
||||||
neutron.NeutronNetworkInterfaceMixin,
|
neutron.NeutronNetworkInterfaceMixin,
|
||||||
base.NetworkInterface):
|
base.NetworkInterface):
|
||||||
"""Neutron v2 network interface"""
|
"""Neutron v2 network interface"""
|
||||||
|
@ -436,13 +436,13 @@ class TestCommonFunctions(db_base.DbTestCase):
|
|||||||
task, self.port)
|
task, self.port)
|
||||||
|
|
||||||
|
|
||||||
class TestVifPortIDMixin(db_base.DbTestCase):
|
class TestNeutronVifPortIDMixin(db_base.DbTestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestVifPortIDMixin, self).setUp()
|
super(TestNeutronVifPortIDMixin, self).setUp()
|
||||||
self.config(enabled_drivers=['fake'])
|
self.config(enabled_drivers=['fake'])
|
||||||
mgr_utils.mock_the_extension_manager()
|
mgr_utils.mock_the_extension_manager()
|
||||||
self.interface = common.VIFPortIDMixin()
|
self.interface = common.NeutronVIFPortIDMixin()
|
||||||
self.node = obj_utils.create_test_node(self.context,
|
self.node = obj_utils.create_test_node(self.context,
|
||||||
network_interface='neutron')
|
network_interface='neutron')
|
||||||
self.port = obj_utils.create_test_port(
|
self.port = obj_utils.create_test_port(
|
||||||
|
@ -24,7 +24,7 @@ from ironic.tests.unit.db import base as db_base
|
|||||||
from ironic.tests.unit.objects import utils
|
from ironic.tests.unit.objects import utils
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
VIFMIXINPATH = 'ironic.drivers.modules.network.common.VIFPortIDMixin'
|
VIFMIXINPATH = 'ironic.drivers.modules.network.common.NeutronVIFPortIDMixin'
|
||||||
|
|
||||||
|
|
||||||
class TestFlatInterface(db_base.DbTestCase):
|
class TestFlatInterface(db_base.DbTestCase):
|
||||||
|
@ -28,7 +28,7 @@ from ironic.tests.unit.objects import utils
|
|||||||
CONF = cfg.CONF
|
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_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'
|
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):
|
class NeutronInterfaceTestCase(db_base.DbTestCase):
|
||||||
|
Loading…
Reference in New Issue
Block a user