summaryrefslogtreecommitdiffstats
path: root/zte
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2017-11-03 17:10:11 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2017-11-03 17:12:51 +0800
commit98b79d96202bc04aec130bf7df6cfc3c78b58ec9 (patch)
tree09545eeea79c7ec66c6595160787590b2ff640e6 /zte
parent8ea7700335792d7597f3f7d10d822c31e98c70ef (diff)
Move VNFD/VNF url to config
Change-Id: Ib56c83a467f39beb037124d7cee7b7d28362ff1c Issue-Id: VFC-580 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'zte')
-rw-r--r--zte/vmanager/driver/interfaces/views.py12
-rw-r--r--zte/vmanager/driver/pub/config/config.py3
2 files changed, 8 insertions, 7 deletions
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'