From 2cecd886d08bd2f97426746aa19b581568c38954 Mon Sep 17 00:00:00 2001 From: JvD_Ericsson Date: Tue, 13 Jun 2023 08:48:16 +0100 Subject: Create test model Issue-ID: SDC-4471 Signed-off-by: JvD_Ericsson Change-Id: I49d6721b9c60cf62ddcdc47beed70db08ba0a031 --- .../src/main/resources/scripts/sdcBePy/common/normative/toscaTypes.py | 4 +++- .../main/resources/scripts/sdcBePy/tosca/models/node_type_client.py | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'catalog-be/src') 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)) -- cgit 1.2.3-korg