X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fcommon%2Fwait.py;h=3f5b51fb1bbb0632ffed60d318e7cb81634ee567;hb=refs%2Fchanges%2F66%2F13666%2F5;hp=d3f673c64a285d2bb51d3c92e3e27c9ee92161ee;hpb=95686bbc69ded243c346f94dceb0bee567572fb7;p=osm%2Fosmclient.git diff --git a/osmclient/common/wait.py b/osmclient/common/wait.py index d3f673c..3f5b51f 100644 --- a/osmclient/common/wait.py +++ b/osmclient/common/wait.py @@ -58,6 +58,8 @@ def _get_finished_states(entity): """ if entity == "NS" or entity == "NSI": return ("COMPLETED", "PARTIALLY_COMPLETED"), ("FAILED_TEMP", "FAILED") + elif entity == "OPCANCEL": + return ("FAILED_TEMP"), ("COMPLETED",) else: return ("ENABLED",), ("ERROR",) @@ -72,7 +74,7 @@ def _get_operational_state(resp, entity): :param entity: can be NS, NSI, or other :return: status of the operation """ - if entity == "NS" or entity == "NSI": + if entity in ["NS", "NSI", "OPCANCEL"]: return resp.get("operationState") else: return resp.get("_admin", {}).get("operationalState") @@ -111,7 +113,7 @@ def _get_detailed_status(resp, entity): :param entity: can be NS, NSI, or other :return: """ - if entity in ("NS", "NSI"): + if entity in ("NS", "NSI", "OPCANCEL"): # For NS and NSI, 'detailed-status' is a JSON "root" member: return resp.get("detailed-status") else: