Update urllib/httplib/cStringIO to use six.moves
partial blueprint heat-python34-support
Change-Id: I00a7064560a95a33dcb1e621961765822d4e94d4
diff --git a/common/remote_client.py b/common/remote_client.py
index f0405b8..c8c4f95 100644
--- a/common/remote_client.py
+++ b/common/remote_client.py
@@ -10,7 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-import cStringIO
import re
import select
import socket
@@ -34,7 +33,7 @@
self.password = password
if isinstance(pkey, six.string_types):
pkey = paramiko.RSAKey.from_private_key(
- cStringIO.StringIO(str(pkey)))
+ six.moves.cStringIO(str(pkey)))
self.pkey = pkey
self.look_for_keys = look_for_keys
self.key_filename = key_filename
diff --git a/common/test.py b/common/test.py
index a7aa039..ed1e254 100644
--- a/common/test.py
+++ b/common/test.py
@@ -15,13 +15,13 @@
import re
import subprocess
import time
-import urllib
import fixtures
from heatclient import exc as heat_exceptions
from oslo_log import log as logging
from oslo_utils import timeutils
import six
+from six.moves import urllib
import testscenarios
import testtools
@@ -111,7 +111,7 @@
def check_connectivity(self, check_ip):
def try_connect(ip):
try:
- urllib.urlopen('http://%s/' % ip)
+ urllib.request.urlopen('http://%s/' % ip)
return True
except IOError:
return False
diff --git a/functional/test_aws_stack.py b/functional/test_aws_stack.py
index d8ba937..172bc24 100644
--- a/functional/test_aws_stack.py
+++ b/functional/test_aws_stack.py
@@ -13,9 +13,9 @@
import hashlib
import json
import random
-import urlparse
from oslo_log import log as logging
+from six.moves.urllib import parse
from swiftclient import utils as swiftclient_utils
import yaml
@@ -103,7 +103,7 @@
timeout = self.conf.build_timeout * 10
tempurl = swiftclient_utils.generate_temp_url(path, timeout,
key, 'GET')
- sw_url = urlparse.urlparse(oc.url)
+ sw_url = parse.urlparse(oc.url)
return '%s://%s%s' % (sw_url.scheme, sw_url.netloc, tempurl)
def test_nested_stack_create(self):
diff --git a/scenario/test_neutron_loadbalancer.py b/scenario/test_neutron_loadbalancer.py
index fafa9be..1cb1c6f 100644
--- a/scenario/test_neutron_loadbalancer.py
+++ b/scenario/test_neutron_loadbalancer.py
@@ -12,7 +12,8 @@
# under the License.
import time
-import urllib
+
+from six.moves import urllib
from heat_integrationtests.scenario import scenario_base
@@ -31,7 +32,7 @@
resp = set()
for count in range(10):
time.sleep(1)
- resp.add(urllib.urlopen('http://%s/' % ip).read())
+ resp.add(urllib.request.urlopen('http://%s/' % ip).read())
self.assertEqual(expected_resp, resp)