Code Review
/
vfc
/
gvnfm
/
vnflcm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
vfclcm upgrade from python2 to python3
[vfc/gvnfm/vnflcm.git]
/
lcm
/
lcm
/
nf
/
views
/
common.py
diff --git
a/lcm/lcm/nf/views/common.py
b/lcm/lcm/nf/views/common.py
index
e24a8bc
..
6bab28f
100644
(file)
--- a/
lcm/lcm/nf/views/common.py
+++ b/
lcm/lcm/nf/views/common.py
@@
-51,43
+51,43
@@
def view_safe_call_with_log(logger):
try:
return func(*args, **kwargs)
except NFLCMExceptionSeeOther as e:
try:
return func(*args, **kwargs)
except NFLCMExceptionSeeOther as e:
- logger.error(e.
message
)
+ logger.error(e.
args[0]
)
resp = Response(status=status.HTTP_303_SEE_OTHER)
resp = Response(status=status.HTTP_303_SEE_OTHER)
- resp["Location"] = e.
message
+ resp["Location"] = e.
args[0]
# resp["Location"] = "subscriptions/%s" % e.id
return resp
except NFLCMExceptionNotFound as e:
# resp["Location"] = "subscriptions/%s" % e.id
return resp
except NFLCMExceptionNotFound as e:
- logger.error(e.
message
)
+ logger.error(e.
args[0]
)
return make_error_resp(
return make_error_resp(
- detail=e.
message
,
+ detail=e.
args[0]
,
status=status.HTTP_404_NOT_FOUND
)
except NFLCMExceptionBadRequest as e:
status=status.HTTP_404_NOT_FOUND
)
except NFLCMExceptionBadRequest as e:
- logger.error(e.
message
)
+ logger.error(e.
args[0]
)
return make_error_resp(
return make_error_resp(
- detail=e.
message
,
+ detail=e.
args[0]
,
status=status.HTTP_400_BAD_REQUEST
)
except NFLCMExceptionConflict as e:
status=status.HTTP_400_BAD_REQUEST
)
except NFLCMExceptionConflict as e:
- logger.error(e.
message
)
+ logger.error(e.
args[0]
)
return make_error_resp(
return make_error_resp(
- detail=e.
message
,
+ detail=e.
args[0]
,
status=status.HTTP_409_CONFLICT
)
except NFLCMExceptionPreconditionFailed as e:
status=status.HTTP_409_CONFLICT
)
except NFLCMExceptionPreconditionFailed as e:
- logger.error(e.
message
)
+ logger.error(e.
args[0]
)
return make_error_resp(
return make_error_resp(
- detail=e.
message
,
+ detail=e.
args[0]
,
status=status.HTTP_412_PRECONDITION_FAILED
)
except NFLCMException as e:
status=status.HTTP_412_PRECONDITION_FAILED
)
except NFLCMException as e:
- logger.error(e.
message
)
+ logger.error(e.
args[0]
)
return make_error_resp(
return make_error_resp(
- detail=e.
message
,
+ detail=e.
args[0]
,
status=status.HTTP_500_INTERNAL_SERVER_ERROR
)
except Exception as e:
status=status.HTTP_500_INTERNAL_SERVER_ERROR
)
except Exception as e:
- logger.error(e.
message
)
+ logger.error(e.
args[0]
)
logger.error(traceback.format_exc())
return make_error_resp(
detail='Unexpected exception',
logger.error(traceback.format_exc())
return make_error_resp(
detail='Unexpected exception',
@@
-143,7
+143,7
@@
def deal_indivdual_query(res_serializer, query_fun, *args):
if not resp_serializer.is_valid():
raise NFLCMException(resp_serializer.errors)
if not resp_serializer.is_valid():
raise NFLCMException(resp_serializer.errors)
- resp = Response(data=res
p_serializer.data
, status=status.HTTP_200_OK)
+ resp = Response(data=res, status=status.HTTP_200_OK)
if res_serializer == VnfInstanceSerializer:
CACHE_ETAG = "%s" % uuid.uuid1()
logger.debug("set CACHE_ETAG = %s", CACHE_ETAG)
if res_serializer == VnfInstanceSerializer:
CACHE_ETAG = "%s" % uuid.uuid1()
logger.debug("set CACHE_ETAG = %s", CACHE_ETAG)