diff options
author | shangxdy <shang.xiaodong@zte.com.cn> | 2016-07-08 15:15:00 +0800 |
---|---|---|
committer | shangxdy <shang.xiaodong@zte.com.cn> | 2016-07-10 00:38:59 +0800 |
commit | 0997552722dc4845a854e0e6f8d7f18058e26380 (patch) | |
tree | b90d1e808bb326612211ba56b3b941516493398d /tosca2heat/tosca-parser/toscaparser/imports.py | |
parent | 7fe3011a67a239f7dc04153c54eaff78ef967eaf (diff) |
Synchronise the openstack bugs
When run unittests through tox, some test cases are always error,
the errors are already done in openstack community, so it's
necessary to synchronise the fixes.
Change-Id: Ib29078e6cc138a474e89c6a2cc90ad7a1db1bb46
JIRA: PARSER-63
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/imports.py')
-rw-r--r-- | tosca2heat/tosca-parser/toscaparser/imports.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/imports.py b/tosca2heat/tosca-parser/toscaparser/imports.py index 62748bd..58c9300 100644 --- a/tosca2heat/tosca-parser/toscaparser/imports.py +++ b/tosca2heat/tosca-parser/toscaparser/imports.py @@ -14,6 +14,7 @@ import logging import os from toscaparser.common.exception import ExceptionCollector +from toscaparser.common.exception import InvalidPropertyValueError from toscaparser.common.exception import MissingRequiredFieldError from toscaparser.common.exception import UnknownFieldError from toscaparser.common.exception import ValidationError @@ -161,12 +162,17 @@ class ImportsLoader(object): | URL | URL | OK | +----------+--------+------------------------------+ """ - short_import_notation = False if isinstance(import_uri_def, dict): self._validate_import_keys(import_name, import_uri_def) file_name = import_uri_def.get(self.FILE) repository = import_uri_def.get(self.REPOSITORY) + repos = self.repositories.keys() + if repository is not None: + if repository not in repos: + ExceptionCollector.appendException( + InvalidPropertyValueError( + what=_('Repository is not found in "%s"') % repos)) else: file_name = import_uri_def repository = None |