diff options
-rw-r--r-- | catalog/packages/ns_package.py | 1 | ||||
-rw-r--r-- | catalog/packages/tests/test_ns.py | 4 | ||||
-rw-r--r-- | catalog/pub/utils/toscaparser/nsdmodel.py | 4 |
3 files changed, 6 insertions, 3 deletions
diff --git a/catalog/packages/ns_package.py b/catalog/packages/ns_package.py index 5474a472..4b7ec927 100644 --- a/catalog/packages/ns_package.py +++ b/catalog/packages/ns_package.py @@ -174,6 +174,7 @@ class NsPackage(object): package_info["nsdProvider"] = csars[0].nsdDesginer package_info["nsdVersion"] = csars[0].nsdVersion package_info["csarName"] = csars[0].nsPackageUri + package_info["nsdModel"] = csars[0].nsdModel package_info["downloadUrl"] = "http://%s:%s/%s/%s/%s" % ( REG_TO_MSB_REG_PARAM["nodes"][0]["ip"], REG_TO_MSB_REG_PARAM["nodes"][0]["port"], diff --git a/catalog/packages/tests/test_ns.py b/catalog/packages/tests/test_ns.py index ceb5ac31..d4c6ce99 100644 --- a/catalog/packages/tests/test_ns.py +++ b/catalog/packages/tests/test_ns.py @@ -478,7 +478,8 @@ class TestNsPackage(TestCase): self.assertEqual(expect_data, resp.data) def test_ns_pkg_get_one(self): - NSPackageModel(nsPackageId="14", nsdId="2", nsdDesginer="3", nsdVersion="4", nsPackageUri="14.csar").save() + NSPackageModel(nsPackageId="14", nsdId="2", nsdDesginer="3", nsdVersion="4", + nsPackageUri="14.csar", nsdModel="").save() resp = self.client.get("/api/catalog/v1/nspackages/14") self.assertEqual(resp.status_code, status.HTTP_200_OK) expect_data = { @@ -489,6 +490,7 @@ class TestNsPackage(TestCase): "nsdProvider": "3", "nsdVersion": "4", "csarName": "14.csar", + "nsdModel": "", "downloadUrl": "http://127.0.0.1:8806/static/catalog/14/14.csar" } } diff --git a/catalog/pub/utils/toscaparser/nsdmodel.py b/catalog/pub/utils/toscaparser/nsdmodel.py index e4291884..fa8b8410 100644 --- a/catalog/pub/utils/toscaparser/nsdmodel.py +++ b/catalog/pub/utils/toscaparser/nsdmodel.py @@ -89,8 +89,8 @@ class EtsiNsdInfoModel(BaseInfoModel): for key in vnf['properties'].iterkeys(): if key.endswith('_version'): vnf['properties'].update(version=vnf['properties'].pop(key)) - # if key.endswith('_id'): - # vnf['properties'].update(id=vnf['properties'].pop(key)) + if key.endswith('_id'): + vnf['properties'].update(id=vnf['properties'].pop(key)) if key.endswith('_csarProvider'): vnf['properties'].update(csarProvider=vnf['properties'].pop(key)) if key.endswith('_csarVersion'): |