def json_error_formatter(body, status, title, environ):
 body = webob.exc.strip_tags(body)
 status_code = int(status.split(None, 1)[0])
 error_dict = {'status': status_code, 'title': title, 'detail': body}
 if (request_id.ENV_REQUEST_ID in environ):
  error_dict['request_id'] = environ[request_id.ENV_REQUEST_ID]
 microversion = nova.api.openstack.placement.microversion
 if ((status_code == 406) and (microversion.MICROVERSION_ENVIRON not in environ)):
  error_dict['max_version'] = microversion.max_version_string()
  error_dict['min_version'] = microversion.min_version_string()
 return {'errors': [error_dict]}

def json_error_formatter ( body , status , title , environ ) : body = webob . exc . strip_tags ( body ) status_code = int ( status . split ( None , 1 ) [ 0 ] ) error_dict = { 'status' : status_code , 'title' : title , 'detail' : body } if ( request_id . ENV_REQUEST_ID in environ ) : error_dict [ 'request_id' ] = environ [ request_id . ENV_REQUEST_ID ] microversion = nova . api . openstack . placement . microversion if ( ( status_code == 406 ) and ( microversion . MICROVERSION_ENVIRON not in environ ) ) : error_dict [ 'max_version' ] = microversion . max_version_string ( ) error_dict [ 'min_version' ] = microversion . min_version_string ( ) return { 'errors' : [ error_dict ] }
a json_formatter for webob exceptions .