

def _validate_field(self):
    version = self._tpl_version()
    if (not version):
        ExceptionCollector.appendException(MissingRequiredFieldError(what='Template', required=DEFINITION_VERSION))
    else:
        self._validate_version(version)
        self.version = version
    for name in self.tpl:
        if ((name not in SECTIONS) and (name not in self.ADDITIONAL_SECTIONS.get(version, ()))):
            ExceptionCollector.appendException(UnknownFieldError(what='Template', field=name))

dataset/ETHPy150Open openstack/tosca-parser/toscaparser/tosca_template.py ToscaTemplate._validate_field/original