diff options
-rw-r--r-- | docs/installation.rst | 16 | ||||
-rw-r--r-- | lcm/ns/vnfs/create_vnfs.py | 1 | ||||
-rw-r--r-- | lcm/packages/sdc_nf_package.py | 6 | ||||
-rw-r--r-- | lcm/packages/tests/test_sdc_nf.py | 11 |
4 files changed, 24 insertions, 10 deletions
diff --git a/docs/installation.rst b/docs/installation.rst index 66fd2fce..0d361716 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -33,7 +33,7 @@ Note: In the following steps, we use ${MSB_IP} as the IP of msb_apigateway compo :: - docker run -d --name vfc-nslcm -v /var/lib/mysql -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/nslcm + docker run -d --name vfc-nslcm -v /var/lib/mysql -p 8403:8403 -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/nslcm For testing, we can use curl command to access the swagger api. @@ -72,7 +72,7 @@ SERVICE_IP represents the docker run environment server address. :: - docker run -d --name vfc-catalog -v /var/lib/mysql -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/catalog + docker run -d --name vfc-catalog -v /var/lib/mysql -p 8806:8806 -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/catalog For testing, we can use curl command to access the swagger api. @@ -108,7 +108,7 @@ For testing, we can use curl command to access the swagger api. :: - docker run -d --name vfc-ztesdncdriver -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/ztesdncdriver + docker run -d --name vfc-ztesdncdriver -p 8411:8411 -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/ztesdncdriver For testing, we can use curl command to access the swagger api. @@ -132,9 +132,9 @@ For testing, we can use curl command to access the swagger api. :: - docker run -d --name vfc-vnflcm -v /var/lib/mysql -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/vnflcm - docker run -d --name vfc-vnfmgr -v /var/lib/mysql -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/vnfmgr - docker run -d --name vfc-vnfres -v /var/lib/mysql -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/vnfres + docker run -d --name vfc-vnflcm -v /var/lib/mysql -p 8801:8801 -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/vnflcm + docker run -d --name vfc-vnfmgr -v /var/lib/mysql -p 8803:8803 -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/vnfmgr + docker run -d --name vfc-vnfres -v /var/lib/mysql -p 8802:8802 -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/vnfres For testing, we can use curl command to access the swagger api. @@ -148,7 +148,7 @@ For testing, we can use curl command to access the swagger api. :: - docker run -d --name vfc-gvnfmdriver -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/gvnfmdriver + docker run -d --name vfc-gvnfmdriver -p 8484:8484 -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/gvnfmdriver docker run -d --name vfc-jujudriver -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/jujudriver For testing, we can use curl command to access the swagger api. @@ -162,7 +162,7 @@ For testing, we can use curl command to access the swagger api. :: - docker run -d --name vfc-ztevmanagerdriver -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/ztevmanagerdriver + docker run -d --name vfc-ztevmanagerdriver -p 8410:8410 -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/ztevmanagerdriver docker run -d --name vfc-svnfm-huawei -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/nfvo/svnfm/huawei docker run -d --name vfc-svnfm-nokia -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/nfvo/svnfm/nokia diff --git a/lcm/ns/vnfs/create_vnfs.py b/lcm/ns/vnfs/create_vnfs.py index 083131ca..ede33807 100644 --- a/lcm/ns/vnfs/create_vnfs.py +++ b/lcm/ns/vnfs/create_vnfs.py @@ -131,6 +131,7 @@ class CreateVnfs(Thread): nfpackage_info = query_vnfpackage_by_id(self.vnfd_id) self.nf_package_info = nfpackage_info["packageInfo"] self.vnfd_model = ignore_case_get(self.nf_package_info, "vnfdModel") + self.vnfd_model = json.loads(self.vnfd_model) def get_virtual_link_info(self, vnf_id): virtual_link_list, ext_virtual_link = [], [] diff --git a/lcm/packages/sdc_nf_package.py b/lcm/packages/sdc_nf_package.py index a7ef3871..0eeea4fc 100644 --- a/lcm/packages/sdc_nf_package.py +++ b/lcm/packages/sdc_nf_package.py @@ -22,7 +22,7 @@ import traceback from lcm.pub.config.config import CATALOG_ROOT_PATH from lcm.pub.database.models import NfPackageModel, NfInstModel from lcm.pub.exceptions import NSLCMException -from lcm.pub.msapi import sdc +from lcm.pub.msapi import sdc, sdc_run_catalog from lcm.pub.utils import fileutil from lcm.pub.utils import toscaparser from lcm.pub.utils.jobutil import JobUtil @@ -204,6 +204,7 @@ class SdcNfPackage(object): return [0, csars] def get_csar(self, csar_id): + """ pkg_info = {} nf_pkg = NfPackageModel.objects.filter(nfpackageid=csar_id) if nf_pkg: @@ -211,6 +212,9 @@ class SdcNfPackage(object): pkg_info["vnfdProvider"] = nf_pkg[0].vendor pkg_info["vnfdVersion"] = nf_pkg[0].vnfdversion pkg_info["vnfVersion"] = nf_pkg[0].vnfversion + """ + nf_pkg = sdc_run_catalog.query_vnfpackage_by_id(csar_id) + pkg_info = nf_pkg["packageInfo"] vnf_insts = NfInstModel.objects.filter(package_id=csar_id) vnf_inst_info = [{"vnfInstanceId": vnf_inst.nfinstid, diff --git a/lcm/packages/tests/test_sdc_nf.py b/lcm/packages/tests/test_sdc_nf.py index ae5b3d89..6c95b850 100644 --- a/lcm/packages/tests/test_sdc_nf.py +++ b/lcm/packages/tests/test_sdc_nf.py @@ -316,9 +316,18 @@ class TestNfPackage(TestCase): self.assertEqual(resp.status_code, status.HTTP_200_OK) self.assertEqual({"csars": [{"csarId": "3", "vnfdId": "4"}]}, resp.data) - def test_nf_pkg_get_one(self): + @mock.patch.object(restcall, 'call_req') + def test_nf_pkg_get_one(self, mock_call_req): NfPackageModel(uuid="4", nfpackageid="4", vnfdid="5", vendor="6", vnfdversion="7", vnfversion="8").save() NfInstModel(nfinstid="1", package_id="4", nf_name="3").save() + mock_call_req.return_value = [0, json.JSONEncoder().encode({ + "packageInfo": { + "vnfdId": "5", + "vnfdProvider": "6", + "vnfdVersion": "7", + "vnfVersion": "8" + } + }), '200'] resp = self.client.get("/api/nslcm/v1/vnfpackage/4") self.assertEqual(resp.status_code, status.HTTP_200_OK) |