summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2018-11-13 18:37:32 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2018-11-13 18:44:05 +0800
commit49d61647a45a8bb27c2ca4605e5d356fa524731b (patch)
treecf1a8e1c6700513daeca3192b3cc88828fd8fbf4
parente206e7d40c77a65edf6fdc631a3f353269f8e0ed (diff)
Fix vnf term logic
Change-Id: I90608c5887467335b48ad73c7c5b7f35af388f2e Issue-ID: VFC-1163 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--gvnfmadapter/driver/interfaces/views.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/gvnfmadapter/driver/interfaces/views.py b/gvnfmadapter/driver/interfaces/views.py
index b5dee0e..15e1c31 100644
--- a/gvnfmadapter/driver/interfaces/views.py
+++ b/gvnfmadapter/driver/interfaces/views.py
@@ -547,18 +547,18 @@ def wait4job(vnfm_id, job_id, gracefulTerminationTimeout=1200, retry_count=60, i
if "responseDescriptor" not in job_result:
logger.error("Job(%s) does not exist.", job_id)
continue
- progress = job_result["responseDescriptor"]["progress"]
+ progress = str(job_result["responseDescriptor"]["progress"])
new_response_id = job_result["responseDescriptor"]["responseId"]
job_desc = job_result["responseDescriptor"]["statusDescription"]
if new_response_id != response_id:
logger.debug("%s:%s:%s", progress, new_response_id, job_desc)
response_id = new_response_id
count = 0
- if progress == 255:
+ if progress == "255":
job_timeout = False
logger.error("Job(%s) failed: %s", job_id, job_desc)
break
- elif progress == 100:
+ elif progress == "100":
job_end_normal, job_timeout = True, False
logger.debug("Job(%s) ended normally,job_end_normal=[%s],job_timeout=[%s]",
job_id, job_end_normal, job_timeout)
@@ -611,7 +611,7 @@ def do_deletevnf(vnfm_id, vnfInstanceId):
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise GvnfmDriverException('Failed to delete vnf.')
- return json.JSONDecoder().decode(ret[1])
+ return ret[1]
def do_lcmVnf(vnfm_id, vnfInstanceId, data, lcmType):
@@ -639,7 +639,7 @@ def do_queryvnf(data, vnfm_id, vnfInstanceId):
def do_subscription(data, vnfm_id):
logger.debug("[%s] request.data=%s", fun_name(), data)
vnfm_info = get_vnfminfo_from_nslcm(vnfm_id)
- logger.debug("[do_deletevnf] vnfm_info=[%s]", vnfm_info)
+ logger.debug("[do_subscription] vnfm_info=[%s]", vnfm_info)
ret = call_vnfm("api/vnflcm/v1/subscriptions", "POST", vnfm_info, data)
logger.debug("[%s] call_req ret=%s", fun_name(), ret)
if ret[0] != 0: