)]}'
{"swift/container/server.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a1c1259e367874df5b0d0c7e8e9771ccb558bed3","unresolved":false,"context_lines":[{"line_number":441,"context_line":"                try:"},{"line_number":442,"context_line":"                    shard_ranges \u003d json.loads(req.body)"},{"line_number":443,"context_line":"                    # validate incoming data..."},{"line_number":444,"context_line":"                    [ShardRange.from_dict(sr) for sr in shard_ranges]"},{"line_number":445,"context_line":"                except (ValueError, KeyError) as err:"},{"line_number":446,"context_line":"                    return HTTPBadRequest(\u0027Invalid body: %r\u0027 % err)"},{"line_number":447,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_d9ac73f0","line":444,"updated":"2018-03-17 00:58:47.000000000","message":"so we should have something that\u0027s like \"parse_shard_ranges\" and the broker method should accept that...","commit_id":"6c6a1415143d86211596d2101c5d1159f5240e14"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a1c1259e367874df5b0d0c7e8e9771ccb558bed3","unresolved":false,"context_lines":[{"line_number":472,"context_line":"            if shard_ranges:"},{"line_number":473,"context_line":"                # TODO: consider writing the shard ranges into the pending"},{"line_number":474,"context_line":"                # file, but if so ensure an all-or-none semantic for the write"},{"line_number":475,"context_line":"                broker.merge_shard_ranges(shard_ranges)"},{"line_number":476,"context_line":"            resp \u003d self.account_update(req, account, container, broker)"},{"line_number":477,"context_line":"            if resp:"},{"line_number":478,"context_line":"                return resp"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_f9a937dd","line":475,"updated":"2018-03-17 00:58:47.000000000","message":"it looks like this *will* accept a list of ShardRanges?  This makes more sense to me:\n\n    diff --git a/swift/container/server.py b/swift/container/server.py\n    index 437edf1..a2254c0 100644\n    --- a/swift/container/server.py\n    +++ b/swift/container/server.py\n    @@ -439,9 +439,9 @@ class ContainerController(BaseStorageServer):\n                 shard_ranges \u003d None\n                 if record_type \u003d\u003d RECORD_TYPE_SHARD_NODE:\n                     try:\n    -                    shard_ranges \u003d json.loads(req.body)\n                         # validate incoming data...\n    -                    [ShardRange.from_dict(sr) for sr in shard_ranges]\n    +                    shard_ranges \u003d [ShardRange.from_dict(sr)\n    +                                    for sr in json.loads(req.body)]\n                     except (ValueError, KeyError) as err:\n                         return HTTPBadRequest(\u0027Invalid body: %r\u0027 % err)","commit_id":"6c6a1415143d86211596d2101c5d1159f5240e14"}],"swift/container/sharder.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a1c1259e367874df5b0d0c7e8e9771ccb558bed3","unresolved":false,"context_lines":[{"line_number":797,"context_line":"                \u0027Failed to put shard shard ranges to %s:%s/%s: %s\u0027,"},{"line_number":798,"context_line":"                node[\u0027ip\u0027], node[\u0027port\u0027], node[\u0027device\u0027], err.http_status)"},{"line_number":799,"context_line":"            return False"},{"line_number":800,"context_line":"        return True"},{"line_number":801,"context_line":""},{"line_number":802,"context_line":"    def _update_shard_ranges(self, account, container, shard_ranges,"},{"line_number":803,"context_line":"                             headers\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_59d1432f","line":800,"updated":"2018-03-17 00:58:47.000000000","message":"this is nice and quick","commit_id":"6c6a1415143d86211596d2101c5d1159f5240e14"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a1c1259e367874df5b0d0c7e8e9771ccb558bed3","unresolved":false,"context_lines":[{"line_number":812,"context_line":""},{"line_number":813,"context_line":"        for node in nodes:"},{"line_number":814,"context_line":"            self.cpool.spawn(self._put_container, node, part, account,"},{"line_number":815,"context_line":"                             container, headers, body)"},{"line_number":816,"context_line":""},{"line_number":817,"context_line":"        results \u003d self.cpool.waitall(None)"},{"line_number":818,"context_line":"        return sum(results) \u003e\u003d quorum_size(self.ring.replica_count)"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_d9cd5387","line":815,"updated":"2018-03-17 00:58:47.000000000","message":"IME, the direct_client functions are particularlly sanitary with the headers dicts you pass ing... I guess it ends up being not a big deal, but giving multiple greenthreads access to the same headers dict could have each one updating it independently... but in this case we explicitly set timestamp, content-length, user-agent - so I think it\u0027s fine.","commit_id":"6c6a1415143d86211596d2101c5d1159f5240e14"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"9a86620cde8130db6916e0cd2f166a4795208705","unresolved":false,"context_lines":[{"line_number":812,"context_line":""},{"line_number":813,"context_line":"        for node in nodes:"},{"line_number":814,"context_line":"            self.cpool.spawn(self._put_container, node, part, account,"},{"line_number":815,"context_line":"                             container, headers, body)"},{"line_number":816,"context_line":""},{"line_number":817,"context_line":"        results \u003d self.cpool.waitall(None)"},{"line_number":818,"context_line":"        return sum(results) \u003e\u003d quorum_size(self.ring.replica_count)"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_264451b7","line":815,"in_reply_to":"df7087c5_d9cd5387","updated":"2018-03-19 09:48:31.000000000","message":"the direct client function makes a copy of the headers dict, but yeah I guess it might be prudent to make copies here anyway to defend against any regression.","commit_id":"6c6a1415143d86211596d2101c5d1159f5240e14"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a1c1259e367874df5b0d0c7e8e9771ccb558bed3","unresolved":false,"context_lines":[{"line_number":815,"context_line":"                             container, headers, body)"},{"line_number":816,"context_line":""},{"line_number":817,"context_line":"        results \u003d self.cpool.waitall(None)"},{"line_number":818,"context_line":"        return sum(results) \u003e\u003d quorum_size(self.ring.replica_count)"},{"line_number":819,"context_line":""},{"line_number":820,"context_line":"    @staticmethod"},{"line_number":821,"context_line":"    def check_complete_ranges(ranges):"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_99003bae","line":818,"updated":"2018-03-17 00:58:47.000000000","message":"is sum the idiomatic way to write results.count(True) ???\n\n    In [1]: sum([True, False, True])\n    Out[1]: 2","commit_id":"6c6a1415143d86211596d2101c5d1159f5240e14"}],"swift/proxy/controllers/container.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a1c1259e367874df5b0d0c7e8e9771ccb558bed3","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        ai \u003d self.account_info(self.account_name, req)"},{"line_number":91,"context_line":"        auto_account \u003d self.account_name.startswith("},{"line_number":92,"context_line":"            self.app.auto_create_account_prefix)"},{"line_number":93,"context_line":"        if not auto_account and not ai[1]:"},{"line_number":94,"context_line":"            if \u0027swift.authorize\u0027 in req.environ:"},{"line_number":95,"context_line":"                aresp \u003d req.environ[\u0027swift.authorize\u0027](req)"},{"line_number":96,"context_line":"                if aresp:"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_b9689f87","line":93,"updated":"2018-03-17 00:58:47.000000000","message":"this is a great idea.\n\nI find the boolean equivalent more readable:\n\n    diff --git a/swift/proxy/controllers/container.py b/swift/proxy/controllers/container.py\n    index 9e467a3..8ea3f9e 100644\n    --- a/swift/proxy/controllers/container.py\n    +++ b/swift/proxy/controllers/container.py\n    @@ -90,7 +90,7 @@ class ContainerController(Controller):\n             ai \u003d self.account_info(self.account_name, req)\n             auto_account \u003d self.account_name.startswith(\n                 self.app.auto_create_account_prefix)\n    -        if not auto_account and not ai[1]:\n    +        if not (auto_account or ai[1]):\n                 if \u0027swift.authorize\u0027 in req.environ:\n                     aresp \u003d req.environ[\u0027swift.authorize\u0027](req)\n                     if aresp:","commit_id":"6c6a1415143d86211596d2101c5d1159f5240e14"}],"test/unit/proxy/test_server.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a1c1259e367874df5b0d0c7e8e9771ccb558bed3","unresolved":false,"context_lines":[{"line_number":8476,"context_line":"            req \u003d Request.blank(\u0027/v1/a/c\u0027)"},{"line_number":8477,"context_line":"            self.app.update_request(req)"},{"line_number":8478,"context_line":"            res \u003d controller.GET(req)"},{"line_number":8479,"context_line":"            self.assertEqual(res.status_int, 204)"},{"line_number":8480,"context_line":"            ic \u003d res.environ[\u0027swift.infocache\u0027]"},{"line_number":8481,"context_line":"            self.assertEqual(ic[\u0027container/.a/c\u0027][\u0027status\u0027], 204)"},{"line_number":8482,"context_line":"            self.assertEqual(res.content_length, 0)"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_ed53ad6b","line":8479,"updated":"2018-03-17 00:58:47.000000000","message":"this one fails good with the auto create fix reverted","commit_id":"6c6a1415143d86211596d2101c5d1159f5240e14"}]}
