diff options
author | 2017-09-27 17:10:19 +0800 | |
---|---|---|
committer | 2017-09-27 17:10:19 +0800 | |
commit | d688679208daffc517702f8cf76743e64d21dfb5 (patch) | |
tree | 64034deecf74c680ac419896278e852f6f4dca5a | |
parent | 431c4c4001cb4254cde23ec2ff4d1c9f61cccf54 (diff) |
Modify vfc-catalog query package interface
Modify query ns and VNF interface return information in vfc-nfvo-catalog.
Change-Id: I4dc658081da35db582665b2a63cddbfe6e7bb287
Issue-ID: VFC-467
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r-- | catalog/packages/nf_package.py | 4 | ||||
-rw-r--r-- | catalog/packages/ns_package.py | 2 | ||||
-rw-r--r-- | catalog/packages/tests/test_nf.py | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/catalog/packages/nf_package.py b/catalog/packages/nf_package.py index 4907e552..7e9336bb 100644 --- a/catalog/packages/nf_package.py +++ b/catalog/packages/nf_package.py @@ -210,16 +210,20 @@ class NfPackage(object): nf_pkg = VnfPackageModel.objects.filter(vnfPackageId=csar_id) if nf_pkg: pkg_info["vnfdId"] = nf_pkg[0].vnfdId + pkg_info["vnfPackageId"] = nf_pkg[0].vnfPackageId pkg_info["vnfdProvider"] = nf_pkg[0].vnfVendor pkg_info["vnfdVersion"] = nf_pkg[0].vnfdVersion pkg_info["vnfVersion"] = nf_pkg[0].vnfSoftwareVersion pkg_info["csarName"] = nf_pkg[0].vnfPackageUri + pkg_info["vnfdModel"] = nf_pkg[0].vnfdModel pkg_info["downloadUrl"] = "http://%s:%s/%s/%s/%s" % ( REG_TO_MSB_REG_PARAM["nodes"][0]["ip"], REG_TO_MSB_REG_PARAM["nodes"][0]["port"], CATALOG_URL_PATH, csar_id, nf_pkg[0].vnfPackageUri) + else: + raise CatalogException("Vnf package[%s] not Found." % csar_id) return [0, {"csarId": csar_id, "packageInfo": pkg_info, diff --git a/catalog/packages/ns_package.py b/catalog/packages/ns_package.py index cc261d41..db080484 100644 --- a/catalog/packages/ns_package.py +++ b/catalog/packages/ns_package.py @@ -177,6 +177,8 @@ class NsPackage(object): CATALOG_URL_PATH, csar_id, csars[0].nsPackageUri) + else: + raise CatalogException("Ns package[%s] not Found." % csar_id) return [0, {"csarId": csar_id, "packageInfo": package_info}] diff --git a/catalog/packages/tests/test_nf.py b/catalog/packages/tests/test_nf.py index 6e3fc118..51df09b0 100644 --- a/catalog/packages/tests/test_nf.py +++ b/catalog/packages/tests/test_nf.py @@ -335,9 +335,11 @@ class TestNfPackage(TestCase): "csarId": "4", "packageInfo": { "vnfdId": "5", + "vnfPackageId": "4", "vnfdProvider": "6", "vnfdVersion": "7", "vnfVersion": "8", + "vnfdModel": None, "csarName": "4.csar", "downloadUrl": "http://127.0.0.1:8806/static/catalog/4/4.csar" }, |