diff options
author | Zuul <zuul@review.opendev.org> | 2020-09-04 04:21:02 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-09-04 04:21:02 +0000 |
commit | 488d8a71e2e77457a08bab4c2870f2d110cc8b65 (patch) | |
tree | f4a3832874a12b7891f2432dd36b45494e7aa614 /trove | |
parent | a10d38df71c12776d4e26f1ed80d78ddb73b84a2 (diff) | |
parent | 5bf159de3673ec81e7beaebe4b2fd474bf34616b (diff) | |
download | trove-488d8a71e2e77457a08bab4c2870f2d110cc8b65.tar.gz |
Merge "Remove six.PY3"
Diffstat (limited to 'trove')
-rw-r--r-- | trove/dns/designate/driver.py | 4 | ||||
-rw-r--r-- | trove/tests/fakes/swift.py | 5 | ||||
-rw-r--r-- | trove/tests/unittests/api/common/test_limits.py | 3 | ||||
-rw-r--r-- | trove/tests/unittests/domain-name-service/test_designate_driver.py | 7 |
4 files changed, 5 insertions, 14 deletions
diff --git a/trove/dns/designate/driver.py b/trove/dns/designate/driver.py index d25859a3..7747d1f0 100644 --- a/trove/dns/designate/driver.py +++ b/trove/dns/designate/driver.py @@ -25,7 +25,6 @@ from keystoneauth1 import loading from keystoneauth1 import session from oslo_log import log as logging from oslo_utils import encodeutils -import six from trove.common import cfg from trove.common import exception @@ -110,8 +109,7 @@ class DesignateInstanceEntryFactory(driver.DnsInstanceEntryFactory): name = encodeutils.to_utf8(instance_id) name = hashlib.md5(name).digest() name = base64.b32encode(name)[:11].lower() - if six.PY3: - name = name.decode('ascii') + name = name.decode('ascii') hostname = ("%s.%s" % (name, zone.name)) # Removing the leading dot if present if hostname.endswith('.'): diff --git a/trove/tests/fakes/swift.py b/trove/tests/fakes/swift.py index 379aa8ff..7b8da07a 100644 --- a/trove/tests/fakes/swift.py +++ b/trove/tests/fakes/swift.py @@ -108,10 +108,7 @@ class FakeSwiftConnection(object): object_checksum = md5(self.container_objects[object_name]) # The manifest file etag for a HEAD or GET is the checksum of # the concatenated checksums. - if six.PY3: - checksum.update(object_checksum.hexdigest().encode()) - else: - checksum.update(object_checksum.hexdigest()) + checksum.update(object_checksum.hexdigest().encode()) # this is included to test bad swift segment etags if name.startswith("bad_manifest_etag_"): return {'etag': '"this_is_an_intentional_bad_manifest_etag"'} diff --git a/trove/tests/unittests/api/common/test_limits.py b/trove/tests/unittests/api/common/test_limits.py index 2cf3be08..7d8ee340 100644 --- a/trove/tests/unittests/api/common/test_limits.py +++ b/trove/tests/unittests/api/common/test_limits.py @@ -600,8 +600,7 @@ class FakeHttplibConnection(object): resp = str(req.get_response(self.app)) resp = "HTTP/1.0 %s" % resp - if six.PY3: - resp = resp.encode("utf-8") + resp = resp.encode("utf-8") sock = FakeHttplibSocket(resp) self.http_response = http_client.HTTPResponse(sock) self.http_response.begin() diff --git a/trove/tests/unittests/domain-name-service/test_designate_driver.py b/trove/tests/unittests/domain-name-service/test_designate_driver.py index 7a464e0b..4b07de9c 100644 --- a/trove/tests/unittests/domain-name-service/test_designate_driver.py +++ b/trove/tests/unittests/domain-name-service/test_designate_driver.py @@ -16,7 +16,6 @@ import hashlib from unittest.mock import MagicMock from unittest.mock import patch -import six from trove.common import exception from trove.dns.designate import driver @@ -89,8 +88,7 @@ class DesignateInstanceEntryFactoryTest(trove_testtools.TestCase): driver.DNS_TTL = 3600 hashed_id = hashlib.md5(instance_id.encode()).digest() hashed_id = base64.b32encode(hashed_id) - if six.PY3: - hashed_id = hashed_id.decode('ascii') + hashed_id = hashed_id.decode('ascii') hashed_id_concat = hashed_id[:11].lower() exp_hostname = ("%s.%s" % (hashed_id_concat, driver.DNS_DOMAIN_NAME)) factory = driver.DesignateInstanceEntryFactory() @@ -109,8 +107,7 @@ class DesignateInstanceEntryFactoryTest(trove_testtools.TestCase): driver.DNS_TTL = 3600 hashed_id = hashlib.md5(instance_id.encode()).digest() hashed_id = base64.b32encode(hashed_id) - if six.PY3: - hashed_id = hashed_id.decode('ascii') + hashed_id = hashed_id.decode('ascii') hashed_id_concat = hashed_id[:11].lower() exp_hostname = ("%s.%s" % (hashed_id_concat, driver.DNS_DOMAIN_NAME))[:-1] |