Add retries for deleting VMs

Change-Id: I5f4d2b5577b3ff252ec69603c4d77656d21022c5
This commit is contained in:
Yichen Wang 2019-09-04 21:10:03 -07:00
parent 2b53ece6de
commit 1d6c4a23a2
2 changed files with 7 additions and 2 deletions

View File

@ -1,4 +1,4 @@
[gerrit] [gerrit]
host=review.openstack.org host=review.openstack.org
port=29418 port=29418
project=openstack/vmtp.git project=x/vmtp.git

View File

@ -230,7 +230,12 @@ class Compute(object):
return False return False
def delete_server(self, server): def delete_server(self, server):
self.novaclient.servers.delete(server) for _ in range(1, 5):
try:
self.novaclient.servers.delete(server)
except novaclient.exceptions.NotFound:
break
time.sleep(2)
def find_flavor(self, flavor_type): def find_flavor(self, flavor_type):
try: try: