Merge "Fix python3 compatibility issues"
This commit is contained in:
commit
492b89fa7d
|
@ -458,6 +458,8 @@ class Resource(object):
|
|||
pass
|
||||
|
||||
def __getattr__(self, k):
|
||||
if k == "__setstate__":
|
||||
raise AttributeError(k)
|
||||
if k not in self.__dict__:
|
||||
# NOTE(bcwaldon): disallow lazy-loading if already loaded once
|
||||
if not self.is_loaded:
|
||||
|
|
|
@ -246,7 +246,7 @@ class Resource(object):
|
|||
return None
|
||||
|
||||
def _add_details(self, info):
|
||||
for (k, v) in info.iteritems():
|
||||
for (k, v) in info.items():
|
||||
try:
|
||||
setattr(self, k, v)
|
||||
except AttributeError:
|
||||
|
|
|
@ -200,9 +200,9 @@ class TroveHTTPClient(httplib2.Http):
|
|||
if 'body' in kwargs:
|
||||
kwargs['body'] = json.dumps(kwargs['body'])
|
||||
|
||||
def morph_response_body(self, body_string):
|
||||
def morph_response_body(self, raw_body):
|
||||
try:
|
||||
return json.loads(body_string)
|
||||
return json.loads(raw_body.decode())
|
||||
except ValueError:
|
||||
raise exceptions.ResponseFormatError()
|
||||
|
||||
|
|
Loading…
Reference in New Issue