From bc3efb241b6600b8a5732a92595cb7b1b25beef9 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 6 Nov 2024 10:37:32 +0100 Subject: [PATCH] Support return value id for create operations in adv cluster mgmt Change-Id: I9db03f76b5ce263501edd198ec9abbf80830ed34 Signed-off-by: garciadeblas --- osmclient/sol005/osm_api_object.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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() -- 2.25.1