Log the error when a resouce fails to delete
Also bail out of handle_delete if instance_id is None Change-Id: I2bd77345ac35860201006a23999a06dd81ac6fe0 Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
parent
f1eabe8073
commit
8c3f0f14a5
@ -287,6 +287,8 @@ class Instance(resources.Resource):
|
||||
'''
|
||||
Delete an instance, blocking until it is disposed by OpenStack
|
||||
'''
|
||||
if self.instance_id is None:
|
||||
return
|
||||
try:
|
||||
server = self.nova().servers.get(self.instance_id)
|
||||
except NotFound:
|
||||
|
@ -559,6 +559,8 @@ class Stack(object):
|
||||
for res in reversed(self):
|
||||
result = res.destroy()
|
||||
if result:
|
||||
logger.error('Failed to delete %s error: %s' % (str(res),
|
||||
result))
|
||||
failures.append(str(res))
|
||||
|
||||
if failures:
|
||||
|
@ -60,6 +60,8 @@ class User(Resource):
|
||||
return self.UPDATE_REPLACE
|
||||
|
||||
def handle_delete(self):
|
||||
if self.instance_id is None:
|
||||
return
|
||||
try:
|
||||
user = self.keystone().users.get(DummyId(self.instance_id))
|
||||
except Exception as ex:
|
||||
|
Loading…
x
Reference in New Issue
Block a user