Allow ns-terminate params. Some other updates at ns
[osm/osmclient.git] / osmclient / common / wait.py
index 488bc61..d8923ba 100644 (file)
@@ -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,6 +28,7 @@ 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 = 5
@@ -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)