Fix bug in vnfd/nsd creation when reporting errors
[osm/osmclient.git] / osmclient / sol005 / vnfd.py
index 5afde93..b4d7987 100644 (file)
@@ -165,13 +165,13 @@ class Vnfd(object):
                                       resp))
             print resp['id']
         else:
-            msg = ""
+            msg = "Error {}".format(http_code)
             if resp:
                 try:
-                    msg = json.loads(resp)
+                    msg = "{} - {}".format(msg, json.loads(resp))
                 except ValueError:
-                    msg = resp
-            raise ClientException("failed to create/update vnfd - {}".format(name, msg))
+                    msg = "{} - {}".format(msg, resp)
+            raise ClientException("failed to create/update vnfd - {}".format(msg))
 
     def update(self, name, filename):
         vnfd = self.get(name)