diff --git a/tempest/lib/common/ssh.py b/tempest/lib/common/ssh.py index 3a05f27244..60107d7761 100644 --- a/tempest/lib/common/ssh.py +++ b/tempest/lib/common/ssh.py @@ -14,6 +14,7 @@ # under the License. +import io import select import socket import time @@ -67,7 +68,7 @@ class Client(object): self.password = password if isinstance(pkey, six.string_types): pkey = paramiko.RSAKey.from_private_key( - six.StringIO(str(pkey))) + io.StringIO(str(pkey))) self.pkey = pkey self.look_for_keys = look_for_keys self.key_filename = key_filename diff --git a/tempest/tests/cmd/test_workspace.py b/tempest/tests/cmd/test_workspace.py index eae6202248..f16d533963 100644 --- a/tempest/tests/cmd/test_workspace.py +++ b/tempest/tests/cmd/test_workspace.py @@ -12,15 +12,12 @@ # License for the specific language governing permissions and limitations # under the License. +from io import StringIO import os import shutil import subprocess import tempfile from unittest.mock import patch -try: - from StringIO import StringIO -except ImportError: - from io import StringIO from tempest.cmd import workspace from tempest.lib.common.utils import data_utils diff --git a/tempest/tests/lib/test_ssh.py b/tempest/tests/lib/test_ssh.py index 85048fba0e..0ec926244c 100644 --- a/tempest/tests/lib/test_ssh.py +++ b/tempest/tests/lib/test_ssh.py @@ -12,11 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. +from io import StringIO import socket from unittest import mock import six -from six import StringIO import testtools from tempest.lib.common import ssh @@ -30,7 +30,7 @@ class TestSshClient(base.TestCase): SELECT_POLLIN = 1 @mock.patch('paramiko.RSAKey.from_private_key') - @mock.patch('six.StringIO') + @mock.patch('io.StringIO') def test_pkey_calls_paramiko_RSAKey(self, cs_mock, rsa_mock): cs_mock.return_value = mock.sentinel.csio pkey = 'mykey' diff --git a/tools/check_logs.py b/tools/check_logs.py index 4b059f2f43..cc74b17ed9 100755 --- a/tools/check_logs.py +++ b/tools/check_logs.py @@ -17,6 +17,7 @@ import argparse import gzip +import io import os import re import sys @@ -69,7 +70,7 @@ def process_files(file_specs, url_specs, allow_lists): req = urlreq.Request(url) req.add_header('Accept-Encoding', 'gzip') page = urlreq.urlopen(req) - buf = six.StringIO(page.read()) + buf = io.StringIO(page.read()) f = gzip.GzipFile(fileobj=buf) if scan_content(f.read().splitlines(), regexp, allow_list): logs_with_errors.append(name)