Merge "ForceDelete Instance"

This commit is contained in:
Zuul 2017-12-18 05:46:11 +00:00 committed by Gerrit Code Review
commit f2b4007837
3 changed files with 16 additions and 2 deletions

View File

@ -445,9 +445,12 @@ echo -e '%s\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers
return False
status = self.get_status(server)
if status in ("DELETED", "SOFT_DELETED"):
if status == 'DELETED':
return True
if status == 'ERROR':
if status == 'SOFT_DELETED':
self.client().servers.force_delete(server_id)
elif status == 'ERROR':
fault = getattr(server, 'fault', {})
message = fault.get('message', 'Unknown')
code = fault.get('code')

View File

@ -287,6 +287,8 @@ class FakeSessionClient(base_client.SessionClient):
assert set(body[action].keys()) == set(['host',
'block_migration',
'disk_over_commit'])
elif action == 'forceDelete':
assert body is not None
else:
raise AssertionError("Unexpected server action: %s" % action)
return (resp, _body)

View File

@ -0,0 +1,9 @@
---
fixes:
- Force delete the nova instance.
If a resource is related with a nova instance which
is in 'SOFT_DELETED' status, the resource can't be
deleted, when nova config 'reclaim_instance_interval'.
so, force-delete the nova instance, and then all the
resources are related with the instance would be
processed properly.