diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-08-10 11:43:38 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-08-10 11:43:38 +0800 |
commit | b2509c2e4a1dae7722c7b91703400e79269bdca5 (patch) | |
tree | c71497103cefd31dcf99af1803a1fc2e376d165a /zte | |
parent | 0626f46ac955350a1e722a1723e0d98ce2b42580 (diff) |
Update URL according to microservice name
Modify nfvo zte svnfm driver URL
according to microservice name.
Change-Id: Ia2f24128422adaca6ae967a1452afac2d09e078d
Issue-ID: VFC-88
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'zte')
-rw-r--r-- | zte/vmanager/driver/interfaces/tests.py | 8 | ||||
-rw-r--r-- | zte/vmanager/driver/interfaces/views.py | 18 | ||||
-rw-r--r-- | zte/vmanager/driver/settings.py | 1 |
3 files changed, 8 insertions, 19 deletions
diff --git a/zte/vmanager/driver/interfaces/tests.py b/zte/vmanager/driver/interfaces/tests.py index fe4ecbdb..19a3b950 100644 --- a/zte/vmanager/driver/interfaces/tests.py +++ b/zte/vmanager/driver/interfaces/tests.py @@ -122,7 +122,7 @@ class InterfacesTest(TestCase): 'externalDataNetworkName': 'Flow_out_net', 'inputs':{}}} - response = self.client.post("/api/ztevnfm/v1/ztevnfmid/vnfs", + response = self.client.post("/api/ztevmanagerdriver/v1/ztevnfmid/vnfs", data=json.dumps(req_data), content_type="application/json") self.assertEqual(str(status.HTTP_200_OK), response.status_code) expect_resp_data = {"jobid": "NF-CREATE-8-b384535c-9f45-11e6-8749-fa163e91c2f9", "vnfInstanceId": "8"} @@ -150,7 +150,7 @@ class InterfacesTest(TestCase): r2 = [0, json.JSONEncoder().encode({"vnfInstanceId": "1", "JobId": "1"}), "200"] mock_call_req.side_effect = [r1, r2] - response = self.client.post("/api/ztevnfm/v1/ztevnfmid/vnfs/vbras_innstance_id/terminate") + response = self.client.post("/api/ztevmanagerdriver/v1/ztevnfmid/vnfs/vbras_innstance_id/terminate") self.assertEqual(str(status.HTTP_200_OK), response.status_code) expect_resp_data = {"jobid": "1", "vnfInstanceId": "1"} @@ -178,7 +178,7 @@ class InterfacesTest(TestCase): r2 = [0, json.JSONEncoder().encode({"vnfinstancestatus": "1"}), "200"] mock_call_req.side_effect = [r1, r2] - response = self.client.get("/api/ztevnfm/v1/ztevnfmid/vnfs/vbras_innstance_id") + response = self.client.get("/api/ztevmanagerdriver/v1/ztevnfmid/vnfs/vbras_innstance_id") self.assertEqual(str(status.HTTP_200_OK), response.status_code) @@ -415,7 +415,7 @@ class InterfacesTest(TestCase): } - response = self.client.post("/api/ztevnfm/v1/vnfmid/vnfs/101/scale", + response = self.client.post("/api/ztevmanagerdriver/v1/vnfmid/vnfs/101/scale", data=json.dumps(scale_vnf_data), content_type='application/json') self.assertEqual(str(status.HTTP_202_ACCEPTED), response.status_code) diff --git a/zte/vmanager/driver/interfaces/views.py b/zte/vmanager/driver/interfaces/views.py index 7b445255..ce625a35 100644 --- a/zte/vmanager/driver/interfaces/views.py +++ b/zte/vmanager/driver/interfaces/views.py @@ -116,23 +116,13 @@ def instantiate_vnf(request, *args, **kwargs): data = {} data["NFVOID"] = 1 data["VNFMID"] = vnfm_id - # data["VNFD"] = ignorcase_get(packageInfo, "downloadUri") - # data["VNFURL"] = ignorcase_get(packageInfo, "downloadUri") vnfdId = ignorcase_get(packageInfo, "vnfdId") from urlparse import urlparse vnfm_ip = urlparse(ignorcase_get(vnfm_info, "url")).netloc.split(':')[0] - if "vCSCF_NF_ZTE" == vnfdId: - data["VNFD"] = "ftp://VMVERSION:vmversion@" + "192.168.128.159" + ":21/CSCF" - data["VNFURL"] = "ftp://VMVERSION:vmversion@" + "192.168.128.159" + ":21/CSCF" - elif "vPCRF_NF_ZTE" == vnfdId: - data["VNFD"] = "ftp://VMVERSION:vmversion@" + "192.168.128.159" + ":21/PCRF" - data["VNFURL"] = "ftp://VMVERSION:vmversion@" + "192.168.128.159" + ":21/PCRF" - elif "vTAS_NF_ZTE" == vnfdId: - data["VNFD"] = "ftp://VMVERSION:vmversion@" + "192.168.128.159" + ":21/SSS" - data["VNFURL"] = "ftp://VMVERSION:vmversion@" + "192.168.128.159" + ":21/SSS" - elif "vSPGW_NF_ZTE" == vnfdId: - data["VNFD"] = "ftp://VMVERSION:vmversion@" + "192.168.237.159" + ":21/vgw31" - data["VNFURL"] = "ftp://VMVERSION:vmversion@" + "192.168.237.159" + ":21/vgw31" + VNFS = ["SPGW", "MME"] + if vnfdId in VNFS: + data["VNFD"] = "ftp://VMVERSION:vmversion@" + vnfm_ip + ":21/" + vnfdId + data["VNFURL"] = "ftp://VMVERSION:vmversion@" + vnfm_ip + ":21/" + vnfdId else: data["VNFD"] = ignorcase_get(packageInfo, "downloadUri") data["VNFURL"] = ignorcase_get(packageInfo, "downloadUri") diff --git a/zte/vmanager/driver/settings.py b/zte/vmanager/driver/settings.py index ff0f6446..dac23585 100644 --- a/zte/vmanager/driver/settings.py +++ b/zte/vmanager/driver/settings.py @@ -13,7 +13,6 @@ # limitations under the License. import os - import sys # Build paths inside the project like this: os.path.join(BASE_DIR, ...) |