From b3b96781b5e79b4db0217581216cd7bbb1509822 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 30 May 2018 10:17:16 +0200 Subject: [PATCH] Fix bug in vnfd/nsd creation when reporting errors Change-Id: I8c9fd2d7c4a81723a41082ad5c06d7d1540fda1b Signed-off-by: garciadeblas --- osmclient/sol005/nsd.py | 8 ++++---- osmclient/sol005/vnfd.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) 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) -- 2.25.1