diff --git a/swift/container/server.py b/swift/container/server.py index 702d2962e8..0960e5dac0 100644 --- a/swift/container/server.py +++ b/swift/container/server.py @@ -119,9 +119,9 @@ class ContainerController(object): # but if there is, we want to know about it. self.logger.error(_('ERROR Account update failed: different ' 'numbers of hosts and devices in request: ' - '"%s" vs "%s"' % - (req.headers.get('X-Account-Host', ''), - req.headers.get('X-Account-Device', '')))) + '"%s" vs "%s"') % + (req.headers.get('X-Account-Host', ''), + req.headers.get('X-Account-Device', ''))) return HTTPBadRequest(req=req) if account_partition: diff --git a/swift/obj/server.py b/swift/obj/server.py index 2efcb9e034..7bc39742ca 100644 --- a/swift/obj/server.py +++ b/swift/obj/server.py @@ -194,9 +194,9 @@ class ObjectController(object): # but if there is, we want to know about it. self.logger.error(_('ERROR Container update failed: different ' 'numbers of hosts and devices in request: ' - '"%s" vs "%s"' % - (headers_in.get('X-Container-Host', ''), - headers_in.get('X-Container-Device', '')))) + '"%s" vs "%s"') % + (headers_in.get('X-Container-Host', ''), + headers_in.get('X-Container-Device', ''))) return if contpartition: diff --git a/swift/proxy/controllers/obj.py b/swift/proxy/controllers/obj.py index 77dbeb90a4..b5de749a71 100644 --- a/swift/proxy/controllers/obj.py +++ b/swift/proxy/controllers/obj.py @@ -217,24 +217,24 @@ class SegmentedIterable(object): if sub_etag != self.segment_dict['hash']: raise SegmentError(_( 'Object segment does not match sub-slo: ' - '%(path)s etag: %(r_etag)s != %(s_etag)s.' % + '%(path)s etag: %(r_etag)s != %(s_etag)s.') % {'path': path, 'r_etag': sub_etag, - 's_etag': self.segment_dict['hash']})) + 's_etag': self.segment_dict['hash']}) return self._load_next_segment() except ValueError: raise SegmentError(_( - 'Sub SLO has invalid manifest: %s' % path)) + 'Sub SLO has invalid manifest: %s') % path) elif resp.etag != self.segment_dict['hash'] or \ resp.content_length != self.segment_dict['bytes']: raise SegmentError(_( 'Object segment no longer valid: ' '%(path)s etag: %(r_etag)s != %(s_etag)s or ' - '%(r_size)s != %(s_size)s.' % + '%(r_size)s != %(s_size)s.') % {'path': path, 'r_etag': resp.etag, 'r_size': resp.content_length, 's_etag': self.segment_dict['hash'], - 's_size': self.segment_dict['bytes']})) + 's_size': self.segment_dict['bytes']}) self.segment_iter = resp.app_iter # See NOTE: swift_conn at top of file about this. self.segment_iter_swift_conn = getattr(resp, 'swift_conn', None) diff --git a/tox.ini b/tox.ini index 8c9ccfc49c..064d5b0b23 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,8 @@ commands = commands = {posargs} [flake8] -ignore = H203,H301,H302,H306,H402,H404,H702,H703 +# TODO(dmllr): Review some of the hacking warnings and fix if applicable +# H233 Use print function, not print operator +ignore = H203,H233,H301,H302,H306,H402,H404,H703 exclude = .venv,.tox,dist,doc,*egg show-source = True