File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -142,11 +142,11 @@ def purge_node(node):
142142 client = _get_client ()
143143 node_id = node ['id' ]
144144 body , status = client .delete_node (node_id )
145- if status != 200 :
146- raise RuntimeError (' Could not purge node {node_id}: {body}' .format (** locals ()))
145+ if status not in [ 200 , 404 ] :
146+ raise RuntimeError (" Could not purge node {node_id}: {body}" .format (** locals ()))
147147 body , status = client .delete_client (node_id )
148- if status != 200 :
149- raise RuntimeError (' Could not purge node client {node_id}: {body}' .format (** locals ()))
148+ if status not in [ 200 , 404 ] :
149+ raise RuntimeError (" Could not purge node client {node_id}: {body}" .format (** locals ()))
150150
151151
152152def converge_controller ():
@@ -312,6 +312,6 @@ def _purge(databag_name, item_name):
312312 """
313313 client = _get_client ()
314314 body , status = client .delete_databag_item (databag_name , item_name )
315- if status == 200 or status == 404 :
315+ if status in [ 200 , 404 ] :
316316 return body , status
317317 raise RuntimeError ('Could not purge {item_name}: {body}' .format (** locals ()))
You can’t perform that action at this time.
0 commit comments