Remove all usage of six library
Replace six with Python 3 style code.
Change-Id: I724eba28d1a88317655f9cb7da94716772cd01ab
diff --git a/manila_tempest_tests/tests/scenario/manager.py b/manila_tempest_tests/tests/scenario/manager.py
index 1fa03f4..947d0e6 100644
--- a/manila_tempest_tests/tests/scenario/manager.py
+++ b/manila_tempest_tests/tests/scenario/manager.py
@@ -20,7 +20,6 @@
from oslo_log import log
from oslo_utils import netutils
from oslo_utils import uuidutils
-import six
from tempest.common import compute
from tempest.common import image as common_image
from tempest.common.utils.linux import remote_client
@@ -630,7 +629,7 @@
try:
return subnets_client.create_subnet(**subnet)
except lib_exc.Conflict as e:
- if 'overlaps with another subnet' not in six.text_type(e):
+ if 'overlaps with another subnet' not in str(e):
raise
result = None
diff --git a/manila_tempest_tests/tests/scenario/manager_share.py b/manila_tempest_tests/tests/scenario/manager_share.py
index d68ab04..657b1f1 100644
--- a/manila_tempest_tests/tests/scenario/manager_share.py
+++ b/manila_tempest_tests/tests/scenario/manager_share.py
@@ -14,10 +14,9 @@
# under the License.
from tempfile import mkstemp
+from urllib.request import urlopen
from oslo_log import log
-import six
-from six.moves.urllib.request import urlopen
from tempest.common import waiters
from tempest import config
from tempest.lib.common.utils import data_utils
@@ -288,7 +287,7 @@
# original implementation depends on CONF.compute.ssh_auth_method
# option.
server_or_ip = kwargs['server_or_ip']
- if isinstance(server_or_ip, six.string_types):
+ if isinstance(server_or_ip, str):
ip = server_or_ip
else:
addr = server_or_ip['addresses'][
diff --git a/manila_tempest_tests/tests/scenario/test_share_extend.py b/manila_tempest_tests/tests/scenario/test_share_extend.py
index f4dce61..d6a23d0 100644
--- a/manila_tempest_tests/tests/scenario/test_share_extend.py
+++ b/manila_tempest_tests/tests/scenario/test_share_extend.py
@@ -13,7 +13,6 @@
import ddt
from oslo_log import log as logging
from oslo_utils import units
-import six
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions
@@ -133,7 +132,7 @@
block_count,
'/dev/urandom')
except exceptions.SSHExecCommandFailed as e:
- if 'stale file handle' in six.text_type(e).lower():
+ if 'stale file handle' in str(e).lower():
LOG.warning("Client was disconnected during extend process")
self.unmount_share(remote_client)
self.mount_share(mount_location, remote_client)
diff --git a/manila_tempest_tests/tests/scenario/test_share_shrink.py b/manila_tempest_tests/tests/scenario/test_share_shrink.py
index b4bfcd5..a4e59e8 100644
--- a/manila_tempest_tests/tests/scenario/test_share_shrink.py
+++ b/manila_tempest_tests/tests/scenario/test_share_shrink.py
@@ -13,7 +13,6 @@
import time
from oslo_log import log as logging
-import six
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions
@@ -146,7 +145,7 @@
new_size=new_size)
except exceptions.BadRequest as e:
if ('New size for shrink must be less than current size'
- in six.text_type(e)):
+ in str(e)):
break
time.sleep(check_interval)