help='the name of image file',
required=True),
cfg.StrOpt('image_download_url',
- default='https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img',
+ default='https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img', # noqa
help='the url where to get the image',
required=True),
]
resp = urllib.request.urlopen(self.conf.image_download_url)
with open(self.conf.image_filename, "wb") as file:
file.write(resp.read())
- self.image = self.glance.images.create(name=self.conf.image_name,
- disk_format=self.conf.image_format,
- container_format="bare",
- visibility="public")
+ self.image = \
+ self.glance.images.create(
+ name=self.conf.image_name,
+ disk_format=self.conf.image_format,
+ container_format="bare",
+ visibility="public")
self.glance.images.upload(self.image['id'],
open(self.conf.image_filename, 'rb'))
else: