Fixes issue #160
During deletion of a stack, following would occur:
delete stack
delete instance
delete eip or security group
When the last operation occurred, the instance is still present in OpenStack
making a deletion of EIP or security groups not work properly. Serialize
the operations in resources.
Change-Id: I6e1613f5a6f5db485dd8a5f381d7a96afb58188b
Signed-off-by: Steven Dake <sdake@redhat.com>
'Provided KeyName is not registered with nova'}
def handle_delete(self):
+ '''
+ Delete an instance, blocking until it is disposed by OpenStack
+ '''
try:
server = self.nova().servers.get(self.instance_id)
except NotFound:
pass
else:
server.delete()
+ while server.status == 'ACTIVE':
+ try:
+ server.get()
+ except NotFound:
+ break
+ eventlet.sleep(0.2)
self.instance_id = None