[CORD-2988] Fixed deletion message
Change-Id: I6ac9850f5003df4fd54fa00a2752d1783f30c831
diff --git a/src/tosca/parser.py b/src/tosca/parser.py
index 9166dd2..b691166 100644
--- a/src/tosca/parser.py
+++ b/src/tosca/parser.py
@@ -233,6 +233,7 @@
print "[XOS-Tosca] Saving model %s[%s]" % (class_name, model.id)
model.save()
+
self.saved_model_by_name[recipe.name] = model
except Exception, e:
print "[XOS-TOSCA] Failed to save model: %s [%s]" % (class_name, recipe.name)
@@ -248,7 +249,10 @@
except _Rendezvous, e:
try:
- exception_msg = json.loads(e._state.details)["error"]
+ details = json.loads(e._state.details)
+ exception_msg = details["error"]
+ if "specific_error" in details:
+ exception_msg = "%s: %s" % (exception_msg, details["specific_error"])
except Exception:
exception_msg = e._state.details
raise Exception(exception_msg)
diff --git a/src/web_server/main.py b/src/web_server/main.py
index 4483053..f5d8043 100644
--- a/src/web_server/main.py
+++ b/src/web_server/main.py
@@ -38,7 +38,10 @@
def execute_tosca(self, recipe):
self.parser.execute()
- response_text = "Created models: %s" % str(self.parser.ordered_models_name)
+ if self.parser.delete:
+ response_text = "Deleted models: %s" % str(self.parser.ordered_models_name)
+ else:
+ response_text = "Created models: %s" % str(self.parser.ordered_models_name)
return response_text
def errorCallback(self, failure, request):
diff --git a/test/tosca/test.yaml b/test/tosca/test.yaml
index 3b98391..ff735e0 100644
--- a/test/tosca/test.yaml
+++ b/test/tosca/test.yaml
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
+# curl -H "xos-username: admin@opencord.org" -H "xos-password: letmein" -X POST --data-binary @test.yaml http://192.168.99.100:30007/run
tosca_definitions_version: tosca_simple_yaml_1_0
description: Persist xos-sample-gui-extension