Change-Id: I68036c295689fae55125854074e3bc4d920fec06
Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
import os
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
import os
from oslo_config import cfg
from oslo_config import cfg
images = {image.name: image for image in self.glance.images.list()}
if self.conf.image_name not in images:
if not os.path.exists(self.conf.image_filename):
images = {image.name: image for image in self.glance.images.list()}
if self.conf.image_name not in images:
if not os.path.exists(self.conf.image_filename):
- resp = urllib2.urlopen(self.conf.image_download_url)
+ 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,
with open(self.conf.image_filename, "wb") as file:
file.write(resp.read())
self.image = self.glance.images.create(name=self.conf.image_name,