X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fcommon%2Fwait.py;h=d8923ba988ab74f50ca3f31011c5f2a5795cb9d3;hb=refs%2Fchanges%2F17%2F8717%2F3;hp=a85808cd784a0be51a85a6c22f2d2ab909181bf2;hpb=09fa3d4dffb1fd9ea427f32a32264dd3bda56543;p=osm%2Fosmclient.git diff --git a/osmclient/common/wait.py b/osmclient/common/wait.py index a85808c..d8923ba 100644 --- a/osmclient/common/wait.py +++ b/osmclient/common/wait.py @@ -18,7 +18,7 @@ OSM API handling for the '--wait' option """ -from osmclient.common.exceptions import ClientException +from osmclient.common.exceptions import ClientException, NotFound import json from time import sleep import sys @@ -28,9 +28,10 @@ TIMEOUT_GENERIC_OPERATION = 600 TIMEOUT_NSI_OPERATION = TIMEOUT_GENERIC_OPERATION TIMEOUT_SDNC_OPERATION = TIMEOUT_GENERIC_OPERATION TIMEOUT_VIM_OPERATION = TIMEOUT_GENERIC_OPERATION +TIMEOUT_K8S_OPERATION = TIMEOUT_GENERIC_OPERATION TIMEOUT_WIM_OPERATION = TIMEOUT_GENERIC_OPERATION TIMEOUT_NS_OPERATION = 3600 -POLLING_TIME_INTERVAL = 1 +POLLING_TIME_INTERVAL = 5 MAX_DELETE_ATTEMPTS = 3 def _show_detailed_status(old_detailed_status, new_detailed_status): @@ -191,7 +192,9 @@ def wait_for_status(entity_label, entity_id, timeout, apiUrlStatus, http_cmd, de # There was a timeout, so raise an exception raise ClientException('operation timeout, waited for {} seconds'.format(timeout)) except ClientException as exc: - message="Operation failed for {}:\nerror:\n{}".format( + if deleteFlag and isinstance(exc, NotFound): + return + message = "Operation failed for {}:\nerror:\n{}".format( entity_label, - exc.message) + str(exc)) raise ClientException(message)