Do not disassociate floating ip again
The floating ips will be detached from server when delete the server. So we don't have to detach those floating ips explicitly before calling server delete. Change-Id: I7f85d7f12c58872d790ebfe565931985099ec846 Partial-Bug: #1700830
This commit is contained in:
parent
250a7d91d3
commit
fecd7a11a8
|
@ -1535,8 +1535,6 @@ class Server(server_base.BaseServer, sh.SchedulerHintsMixin,
|
|||
if self.resource_id is None:
|
||||
return
|
||||
|
||||
self._floating_ips_disassociate()
|
||||
|
||||
try:
|
||||
self.client().servers.delete(self.resource_id)
|
||||
except Exception as e:
|
||||
|
|
|
@ -259,13 +259,6 @@ class ServerNetworkMixin(object):
|
|||
self.client('neutron').update_floatingip(
|
||||
floating_ip, {'floatingip': floating_ip_data})
|
||||
|
||||
def _floating_ips_disassociate(self):
|
||||
networks = self.properties[self.NETWORKS] or []
|
||||
for network in networks:
|
||||
floating_ip = network.get(self.NETWORK_FLOATING_IP)
|
||||
if floating_ip is not None:
|
||||
self._floating_ip_disassociate(floating_ip)
|
||||
|
||||
def _floating_ip_disassociate(self, floating_ip):
|
||||
with self.client_plugin('neutron').ignore_not_found:
|
||||
self.client('neutron').update_floatingip(
|
||||
|
|
Loading…
Reference in New Issue