diff options
author | Lianhao Lu <lianhao.lu@intel.com> | 2018-03-24 00:04:37 +0800 |
---|---|---|
committer | Lianhao Lu <lianhao.lu@intel.com> | 2018-04-12 10:35:13 +0800 |
commit | 1210f741d01f26609b687e6680e5180fb1be5efe (patch) | |
tree | b087864f78a67021471fbcb911154d1e0ec400a2 /vnfsdk_pkgtools | |
parent | cd02d1f9b64957a63ad4b16bac639116975edb22 (diff) |
Fix aria validation error in import case2.0.0-ONAPbeijing2.0.0-ONAP
Previously, we assume all the yaml files in the csar package are located
under definition directory. This is not always true according to
SOL-004. We need to change the way how we call aria to validate the vnfd
content within the csar pacakge.
Also added the unit test for vnfsdk_pkgtools/validator.
Issue-ID: VNFSDK-231
Change-Id: Ia112b21b3bbf64ab980dd4e98aab0e87131f28e0
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Diffstat (limited to 'vnfsdk_pkgtools')
-rw-r--r-- | vnfsdk_pkgtools/validator/aria_validator.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vnfsdk_pkgtools/validator/aria_validator.py b/vnfsdk_pkgtools/validator/aria_validator.py index 83d7dfe..b4b947c 100644 --- a/vnfsdk_pkgtools/validator/aria_validator.py +++ b/vnfsdk_pkgtools/validator/aria_validator.py @@ -15,7 +15,7 @@ import os -from aria.parser.loading import LiteralLocation +from aria.parser.loading import UriLocation from aria.parser.consumption import ( ConsumptionContext, ConsumerChain, @@ -31,9 +31,10 @@ from vnfsdk_pkgtools import validator class AriaValidator(validator.ValidatorBase): def validate(self, reader): context = ConsumptionContext() - context.loading.prefixes += [os.path.join(reader.destination, 'definitions')] - context.presentation.location = LiteralLocation(reader.entry_definitions_yaml) - print reader.entry_definitions_yaml + service_template_path = os.path.join(reader.destination, + reader.entry_definitions) + context.presentation.location = UriLocation(service_template_path) + print(reader.entry_definitions_yaml) chain = ConsumerChain(context, (Read, Validate, ServiceTemplate, ServiceInstance)) chain.consume() if context.validation.dump_issues(): |