summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/resources/scripts/sdcBePy
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2023-06-13 08:48:16 +0100
committerVasyl Razinkov <vasyl.razinkov@est.tech>2023-06-29 19:59:09 +0000
commit2cecd886d08bd2f97426746aa19b581568c38954 (patch)
treeed46432cde31c929393bf62dc09c54bbd8fcd110 /catalog-be/src/main/resources/scripts/sdcBePy
parentcf0a8b21e85ec41260da802a2b923fabe89c9aaa (diff)
Create test model
Issue-ID: SDC-4471 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Change-Id: I49d6721b9c60cf62ddcdc47beed70db08ba0a031
Diffstat (limited to 'catalog-be/src/main/resources/scripts/sdcBePy')
-rw-r--r--catalog-be/src/main/resources/scripts/sdcBePy/common/normative/toscaTypes.py4
-rw-r--r--catalog-be/src/main/resources/scripts/sdcBePy/tosca/models/node_type_client.py1
2 files changed, 3 insertions, 2 deletions
diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/common/normative/toscaTypes.py b/catalog-be/src/main/resources/scripts/sdcBePy/common/normative/toscaTypes.py
index 9d37c2ad29..fecc88a320 100644
--- a/catalog-be/src/main/resources/scripts/sdcBePy/common/normative/toscaTypes.py
+++ b/catalog-be/src/main/resources/scripts/sdcBePy/common/normative/toscaTypes.py
@@ -1,6 +1,6 @@
import json
import zipfile
-
+import os
import pycurl
from sdcBePy.common.errors import ResourceCreationError
@@ -48,6 +48,8 @@ def _create_normatives_type(file_dir, sdc_be_proxy, types, update_version):
results = []
response_codes = _get_response_code()
for normative_type in types:
+ if not os.path.exists(file_dir):
+ break
result = _send_request(sdc_be_proxy, file_dir, normative_type, update_version)
results.append(result)
if result[1] is None or result[1] not in response_codes:
diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/models/node_type_client.py b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/models/node_type_client.py
index 7937002567..d241288dcc 100644
--- a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/models/node_type_client.py
+++ b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/models/node_type_client.py
@@ -71,5 +71,4 @@ class NodeTypeClient:
error_msg = "Failed to import node types '{}'".format(node_type_yaml_path)
logger.log(error_msg, response_buffer.getvalue())
raise Exception(error_msg)
- logger.log("Failed to import node types '{}'".format(node_type_yaml_path))