X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fcommon%2Fwait.py;fp=osmclient%2Fcommon%2Fwait.py;h=3f5b51fb1bbb0632ffed60d318e7cb81634ee567;hb=84fdd949fd48ea5da6939d711617c4b50b6cd2cf;hp=d3f673c64a285d2bb51d3c92e3e27c9ee92161ee;hpb=93c410936ee7e7114a98d1fd109c30cf48a9af46;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: