Fix unit test that uses get_random_mac

Caused by change I28a2a1d85a85461f7a4344b86d18da7f68066c95

Change-Id: Ib848ad7e2a070d942d1ed5d5d58b4b9d50361e12
This commit is contained in:
Anna Khmelnitsky 2017-03-10 16:31:46 -08:00
parent a77354e5fb
commit a85f0c7341
1 changed files with 3 additions and 2 deletions

View File

@ -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,7 +774,7 @@ 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',
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: