Merge "Fix compute host delete with no kubernetes node"

This commit is contained in:
Zuul 2019-02-15 16:08:35 +00:00 committed by Gerrit Code Review
commit 61e2ac909e
1 changed files with 13 additions and 1 deletions

View File

@ -119,6 +119,18 @@ def delete_node(node_name):
# Delete the node
body = kubernetes.client.V1DeleteOptions()
response = kube_client.delete_node(node_name, body)
try:
response = kube_client.delete_node(node_name, body)
except ApiException as e:
if e.status == httplib.NOT_FOUND:
# In some cases we may attempt to delete a node that exists in
# the VIM, but not yet in kubernetes (e.g. when the node is first
# being configured). Ignore the failure.
DLOG.info("Not deleting node %s because it doesn't exist" %
node_name)
return
else:
raise
return Result(response)