Advertisement
Guest User

Untitled

a guest
Jul 31st, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def upload_volume(self, volume_id, image_name):
  2. """Uploads a volume in Glance."""
  3. post_body = Element("volume",
  4. image_name=image_name,
  5. )
  6. resp, body = self.post('os-volume_upload_image',
  7. str(Document(post_body)),
  8. self.headers)
  9. url = 'volumes/%s/action' % (volume_id)
  10. resp, body = self.post(url, str(Document(post_body)), self.headers)
  11. volume = self.xml_to_json(etree.fromstring(body)
  12.  
  13. return resp, volume
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement