diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-10-30 21:50:31 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-10-30 21:50:31 +0800 |
commit | 430d91f1231ff0d8867720958b4ff96682ba6412 (patch) | |
tree | d55fbc44ce6eb62e2c4622f2425725b180ba7e09 | |
parent | 19b7c9420f8e53c507516682959d9d0f92788a70 (diff) |
Fix vfc-svnfm-driver ftp convert
Change-Id: I26e5324e69258eee4010402fcde0423c7be3e94b
Issue-ID: VFC-558
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r-- | zte/vmanager/driver/interfaces/views.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/zte/vmanager/driver/interfaces/views.py b/zte/vmanager/driver/interfaces/views.py index dd07d794..d3f80fc3 100644 --- a/zte/vmanager/driver/interfaces/views.py +++ b/zte/vmanager/driver/interfaces/views.py @@ -125,14 +125,17 @@ def instantiate_vnf(request, *args, **kwargs): data = {} data["NFVOID"] = 1 data["VNFMID"] = vnfm_id - vnfdId = ignorcase_get(packageInfo, "vnfdId") + # vnfdId = ignorcase_get(packageInfo, "vnfdId") + vnfd_name = ignorcase_get(packageInfo, "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] - VNFS = ["SPGW", "MME"] - if vnfdId in VNFS: - data["VNFD"] = "ftp://VMVNFM:Vnfm_1g3T@" + vnfm_ip + ":21/" + vnfdId - data["VNFURL"] = "ftp://VMVNFM:Vnfm_1g3T@" + vnfm_ip + ":21/" + vnfdId + 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" + 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" else: data["VNFD"] = ignorcase_get(packageInfo, "downloadUri") data["VNFURL"] = ignorcase_get(packageInfo, "downloadUri") |