First simple draft for the deletion verification

This commit is contained in:
Jochen Breuer 2017-08-23 21:31:28 +02:00
parent f9b4976c02
commit 32d7d34fe5
No known key found for this signature in database
GPG key ID: 29ACE79F4D5EEE69

View file

@ -40,6 +40,7 @@ import base64
import logging
import yaml
import tempfile
from time import sleep
from salt.exceptions import CommandExecutionError
from salt.ext.six import iteritems
@ -692,7 +693,12 @@ def delete_deployment(name, namespace='default', **kwargs):
name=name,
namespace=namespace,
body=body)
return api_response.to_dict()
mutable_api_response = api_response.to_dict()
while show_deployment(name, namespace) is not None:
sleep(0.5)
else:
mutable_api_response['code'] = 200
return mutable_api_response
except (ApiException, HTTPError) as exc:
if isinstance(exc, ApiException) and exc.status == 404:
return None