Skip to content

Instantly share code, notes, and snippets.

@hdknr
Created October 3, 2009 19:43
Show Gist options
  • Save hdknr/200830 to your computer and use it in GitHub Desktop.
Save hdknr/200830 to your computer and use it in GitHub Desktop.
def get_object(self, action, params, cls, path='/', parent=None):
if not parent:
parent = self
response = self.make_request(action, params, path)
body = response.read()
boto.log.debug(body)
if response.status == 200:
obj = cls(parent)
h = handler.XmlHandler(obj, parent)
xml.sax.parseString(body, h)
return obj
else:
boto.log.error('%s %s' % (response.status, response.reason))
boto.log.error('%s' % body)
raise self.ResponseError(response.status, response.reason, body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment