summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordongwenjuan <dong.wenjuan@zte.com.cn>2017-06-23 15:50:05 +0800
committerdongwenjuan <dong.wenjuan@zte.com.cn>2017-06-30 09:09:44 +0800
commit1bc6eb0e8f1ed1e20edcdd7362c23c8948ed3d77 (patch)
treeaf068b9bdb43d023500b29d7124608e8f1eb76cd
parent9ae13f88c29d7babea19fb65bef208e631a12be4 (diff)
replace urllib2 with urllib.request for python3
Change-Id: I68036c295689fae55125854074e3bc4d920fec06 Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
-rw-r--r--tests/image.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/image.py b/tests/image.py
index 5226c789..453322b8 100644
--- a/tests/image.py
+++ b/tests/image.py
@@ -7,7 +7,7 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
import os
-import urllib2
+import urllib.request
from oslo_config import cfg
@@ -50,7 +50,7 @@ class Image(object):
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,