From: tierno Date: Thu, 17 Oct 2019 13:56:53 +0000 (+0000) Subject: fix bug 865 fix error deleting a non-instantiated ns X-Git-Tag: v7.0.0rc1~27 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=586ae81f64fb81d2e26b36c01174ea8d403d8402;p=osm%2FNBI.git fix bug 865 fix error deleting a non-instantiated ns Change-Id: I7f36893352c17aef89930f8d5b3f0718ba700992 Signed-off-by: tierno --- diff --git a/osm_nbi/instance_topics.py b/osm_nbi/instance_topics.py index 8c084e4..8024996 100644 --- a/osm_nbi/instance_topics.py +++ b/osm_nbi/instance_topics.py @@ -812,7 +812,7 @@ class NsLcmOpTopic(BaseTopic): if not nsr["_admin"].get("nsState") or nsr["_admin"]["nsState"] == "NOT_INSTANTIATED": if operation == "terminate" and indata.get("autoremove"): # NSR must be deleted - return None # a none in this case is used to indicate not instantiated. It can be removed + return None, None # a none in this case is used to indicate not instantiated. It can be removed if operation != "instantiate": raise EngineException("ns_instance '{}' cannot be '{}' because it is not instantiated".format( nsInstanceId, operation), HTTPStatus.CONFLICT) @@ -1270,7 +1270,7 @@ class NsiLcmOpTopic(BaseTopic): if not nsir["_admin"].get("nsiState") or nsir["_admin"]["nsiState"] == "NOT_INSTANTIATED": if operation == "terminate" and indata.get("autoremove"): # NSIR must be deleted - return None # a none in this case is used to indicate not instantiated. It can be removed + return None, None # a none in this case is used to indicate not instantiated. It can be removed if operation != "instantiate": raise EngineException("netslice_instance '{}' cannot be '{}' because it is not instantiated".format( netsliceInstanceId, operation), HTTPStatus.CONFLICT)