diff options
author | Tim Burke <tim.burke@gmail.com> | 2019-05-04 16:33:41 -0700 |
---|---|---|
committer | Tim Burke <tim.burke@gmail.com> | 2019-05-04 20:35:05 -0700 |
commit | b8284538be4c17052c4c399a7fa09fd2abb50c49 (patch) | |
tree | 2c9810bd069e1b9b99f5a95d55556a10b8da8d55 /swift/proxy/controllers/container.py | |
parent | 310416abf3b929a6bd26044b6613b68428fde160 (diff) | |
download | swift-b8284538be4c17052c4c399a7fa09fd2abb50c49.tar.gz |
py3: start porting for unit/proxy/test_server.py
Mostly this ammounts to
Exception.message -> Exception.args[0]
'...' -> b'...'
StringIO -> BytesIO
makefile() -> makefile('rwb')
iter.next() -> next(iter)
bytes[n] -> bytes[n:n + 1]
integer division
Note that the versioning tests are mostly untouched; they seemed to get
a little hairy.
Change-Id: I167b5375e7ed39d4abecf0653f84834ea7dac635
Diffstat (limited to 'swift/proxy/controllers/container.py')
-rw-r--r-- | swift/proxy/controllers/container.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/swift/proxy/controllers/container.py b/swift/proxy/controllers/container.py index ebdffee29..fb29c7fdf 100644 --- a/swift/proxy/controllers/container.py +++ b/swift/proxy/controllers/container.py @@ -270,9 +270,9 @@ class ContainerController(Controller): str(config_true_value(req.headers['X-Container-Sharding'])) length_limit = self.get_name_length_limit() if len(self.container_name) > length_limit: - resp = HTTPBadRequest(request=req) - resp.body = 'Container name length of %d longer than %d' % \ - (len(self.container_name), length_limit) + body = 'Container name length of %d longer than %d' % ( + len(self.container_name), length_limit) + resp = HTTPBadRequest(request=req, body=body) return resp account_partition, accounts, container_count = \ self.account_info(self.account_name, req) @@ -289,9 +289,9 @@ class ContainerController(Controller): self.container_info(self.account_name, self.container_name, req) if not is_success(container_info.get('status')): - resp = HTTPForbidden(request=req) - resp.body = 'Reached container limit of %s' % \ - self.app.max_containers_per_account + body = 'Reached container limit of %s' % ( + self.app.max_containers_per_account, ) + resp = HTTPForbidden(request=req, body=body) return resp container_partition, containers = self.app.container_ring.get_nodes( self.account_name, self.container_name) |