faults.py (ec2-api-14.0.1) | : | faults.py (ec2-api-15.0.0) | ||
---|---|---|---|---|
skipping to change at line 64 | skipping to change at line 64 | |||
"""Generate a WSGI response based on the exception passed to ctor.""" | """Generate a WSGI response based on the exception passed to ctor.""" | |||
code = ec2api.api.exception_to_ec2code(self.wrapped_exc) | code = ec2api.api.exception_to_ec2code(self.wrapped_exc) | |||
status = self.wrapped_exc.status_int | status = self.wrapped_exc.status_int | |||
message = self.wrapped_exc.explanation | message = self.wrapped_exc.explanation | |||
if status == 501: | if status == 501: | |||
message = "The requested function is not supported" | message = "The requested function is not supported" | |||
if 'AWSAccessKeyId' not in req.params: | if 'AWSAccessKeyId' not in req.params: | |||
raise webob.exc.HTTPBadRequest() | raise webob.exc.HTTPBadRequest() | |||
user_id, _sep, project_id = req.params['AWSAccessKeyId'].partition(':') | ||||
project_id = project_id or user_id | ||||
remote_address = getattr(req, 'remote_address', '127.0.0.1') | ||||
if CONF.use_forwarded_for: | ||||
remote_address = req.headers.get('X-Forwarded-For', remote_address) | ||||
resp = ec2_error_response(common_context.generate_request_id(), code, | resp = ec2_error_response(common_context.generate_request_id(), code, | |||
message=message, status=status) | message=message, status=status) | |||
return resp | return resp | |||
End of changes. 1 change blocks. | ||||
5 lines changed or deleted | 0 lines changed or added |