Skip to content

Commit 2642588

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Format correctly (dialect=mac_unix_expanded) the MAC addresses" into stable/yoga
2 parents c341781 + 71a47b6 commit 2642588

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

neutron/tests/functional/agent/test_dhcp_agent.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import eventlet
2121
import fixtures
2222
import netaddr
23+
from neutron_lib.api import converters
2324
from neutron_lib import constants as lib_const
2425
from oslo_config import fixture as fixture_config
2526
from oslo_utils import uuidutils
@@ -42,10 +43,10 @@
4243

4344
class DHCPAgentOVSTestFramework(base.BaseSudoTestCase):
4445

45-
_DHCP_PORT_MAC_ADDRESS = netaddr.EUI("24:77:03:7d:00:4c")
46-
_DHCP_PORT_MAC_ADDRESS.dialect = netaddr.mac_unix
47-
_TENANT_PORT_MAC_ADDRESS = netaddr.EUI("24:77:03:7d:00:3a")
48-
_TENANT_PORT_MAC_ADDRESS.dialect = netaddr.mac_unix
46+
_DHCP_PORT_MAC_ADDRESS = converters.convert_to_sanitized_mac_address(
47+
'24:77:03:7d:00:4c')
48+
_TENANT_PORT_MAC_ADDRESS = converters.convert_to_sanitized_mac_address(
49+
'24:77:03:7d:00:3a')
4950

5051
_IP_ADDRS = {
5152
4: {'addr': '192.168.10.11',
@@ -307,9 +308,8 @@ def test_bad_address_allocation(self):
307308
network, port = self._get_network_port_for_allocation_test()
308309
network.ports.append(port)
309310
self.configure_dhcp_for_network(network=network)
310-
bad_mac_address = netaddr.EUI(self._TENANT_PORT_MAC_ADDRESS.value + 1)
311-
bad_mac_address.dialect = netaddr.mac_unix
312-
port.mac_address = str(bad_mac_address)
311+
port.mac_address = converters.convert_to_sanitized_mac_address(
312+
'24:77:03:7d:00:4d')
313313
self._plug_port_for_dhcp_request(network, port)
314314
self.assert_bad_allocation_for_port(network, port)
315315

0 commit comments

Comments
 (0)