diff --git a/osmclient/sol005/osmrepo.py b/osmclient/sol005/osmrepo.py index 6b9d5277818bcdb9d8cd32609a0dd02906621a2f..24dba0b2068722c92cea21bda46bc0d810e63721 100644 --- a/osmclient/sol005/osmrepo.py +++ b/osmclient/sol005/osmrepo.py @@ -156,10 +156,10 @@ class OSMRepo(Repo): rmtree(folder, ignore_errors=False) if ( pkgtype == "vnf" - and (pkg_descriptor.get("vnfd") or pkg_descriptor.get("vnfd:vnfd_catalog")) + and (("vnfd" not in pkg_descriptor) and ("vnfd:vnfd_catalog" not in pkg_descriptor)) ) or ( pkgtype == "ns" - and (pkg_descriptor.get("nsd") or pkg_descriptor.get("nsd:nsd_catalog")) + and (("nsd" not in pkg_descriptor) and ("nsd:nsd_catalog" not in pkg_descriptor)) ): raise ClientException("Wrong Package type") return pkg_descriptor @@ -308,7 +308,10 @@ class OSMRepo(Repo): self._logger.error(msg) raise ValueError(msg) # Repo search is based on 'name' entry in index.yaml. It is mandatory then - fields["name"] = aux_dict.get("name", aux_dict["product-name"]) + if (aux_dict.get("product-name")): + fields["name"] = aux_dict.get("product-name") + else: + fields["name"] = aux_dict.get("name") fields["id"] = aux_dict.get("id") fields["description"] = aux_dict.get("description") fields["vendor"] = aux_dict.get("vendor")