Merge "Py3: Use dict.items instead of dict.iteritems"

This commit is contained in:
Zuul 2018-12-02 05:44:55 +00:00 committed by Gerrit Code Review
commit f34f426a79
4 changed files with 5 additions and 5 deletions

View File

@ -541,7 +541,7 @@ class UploadController(Controller):
upload_id = req.params['uploadId']
resp = _get_upload_info(req, self.app, upload_id)
headers = {}
for key, val in resp.headers.iteritems():
for key, val in resp.headers.items():
_key = key.lower()
if _key.startswith('x-amz-meta-'):
headers['x-object-meta-' + _key[11:]] = val

View File

@ -94,7 +94,7 @@ class S3Response(S3ResponseBase, swob.Response):
s3api_sysmeta_prefix = sysmeta_prefix(_server_type).lower()
return sysmeta_key.lower().startswith(s3api_sysmeta_prefix)
for key, val in self.headers.iteritems():
for key, val in self.headers.items():
if is_sys_meta('object', key) or is_sys_meta('container', key):
_server_type = key.split('-')[1]
if is_swift3_sysmeta(key, _server_type):
@ -113,7 +113,7 @@ class S3Response(S3ResponseBase, swob.Response):
sw_headers[key] = val
# Handle swift headers
for key, val in sw_headers.iteritems():
for key, val in sw_headers.items():
_key = key.lower()
if _key.startswith('x-object-meta-'):

View File

@ -153,7 +153,7 @@ class FakeSwift(object):
if (method, path) in self._responses:
old_headers = self._responses[(method, path)][1]
headers = headers.copy()
for key, value in old_headers.iteritems():
for key, value in old_headers.items():
if is_sys_meta(resource, key) and key not in headers:
# keep old sysmeta for s3acl
headers.update({key: value})

View File

@ -92,7 +92,7 @@ class TestS3ApiObj(S3ApiTestCase):
self.assertEqual(status.split()[0], '200')
unexpected_headers = []
for key, val in self.response_headers.iteritems():
for key, val in self.response_headers.items():
if key in ('Content-Length', 'Content-Type', 'content-encoding',
'last-modified', 'cache-control', 'Content-Disposition',
'Content-Language', 'expires', 'x-robots-tag'):