From 98b79d96202bc04aec130bf7df6cfc3c78b58ec9 Mon Sep 17 00:00:00 2001 From: fujinhua Date: Fri, 3 Nov 2017 17:10:11 +0800 Subject: Move VNFD/VNF url to config Change-Id: Ib56c83a467f39beb037124d7cee7b7d28362ff1c Issue-Id: VFC-580 Signed-off-by: fujinhua --- zte/vmanager/driver/interfaces/views.py | 12 +++++------- zte/vmanager/driver/pub/config/config.py | 3 +++ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'zte/vmanager') diff --git a/zte/vmanager/driver/interfaces/views.py b/zte/vmanager/driver/interfaces/views.py index 93b8d922..bb5d0b77 100644 --- a/zte/vmanager/driver/interfaces/views.py +++ b/zte/vmanager/driver/interfaces/views.py @@ -23,6 +23,7 @@ from rest_framework.response import Response from driver.pub.utils import restcall from driver.pub.utils.restcall import req_by_msb, call_aai +from driver.pub.config.config import VNF_FTP logger = logging.getLogger(__name__) @@ -139,21 +140,18 @@ def instantiate_vnf(request, *args, **kwargs): metadata = ignorcase_get(vnfdModel, "metadata") vnfd_name = ignorcase_get(metadata, "name") # TODO convert sdc vnf package to vnf vender package - from urlparse import urlparse - vnfm_ip = urlparse(ignorcase_get(vnfm_info, "url")).netloc.split(':')[0] inputs = [] if "SPGW" in vnfd_name.upper(): - data["VNFD"] = "ftp://VMVNFM:Vnfm_1g3T@" + vnfm_ip + ":21/" + "SPGW" - data["VNFURL"] = "ftp://VMVNFM:Vnfm_1g3T@" + vnfm_ip + ":21/" + "SPGW" + data["VNFD"] = VNF_FTP + "SPGW" inputs = load_json_file("SPGW" + "_inputs.json") elif "MME" in vnfd_name.upper(): - data["VNFD"] = "ftp://VMVNFM:Vnfm_1g3T@" + vnfm_ip + ":21/" + "MME" - data["VNFURL"] = "ftp://VMVNFM:Vnfm_1g3T@" + vnfm_ip + ":21/" + "MME" + data["VNFD"] = VNF_FTP + "MME" inputs = load_json_file("MME" + "_inputs.json") else: data["VNFD"] = ignorcase_get(packageInfo, "downloadUri") - data["VNFURL"] = ignorcase_get(packageInfo, "downloadUri") + + data["VNFURL"] = data["VNFD"] data["extension"] = {} for name, value in ignorcase_get(ignorcase_get(request.data, "additionalParam"), "inputs").items(): diff --git a/zte/vmanager/driver/pub/config/config.py b/zte/vmanager/driver/pub/config/config.py index f0d85d07..e5d90b33 100644 --- a/zte/vmanager/driver/pub/config/config.py +++ b/zte/vmanager/driver/pub/config/config.py @@ -22,6 +22,9 @@ CLOUD_OWNER = "11" CLOUD_REGION_ID = "" TENANT_ID = "" +# [VNFFTP] +VNF_FTP = "ftp://VMVNFM:Vnfm_1g3T@127.0.0.1:21/" + # [MSB] MSB_SERVICE_IP = '127.0.0.1' MSB_SERVICE_PORT = '80' -- cgit 1.2.3-korg