diff --git a/bin/cloudnet/tosca/type_system.py b/bin/cloudnet/tosca/type_system.py index 76805a6..d4526ea 100644 --- a/bin/cloudnet/tosca/type_system.py +++ b/bin/cloudnet/tosca/type_system.py @@ -24,7 +24,7 @@ from cloudnet.tosca.diagnostics import diagnostic from cloudnet.tosca.processors import CEND, CRED, Checker from cloudnet.tosca.utils import merge_dict, normalize_dict -from cloudnet.tosca.yaml_line_numbering import StrCoord, DictCoord +from cloudnet.tosca.yaml_line_numbering import Coord as YamlCoord profiles_directory = "file:" + os.path.dirname(__file__) + "/profiles" @@ -3630,7 +3630,8 @@ def check_required_fields( + " required " + kind + " unassigned", - definition, + definition if isinstance(definition, YamlCoord) + else self.reserved_function_keywords.get("SELF"), ) else: self.info( diff --git a/tests/issues/issue_40.yaml b/tests/issues/issue_40.yaml new file mode 100644 index 0000000..b096294 --- /dev/null +++ b/tests/issues/issue_40.yaml @@ -0,0 +1,20 @@ +# https://github.com/Orange-OpenSource/Cloudnet-TOSCA-toolbox/issues/40 +tosca_definitions_version: tosca_simple_yaml_1_3 + +capability_types: + CT: + properties: + p1: + type: integer + +node_types: + NT: + capabilities: + c1: + type: CT + +topology_template: + node_templates: + n1: + type: NT + # ERROR: p1 required property unassigned diff --git a/tests/run.sh b/tests/run.sh index 8e407d9..9a68d96 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -3,7 +3,7 @@ # # Software Name : Cloudnet TOSCA toolbox # Version: 1.0 -# SPDX-FileCopyrightText: Copyright (c) 2020-21 Orange +# SPDX-FileCopyrightText: Copyright (c) 2020-22 Orange # SPDX-License-Identifier: Apache-2.0 # # This software is distributed under the Apache License 2.0 @@ -67,6 +67,7 @@ check_regression topology_template_substitution_mapping.yaml # Cloudnet TOSCA Toolbox issues check_regression issues/issue_39.yaml +check_regression issues/issue_40.yaml check_regression issues/issue_41.yaml check_regression issues/issue_42.yaml check_regression issues/issue_43.yaml