Wait for 404 on floatingip delete
Currently the FloatingIP resource assumes that delete is an atomic operation, but there have been reports of downstream dependency deletes failing because the floatingip still exists. This change triggers the standard neutron resource check_delete_complete 404 polling to ensure the floatingip really is gone. Change-Id: I9be34ef8b64a79d3211841cb7a7acd945f1f107c Closes-Bug: #1595270
This commit is contained in:
parent
0864664209
commit
a3860b1162
@ -243,6 +243,7 @@ class FloatingIP(neutron.NeutronResource):
|
|||||||
def handle_delete(self):
|
def handle_delete(self):
|
||||||
with self.client_plugin().ignore_not_found:
|
with self.client_plugin().ignore_not_found:
|
||||||
self.client().delete_floatingip(self.resource_id)
|
self.client().delete_floatingip(self.resource_id)
|
||||||
|
return True
|
||||||
|
|
||||||
def handle_update(self, json_snippet, tmpl_diff, prop_diff):
|
def handle_update(self, json_snippet, tmpl_diff, prop_diff):
|
||||||
if prop_diff:
|
if prop_diff:
|
||||||
|
@ -194,13 +194,28 @@ class NeutronFloatingIPTest(common.HeatTestCase):
|
|||||||
).AndRaise(qe.NeutronClientException(status_code=404))
|
).AndRaise(qe.NeutronClientException(status_code=404))
|
||||||
neutronclient.Client.show_floatingip(
|
neutronclient.Client.show_floatingip(
|
||||||
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
||||||
).MultipleTimes().AndReturn({'floatingip': {
|
).AndReturn({'floatingip': {
|
||||||
|
'id': 'fc68ea2c-b60b-4b4f-bd82-94ec81110766',
|
||||||
|
'floating_network_id': u'abcd1234'
|
||||||
|
}})
|
||||||
|
neutronclient.Client.show_floatingip(
|
||||||
|
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
||||||
|
).AndReturn({'floatingip': {
|
||||||
'id': 'fc68ea2c-b60b-4b4f-bd82-94ec81110766',
|
'id': 'fc68ea2c-b60b-4b4f-bd82-94ec81110766',
|
||||||
'floating_network_id': u'abcd1234'
|
'floating_network_id': u'abcd1234'
|
||||||
}})
|
}})
|
||||||
|
|
||||||
neutronclient.Client.delete_floatingip(
|
neutronclient.Client.delete_floatingip(
|
||||||
'fc68ea2c-b60b-4b4f-bd82-94ec81110766').AndReturn(None)
|
'fc68ea2c-b60b-4b4f-bd82-94ec81110766').AndReturn(None)
|
||||||
|
neutronclient.Client.show_floatingip(
|
||||||
|
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
||||||
|
).AndReturn({'floatingip': {
|
||||||
|
'id': 'fc68ea2c-b60b-4b4f-bd82-94ec81110766',
|
||||||
|
'floating_network_id': u'abcd1234'
|
||||||
|
}})
|
||||||
|
neutronclient.Client.show_floatingip(
|
||||||
|
'fc68ea2c-b60b-4b4f-bd82-94ec81110766').AndRaise(
|
||||||
|
qe.NeutronClientException(status_code=404))
|
||||||
neutronclient.Client.delete_floatingip(
|
neutronclient.Client.delete_floatingip(
|
||||||
'fc68ea2c-b60b-4b4f-bd82-94ec81110766').AndRaise(
|
'fc68ea2c-b60b-4b4f-bd82-94ec81110766').AndRaise(
|
||||||
qe.NeutronClientException(status_code=404))
|
qe.NeutronClientException(status_code=404))
|
||||||
@ -388,6 +403,9 @@ class NeutronFloatingIPTest(common.HeatTestCase):
|
|||||||
neutronclient.Client.delete_floatingip(
|
neutronclient.Client.delete_floatingip(
|
||||||
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
||||||
).AndReturn(None)
|
).AndReturn(None)
|
||||||
|
neutronclient.Client.show_floatingip(
|
||||||
|
'fc68ea2c-b60b-4b4f-bd82-94ec81110766').AndRaise(
|
||||||
|
qe.NeutronClientException(status_code=404))
|
||||||
|
|
||||||
neutronclient.Client.delete_port(
|
neutronclient.Client.delete_port(
|
||||||
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
||||||
@ -527,7 +545,7 @@ class NeutronFloatingIPTest(common.HeatTestCase):
|
|||||||
}})
|
}})
|
||||||
neutronclient.Client.show_floatingip(
|
neutronclient.Client.show_floatingip(
|
||||||
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
||||||
).MultipleTimes().AndReturn({'floatingip': {
|
).AndReturn({'floatingip': {
|
||||||
'status': 'ACTIVE',
|
'status': 'ACTIVE',
|
||||||
'id': 'fc68ea2c-b60b-4b4f-bd82-94ec81110766',
|
'id': 'fc68ea2c-b60b-4b4f-bd82-94ec81110766',
|
||||||
'floating_ip_address': '172.24.4.98'
|
'floating_ip_address': '172.24.4.98'
|
||||||
@ -626,6 +644,9 @@ class NeutronFloatingIPTest(common.HeatTestCase):
|
|||||||
neutronclient.Client.delete_floatingip(
|
neutronclient.Client.delete_floatingip(
|
||||||
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
||||||
).AndReturn(None)
|
).AndReturn(None)
|
||||||
|
neutronclient.Client.show_floatingip(
|
||||||
|
'fc68ea2c-b60b-4b4f-bd82-94ec81110766').AndRaise(
|
||||||
|
qe.NeutronClientException(status_code=404))
|
||||||
|
|
||||||
neutronclient.Client.delete_port(
|
neutronclient.Client.delete_port(
|
||||||
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
|
||||||
|
Loading…
Reference in New Issue
Block a user