Support return value id for create operations in adv cluster mgmt 02/14702/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 6 Nov 2024 09:37:32 +0000 (10:37 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 6 Nov 2024 15:50:35 +0000 (16:50 +0100)
Change-Id: I9db03f76b5ce263501edd198ec9abbf80830ed34
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osmclient/sol005/osm_api_object.py

index 780bb04..59065a7 100644 (file)
@@ -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()