From: garciadeblas Date: Tue, 29 Nov 2022 13:24:55 +0000 (+0100) Subject: Revert "Bug 2189 fixing osm package-build command" X-Git-Tag: v13.0.0rc1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=7b47bc71beed605725d71be6b71621dd14161971;p=osm%2Fosmclient.git Revert "Bug 2189 fixing osm package-build command" This reverts commit d169d606f469ab5ccb76aeb11bd56edbcb6bd933. Change-Id: I6fc6bf9ebba594337653d2b47bfeb17fc0c2168c Signed-off-by: garciadeblas --- diff --git a/osmclient/common/package_tool.py b/osmclient/common/package_tool.py index 2531f7a..a2cbd87 100644 --- a/osmclient/common/package_tool.py +++ b/osmclient/common/package_tool.py @@ -519,28 +519,13 @@ class PackageTool(object): ] else: descriptors_paths = [f for f in glob.glob(package_folder + "/*.yaml")] - if len(descriptors_paths) == 1: - # The base folder usually has a single yaml file with the descriptor - descriptor_file = True - pkg_type = utils.get_key_val_from_descriptor(descriptors_paths[0]) - if pkg_type is None: - raise ClientException("Cannot determine package type") - if pkg_type["type"] == "nsd": - charms_set = self.charms_search(descriptors_paths[0], "ns") - else: - charms_set = self.charms_search(descriptors_paths[0], "vnf") - elif len(descriptors_paths) > 1: - for file in descriptors_paths: - if file.endswith("nfd.yaml"): - descriptor_file = True - charms_set = self.charms_search(file, "vnf") - if file.endswith("nsd.yaml"): - descriptor_file = True - charms_set = self.charms_search(file, "ns") - else: - raise ClientException( - "Package folder does not contain valid descriptor files '*.yaml'" - ) + for file in descriptors_paths: + if file.endswith("nfd.yaml"): + descriptor_file = True + charms_set = self.charms_search(file, "vnf") + if file.endswith("nsd.yaml"): + descriptor_file = True + charms_set = self.charms_search(file, "ns") print("List of charms in the descriptor: {}".format(charms_set)) if not descriptor_file: raise ClientException(