Fix bug in vnfd/nsd creation when reporting errors
Change-Id: I8c9fd2d7c4a81723a41082ad5c06d7d1540fda1b
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/osmclient/sol005/nsd.py b/osmclient/sol005/nsd.py
index af1e2ef..10ad38f 100644
--- a/osmclient/sol005/nsd.py
+++ b/osmclient/sol005/nsd.py
@@ -166,13 +166,13 @@
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 nsd - {}".format(name, msg))
+ msg = "{} - {}".format(msg, resp)
+ raise ClientException("failed to create/update nsd - {}".format(msg))
def update(self, name, filename):
nsd = self.get(name)
diff --git a/osmclient/sol005/vnfd.py b/osmclient/sol005/vnfd.py
index 5afde93..b4d7987 100644
--- a/osmclient/sol005/vnfd.py
+++ b/osmclient/sol005/vnfd.py
@@ -165,13 +165,13 @@
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)