Merge "Extract update_port call into method"

This commit is contained in:
Jenkins 2016-06-22 17:55:43 +00:00 committed by Gerrit Code Review
commit a87a06a8fd

View File

@ -243,6 +243,12 @@ class API(base_api.NetworkAPI):
LOG.exception(_LE('Neutron error creating port on network %s'), LOG.exception(_LE('Neutron error creating port on network %s'),
network_id, instance=instance) network_id, instance=instance)
def _update_port(self, port_client, instance, port_id,
port_req_body):
port_client.update_port(port_id, port_req_body)
LOG.debug('Successfully updated port: %s', port_id,
instance=instance)
@staticmethod @staticmethod
def _populate_mac_address(instance, port_req_body, available_macs): def _populate_mac_address(instance, port_req_body, available_macs):
if available_macs is not None: if available_macs is not None:
@ -629,10 +635,10 @@ class API(base_api.NetworkAPI):
created_port_ids.append(created_port_id) created_port_ids.append(created_port_id)
ports_in_requested_order.append(created_port_id) ports_in_requested_order.append(created_port_id)
else: else:
port = ports[request.port_id] self._update_port(
port_client.update_port(port['id'], port_req_body) port_client, instance, request.port_id, port_req_body)
preexisting_port_ids.append(port['id']) preexisting_port_ids.append(request.port_id)
ports_in_requested_order.append(port['id']) ports_in_requested_order.append(request.port_id)
self._update_port_dns_name(context, instance, network, self._update_port_dns_name(context, instance, network,
ports_in_requested_order[-1], ports_in_requested_order[-1],