"detailed": detailed,
}
elif package_type == "vnf":
- template = env.get_template("vnfd.yaml.j2" if not old else "vnfd_old.yaml.j2")
+ template = env.get_template(
+ "vnfd.yaml.j2" if not old else "vnfd_old.yaml.j2"
+ )
content = {
"name": package_name,
"vendor": vendor,
f for f in glob.glob(base_directory + "/*.yaml", recursive=recursive)
]
self._logger.info("Base directory: {}".format(base_directory))
- self._logger.info("{} Descriptors found to validate".format(len(descriptors_paths)))
+ 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()
else:
if not os.path.isdir(
"{}/charms/{}".format(package_folder, charmName)
+ ) and not os.path.isfile(
+ "{}/charms/{}".format(package_folder, charmName)
):
raise ClientException(
"The charm: {} referenced in the descriptor file "
self._logger.debug(
"Copying tree: {} -> {}".format(s_charm, d_temp)
)
- shutil.copytree(
- s_charm, d_temp, symlinks=True, ignore=ignore
- )
+ if os.path.isdir(s_charm):
+ shutil.copytree(
+ s_charm, d_temp, symlinks=True, ignore=ignore
+ )
+ else:
+ shutil.copy2(s_charm, d_temp)
self._logger.debug("DONE")
else:
self._logger.debug("Copying tree: {} -> {}".format(s, d))