Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def upload_volume(self, volume_id, image_name):
- """Uploads a volume in Glance."""
- post_body = Element("volume",
- image_name=image_name,
- )
- resp, body = self.post('os-volume_upload_image',
- str(Document(post_body)),
- self.headers)
- url = 'volumes/%s/action' % (volume_id)
- resp, body = self.post(url, str(Document(post_body)), self.headers)
- volume = self.xml_to_json(etree.fromstring(body)
- return resp, volume
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement