From a85f0c73410f8106226561dd382102ba4580a054 Mon Sep 17 00:00:00 2001 From: Anna Khmelnitsky Date: Fri, 10 Mar 2017 16:31:46 -0800 Subject: [PATCH] Fix unit test that uses get_random_mac Caused by change I28a2a1d85a85461f7a4344b86d18da7f68066c95 Change-Id: Ib848ad7e2a070d942d1ed5d5d58b4b9d50361e12 --- vmware_nsx/tests/unit/nsx_v/test_plugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vmware_nsx/tests/unit/nsx_v/test_plugin.py b/vmware_nsx/tests/unit/nsx_v/test_plugin.py index 976f1953b0..0b7c4f9137 100644 --- a/vmware_nsx/tests/unit/nsx_v/test_plugin.py +++ b/vmware_nsx/tests/unit/nsx_v/test_plugin.py @@ -48,6 +48,7 @@ from neutron_lib import context from neutron_lib import exceptions as n_exc from neutron_lib.plugins import directory from neutron_lib.utils import helpers +from neutron_lib.utils import net from oslo_config import cfg from oslo_utils import uuidutils import six @@ -773,8 +774,8 @@ class TestPortsV2(NsxVPluginV2TestCase, # simulate duplicate mac generation to make sure DBDuplicate is retried responses = ['12:34:56:78:00:00', '12:34:56:78:00:00', '12:34:56:78:00:01'] - with mock.patch('neutron.common.utils.get_random_mac', - side_effect=responses) as grand_mac: + with mock.patch.object(net, 'get_random_mac', + side_effect=responses) as grand_mac: with self.subnet(enable_dhcp=False) as s: with self.port(subnet=s) as p1, self.port(subnet=s) as p2: self.assertEqual('12:34:56:78:00:00',