diff options
Diffstat (limited to 'multivimbroker')
-rw-r--r-- | multivimbroker/multivimbroker/api_v2/api_router/v0_controller.py | 6 | ||||
-rw-r--r-- | multivimbroker/multivimbroker/forwarder/base.py | 5 | ||||
-rw-r--r-- | multivimbroker/multivimbroker/pub/utils/restcall.py | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/multivimbroker/multivimbroker/api_v2/api_router/v0_controller.py b/multivimbroker/multivimbroker/api_v2/api_router/v0_controller.py index 99c1b08..a158c42 100644 --- a/multivimbroker/multivimbroker/api_v2/api_router/v0_controller.py +++ b/multivimbroker/multivimbroker/api_v2/api_router/v0_controller.py @@ -86,8 +86,8 @@ class V0_Controller(object): logger.error("Status code is %s, detail is %s.", status_code, content) response = pecan.Response(body=content, status=status_code) - - for k in syscomm.getHeadersKeys(resp): - response.headers[k] = resp[k] + if retcode == 0: + for k in syscomm.getHeadersKeys(resp): + response.headers[k] = resp[k] return response diff --git a/multivimbroker/multivimbroker/forwarder/base.py b/multivimbroker/multivimbroker/forwarder/base.py index 512bb6a..6d45014 100644 --- a/multivimbroker/multivimbroker/forwarder/base.py +++ b/multivimbroker/multivimbroker/forwarder/base.py @@ -48,8 +48,9 @@ class BaseHandler(object): logger.exception("exception: %s" % e) response = HttpResponse(content, status=status_code) - for k in getHeadersKeys(resp): - response[k] = resp[k] + if retcode == 0: + for k in getHeadersKeys(resp): + response[k] = resp[k] return response def _multipart_req(self, route_uri, method, body, headers=None): diff --git a/multivimbroker/multivimbroker/pub/utils/restcall.py b/multivimbroker/multivimbroker/pub/utils/restcall.py index 046d77c..a136353 100644 --- a/multivimbroker/multivimbroker/pub/utils/restcall.py +++ b/multivimbroker/multivimbroker/pub/utils/restcall.py @@ -69,7 +69,7 @@ def call_req(base_url, user, passwd, auth_type, resource, method, # logger.debug("[%s]call_req('%s','%s','%s',%s,'%s','%s','%s')" % ( # callid, base_url, user, passwd, auth_type, resource, method, content)) ret = None - resp_status = '' + resp_status = '500' resp = "" full_url = "" |