From: garciadeblas Date: Wed, 30 May 2018 08:17:16 +0000 (+0200) Subject: Fix bug in vnfd/nsd creation when reporting errors X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F36%2F6236%2F2;p=osm%2Fosmclient.git Fix bug in vnfd/nsd creation when reporting errors Change-Id: I8c9fd2d7c4a81723a41082ad5c06d7d1540fda1b Signed-off-by: garciadeblas --- 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 @@ class Nsd(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 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 @@ 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)