Add PaaS service creation UTs
[osm/osmclient.git] / osmclient / sol005 / ns.py
index fe3a2ba..992bf0f 100644 (file)
@@ -498,14 +498,13 @@ class Ns(object):
                 endpoint=self._apiBase, postfields_dict=ns
             )
 
-            if resp:
-                resp = json.loads(resp)
-                print(str(resp["id"]))
-
             if not resp or "id" not in resp:
                 raise ClientException(
                     "unexpected response from server - {} ".format(resp)
                 )
+            if resp:
+                resp = json.loads(resp)
+                print(str(resp["id"]))
             if wait:
                 # Wait for status for NS instance creation
                 self._wait(resp.get("nslcmop_id"), wait)