Skip to content
Snippets Groups Projects
Commit 23e642d3 authored by Ryan McCloskey's avatar Ryan McCloskey
Browse files

Fix for adding NSD via osm repo-index and with nfpkg-repo-show

parent fca12477
No related branches found
No related tags found
1 merge request!1Fix for adding NSD via osm repo-index and with nfpkg-repo-show
Pipeline #11213 passed with stage
in 1 minute and 22 seconds
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment