diff options
Diffstat (limited to 'gvnfmadapter/driver/interfaces/views.py')
-rw-r--r-- | gvnfmadapter/driver/interfaces/views.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/gvnfmadapter/driver/interfaces/views.py b/gvnfmadapter/driver/interfaces/views.py index b2eab99..ae40bb6 100644 --- a/gvnfmadapter/driver/interfaces/views.py +++ b/gvnfmadapter/driver/interfaces/views.py @@ -244,20 +244,14 @@ class VnfGrantInfo(APIView): def put(self, request, vnfmtype): try: logger.debug("[grantvnf] req_data = %s", request.data) - ret = req_by_msb('api/nslcm/v1/grantvnf', "POST", content=json.JSONEncoder().encode(request.data)) + ret = req_by_msb('api/nslcm/v2/grants', "POST", content=json.JSONEncoder().encode(request.data)) logger.debug("ret = %s", ret) if ret[0] != 0: logger.error("Status code is %s, detail is %s.", ret[2], ret[1]) raise GvnfmDriverException('Failed to grant vnf.') resp = json.JSONDecoder().decode(ret[1]) - vim_info = resp['vim'] - accessinfo = ignorcase_get(resp['vim'], 'accessinfo') - resp_data = { - 'vimid': ignorcase_get(vim_info, 'vimid'), - 'tenant': ignorcase_get(accessinfo, 'tenant') - } - logger.debug("[%s]resp_data=%s", fun_name(), resp_data) - return Response(data=resp_data, status=status.HTTP_201_CREATED) + logger.debug("[%s]resp_data=%s", fun_name(), resp) + return Response(data=resp, status=status.HTTP_201_CREATED) except GvnfmDriverException as e: logger.error('Grant vnf failed, detail message: %s' % e.message) return Response(data={'error': e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) |