if 'httplib.ResponseNotReady' in res_info:
res_info = "The URL[%s] request failed or is not responding." % full_url
ret = [3, res_info, resp_status]
- except:
- logger.error(traceback.format_exc())
- ret = [4, str(sys.exc_info()), resp_status]
logger.debug("[%s]ret=%s" % (callid, str(ret)))
return ret
import logging
import json
+import traceback
from rest_framework import status
from rest_framework.decorators import api_view
password=ignore_case_get(request.data, "password")).save()
except Exception as e:
logger.error(e.message)
+ logger.error(traceback.format_exc())
return Response(data={'error': e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return Response(data={"vnfInstId": vnf_inst_id}, status=status.HTTP_201_CREATED)
vnf_inst_id = ignore_case_get(kwargs, "vnfInstId")
logger.info("Enter %s, method is %s, ", fun_name(), request.method)
logger.info("vnfInstId is %s, data is %s", vnf_inst_id, request.data)
- # ret, normal_status = None, None
try:
vnf = VnfRegModel.objects.filter(id=vnf_inst_id)
if not vnf:
normal_status = status.HTTP_204_NO_CONTENT
except Exception as e:
logger.error(e.message)
+ logger.error(traceback.format_exc())
return Response(data={'error': e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return Response(data=ret, status=normal_status)
raise Exception("Failed to config Vnf(%s): %s" % (vnf_inst_id, ret[1]))
except Exception as e:
logger.error(e.message)
+ logger.error(traceback.format_exc())
return Response(data={'error': e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return Response(data={}, status=status.HTTP_202_ACCEPTED)