File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,28 +108,3 @@ class HTTPNotImplemented(ClientException):
108108 OverLimit ,
109109 HTTPNotImplemented
110110])
111-
112-
113- def from_response (response , body ):
114- """Return an instance of a ClientException based on an httplib2 response.
115-
116- Usage::
117-
118- resp, body = http.request(...)
119- if resp.status != 200:
120- raise exception_from_response(resp, body)
121- """
122- cls = _code_map .get (response .status , ClientException )
123- if body :
124- if hasattr (body , 'keys' ):
125- error = body [list (body .keys ())[0 ]]
126- message = error .get ('message' )
127- details = error .get ('details' )
128- else :
129- # If we didn't get back a properly formed error message we
130- # probably couldn't communicate with Keystone at all.
131- message = "Unable to communicate with image service: %s." % body
132- details = None
133- return cls (code = response .status , message = message , details = details )
134- else :
135- return cls (code = response .status )
You can’t perform that action at this time.
0 commit comments