From: garciadeblas Date: Wed, 6 Nov 2024 09:37:32 +0000 (+0100) Subject: Support return value id for create operations in adv cluster mgmt X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F02%2F14702%2F2;p=osm%2Fosmclient.git Support return value id for create operations in adv cluster mgmt Change-Id: I9db03f76b5ce263501edd198ec9abbf80830ed34 Signed-off-by: garciadeblas --- diff --git a/osmclient/sol005/osm_api_object.py b/osmclient/sol005/osm_api_object.py index 780bb04..59065a7 100644 --- a/osmclient/sol005/osm_api_object.py +++ b/osmclient/sol005/osm_api_object.py @@ -274,9 +274,12 @@ class GenericOSMAPIObject(ABC): if resp: resp = json.loads(resp) self._logger.debug(f"Resp: {resp}") - if not resp or "_id" not in resp: + if not resp or ("_id" not in resp and "id" not in resp): raise ClientException("Unexpected response from server - {}".format(resp)) - print(resp["_id"]) + if "id" in resp: + print(resp["id"]) + else: + print(resp["_id"]) if tempdir: tempdir.cleanup()