Merge "Fix duplicate dhcp edge name error"

This commit is contained in:
Jenkins 2015-09-07 14:52:17 +00:00 committed by Gerrit Code Review
commit dc02dc4b1c
2 changed files with 4 additions and 4 deletions

View File

@ -631,7 +631,8 @@ class EdgeManager(object):
router_id, binding['edge_id'], jobdata=jobdata, dist=dist)
def _allocate_dhcp_edge_appliance(self, context, resource_id):
resource_name = resource_id
resource_name = (vcns_const.DHCP_EDGE_PREFIX +
_uuid())[:vcns_const.EDGE_NAME_LEN]
self._allocate_edge_appliance(
context, resource_id, resource_name,
appliance_size=vcns_const.SERVICE_SIZE_MAPPING['dhcp'])

View File

@ -111,10 +111,9 @@ class EdgeDHCPManagerTestCase(EdgeUtilsTestCaseMixin):
self.edge_manager.create_dhcp_edge_service(self.ctx,
fake_network['id'],
fake_subnet)
resource_id = resource_name = (vcns_const.DHCP_EDGE_PREFIX +
fake_network['id'])[:36]
resource_id = (vcns_const.DHCP_EDGE_PREFIX + fake_network['id'])[:36]
self.nsxv_manager.update_edge.assert_called_once_with(
resource_id, 'edge-1', resource_name, None,
resource_id, 'edge-1', mock.ANY, None,
appliance_size=vcns_const.SERVICE_SIZE_MAPPING['dhcp'],
dist=False)