Openstack: python API “how to download image from glance using the python api”



Full example (saving image from glance to disk):

img = client.images.find(name='cirros-0.3.2-x86_64-uec')

file_name = "%s.img" % img.name
image_file = open(file_name, 'w+')

for chunk in img.data():
    image_file.write(chunk)

你可能感兴趣的:(image,python,openstack,download)