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)
本文共 270 字,大约阅读时间需要 1 分钟。
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)
转载于:https://my.oschina.net/shadai/blog/699052