summaryrefslogtreecommitdiff
path: root/glance_store/_drivers/s3.py
diff options
context:
space:
mode:
authorliyou01 <liyou01@inspur.com>2021-01-07 15:57:43 +0800
committerCyril Roelandt <cyril@redhat.com>2022-05-25 04:42:06 +0200
commit5ff06df97fbd78f6781793c35801a4c989a515f1 (patch)
treee81f73b2d062ebccd0a3ed8e8ab20f545dffca5c /glance_store/_drivers/s3.py
parentaeee48b561ba0d100663311c3ba94f0d128105aa (diff)
downloadglance_store-5ff06df97fbd78f6781793c35801a4c989a515f1.tar.gz
Remove Python 2 support
Python 2 has been deprecated for almost two years, and has not been guaranteed to work with glance_store for a while. This patch removes all traces of six, unicode strings and Python 2 tweaks. Co-Authored-By: Cyril Roelandt <cyril@redhat.com> Change-Id: Ifa78924d7ecf4f2d9a54c677888ab2926530c487
Diffstat (limited to 'glance_store/_drivers/s3.py')
-rw-r--r--glance_store/_drivers/s3.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/glance_store/_drivers/s3.py b/glance_store/_drivers/s3.py
index 6eeba86..1a21ddd 100644
--- a/glance_store/_drivers/s3.py
+++ b/glance_store/_drivers/s3.py
@@ -15,9 +15,11 @@
"""Storage backend for S3 or Storage Servers that follow the S3 Protocol"""
+import io
import logging
import math
import re
+import urllib
from boto3 import session as boto_session
from botocore import client as boto_client
@@ -27,8 +29,6 @@ import eventlet
from oslo_config import cfg
from oslo_utils import encodeutils
from oslo_utils import units
-import six
-from six.moves import urllib
import glance_store
from glance_store import capabilities
@@ -706,7 +706,7 @@ class Store(glance_store.driver.Store):
checksum.update(write_chunk)
if verifier:
verifier.update(write_chunk)
- fp = six.BytesIO(write_chunk)
+ fp = io.BytesIO(write_chunk)
fp.seek(0)
part = UploadPart(mpu, fp, cstart + 1, len(write_chunk))
pool.spawn_n(run_upload, s3_client, bucket, key, part)
@@ -721,7 +721,7 @@ class Store(glance_store.driver.Store):
checksum.update(write_chunk)
if verifier:
verifier.update(write_chunk)
- fp = six.BytesIO(write_chunk)
+ fp = io.BytesIO(write_chunk)
fp.seek(0)
part = UploadPart(mpu, fp, cstart + 1, len(write_chunk))
pool.spawn_n(run_upload, s3_client, bucket, key, part)
@@ -888,7 +888,7 @@ class Store(glance_store.driver.Store):
{
'PartNumber': pnum,
'ETag': etag
- } for pnum, etag in six.iteritems(pedict)
+ } for pnum, etag in pedict.items()
]
}