Don't trust the delete API.

Don't believe the API if it says it deleted a server.  Instead,
wait until the server doesn't show up in the future, and only then,
remove it from the DB.

Change-Id: I76a01f0c8a1e777d203e98d2c3623802634a4bc3
This commit is contained in:
James E. Blair
2012-08-02 17:38:03 -07:00
parent 1395b86a03
commit 194e025283

View File

@@ -59,6 +59,11 @@ def delete_machine(jenkins, client, machine):
if server:
utils.delete_server(server)
# Rackspace Nova sometimes lies about whether a server is deleted.
# If we have deleted a server, don't believe it. Instead, wait for
# the next run of the script and only if the server doesn't exist,
# delete it from Jenkins and the DB.
return
if jenkins:
if machine.jenkins_name:
@@ -77,6 +82,11 @@ def delete_image(client, image):
if server:
utils.delete_server(server)
# Rackspace Nova sometimes lies about whether a server is deleted.
# If we have deleted a server, don't believe it. Instead, wait for
# the next run of the script and only if the server doesn't exist,
# delete it from Jenkins and the DB.
return
try:
remote_image = client.images.get(image.external_id)