summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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'