Replaces uuid.uuid4 with uuidutils.generate_uuid()

Change-Id: If081b1a2be6ebb39d7cbd8696ceb145960347aa9
Closes-Bug: #1082248
This commit is contained in:
SongmingYan 2016-11-10 20:59:21 -05:00 committed by Songming Yan
parent 1128313367
commit 4e615b1729
2 changed files with 9 additions and 8 deletions

View File

@ -14,9 +14,9 @@
import mock
import testtools
import uuid
from oslo_config import cfg
from oslo_utils import uuidutils
from neutron.agent.l3 import l3_agent_extension_api as l3_agent_api
from neutron.agent.l3 import router_info
@ -67,9 +67,10 @@ class TestFwaasL3AgentRpcCallback(base.BaseTestCase):
self.api = FWaasAgent(host=None, conf=self.conf)
self.api.fwaas_driver = test_firewall_agent_api.NoopFwaasDriver()
self.adminContext = context.get_admin_context()
self.router_id = str(uuid.uuid4())
self.router_id = uuidutils.generate_uuid()
self.agent_conf = mock.Mock()
project_id = str(uuid.uuid4()) # For 'tenant_id' and 'project_id' keys
# For 'tenant_id' and 'project_id' keys
project_id = uuidutils.generate_uuid()
self.ri_kwargs = {'router': {'id': self.router_id,
'tenant_id': project_id,
'project_id': project_id},
@ -326,7 +327,8 @@ class TestFwaasL3AgentRpcCallback(base.BaseTestCase):
# rtr2 has no router_info
ri = self._prepare_router_data()
rtr2 = {'id': str(uuid.uuid4()), 'tenant_id': ri.router['tenant_id']}
rtr2 = {'id': uuidutils.generate_uuid(),
'tenant_id': ri.router['tenant_id']}
routers = [rtr2]
router_info = {}

View File

@ -13,10 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import uuid
import mock
from oslo_config import cfg
from oslo_utils import uuidutils
from neutron.agent.l3 import l3_agent_extension_api as l3_agent_api
from neutron.agent.l3 import router_info
@ -85,10 +84,10 @@ class TestFWaaSL3AgentExtension(base.BaseTestCase):
self.api.fwaas_driver = test_firewall_agent_api.NoopFwaasDriverV2()
self.adminContext = context.get_admin_context()
self.context = mock.sentinel.context
self.router_id = str(uuid.uuid4())
self.router_id = uuidutils.generate_uuid()
self.agent_conf = mock.Mock()
self.ri_kwargs = {'router': {'id': self.router_id,
'project_id': str(uuid.uuid4())},
'project_id': uuidutils.generate_uuid()},
'agent_conf': self.agent_conf,
'interface_driver': mock.ANY,
'use_ipv6': mock.ANY