def ec2_error(req, request_id, code, message):
 LOG.error((_('%(code)s: %(message)s') % locals()))
 resp = webob.Response()
 resp.status = 400
 resp.headers['Content-Type'] = 'text/xml'
 resp.body = str(('<?xml version="1.0"?>\n<Response><Errors><Error><Code>%s</Code><Message>%s</Message></Error></Errors><RequestID>%s</RequestID></Response>' % (utils.xhtml_escape(utils.utf8(code)), utils.xhtml_escape(utils.utf8(message)), utils.xhtml_escape(utils.utf8(request_id)))))
 return resp

def ec2_error ( req , request_id , code , message ) : LOG . error ( ( _ ( '%(code)s: %(message)s' ) % locals ( ) ) ) resp = webob . Response ( ) resp . status = 400 resp . headers [ 'Content-Type' ] = 'text/xml' resp . body = str ( ( '<?xml version="1.0"?>\n<Response><Errors><Error><Code>%s</Code><Message>%s</Message></Error></Errors><RequestID>%s</RequestID></Response>' % ( utils . xhtml_escape ( utils . utf8 ( code ) ) , utils . xhtml_escape ( utils . utf8 ( message ) ) , utils . xhtml_escape ( utils . utf8 ( request_id ) ) ) ) ) return resp
helper to send an ec2_compatible error .