descriptors_paths = [
f for f in glob.glob(base_directory + "/*.yaml", recursive=recursive)
]
- print("Base directory: {}".format(base_directory))
- print("{} Descriptors found to validate".format(len(descriptors_paths)))
+ self._logger.info("Base directory: {}".format(base_directory))
+ self._logger.info("{} Descriptors found to validate".format(len(descriptors_paths)))
for desc_path in descriptors_paths:
with open(desc_path) as descriptor_file:
descriptor_data = descriptor_file.read()
desc_type, descriptor_data = validation_im.yaml_validation(
self, descriptor_data
)
+ self._logger.debug(f"Validate {desc_type} {descriptor_data}")
if not old_format:
if desc_type == "vnfd" or desc_type == "nsd":
- print(
+ self._logger.error(
"OSM descriptor '{}' written in an unsupported format. Please update to ETSI SOL006 format".format(
desc_path
)
)
- print(
+ self._logger.warning(
"Package validation skipped. It can still be done with 'osm package-validate --old'"
)
- print(
+ self._logger.warning(
"Package build can still be done with 'osm package-build --skip-validation'"
)
raise Exception("Not SOL006 format")
"error": str(e),
}
)
+ self._logger.debug(table[-1])
return table
def translate(self, base_directory, recursive=True, dryrun=False):