diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-11-10 20:08:41 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-11-10 20:12:59 +0800 |
commit | cfc163f4b52cc46bc372e221428f1721b65ce9d6 (patch) | |
tree | a6104323be4706acfef1aedd4efa76d3d09508db | |
parent | f8df2f9807b1dfd5deb051118b6210607124fa34 (diff) |
Fix vfc-ztevmanagerdriver heal bug
Change-Id: I5ab8b426929ac164859d6cb7cfd7bc85d7ba0a4b
Issue-ID: VFC-589
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r-- | zte/vmanager/driver/interfaces/views.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/zte/vmanager/driver/interfaces/views.py b/zte/vmanager/driver/interfaces/views.py index 58dac487..6626c1d3 100644 --- a/zte/vmanager/driver/interfaces/views.py +++ b/zte/vmanager/driver/interfaces/views.py @@ -530,7 +530,14 @@ def heal(request, *args, **kwargs): if ret[0] != 0: return Response(data={'error': ret[1]}, status=ret[2]) vnfm_info = json.JSONDecoder().decode(ret[1]) - data = request.data + data = {} + data['action'] = ignorcase_get(request.data, 'action') + affectedvm = ignorcase_get(request.data, 'affectedvm') + data['affectedvm'] = [] + if isinstance(affectedvm, list): + data['affectedvm'] = affectedvm + else: + data['affectedvm'].append(affectedvm) data['lifecycleoperation'] = 'operate' data['isgrace'] = 'force' @@ -541,7 +548,7 @@ def heal(request, *args, **kwargs): passwd=ignorcase_get(vnfm_info, "password"), auth_type=restcall.rest_no_auth, resource=nf_healing_url.format(vnfInstanceID=nf_instance_id), - method='put', # POST + method='post', content=json.JSONEncoder().encode(data)) logger.info("ret=%s", ret) if ret[0] != 0: |