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

来源:互联网 发布:知乎首页 特效 编辑:程序博客网 时间:2024/05/04 04:23


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.nameimage_file = open(file_name, 'w+')for chunk in img.data():    image_file.write(chunk)
0 0
原创粉丝点击