)]}'
{"ceilometer/objectstore/swift_middleware.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"1e3cd3e4a8ba87e75ef2d53738d0f210de5cfa6a","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                while not chunk:"},{"line_number":99,"context_line":"                    chunk \u003d iterator.next()"},{"line_number":100,"context_line":"            except StopIteration:"},{"line_number":101,"context_line":"                chunk \u003d \u0027\u0027"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"            if start_response_args[0]:"},{"line_number":104,"context_line":"                start_response(*start_response_args[0])"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_351a647d","line":101,"updated":"2014-06-04 08:10:26.000000000","message":"Is the purpose of the try-except block simply remove the initial null chunks from the iterable?\n\nCould this be done some simply with a filter(), or generator expression instead?\n\ne.g.\n\n  (i for i in iterable if i is not None)\n\nThat alternative approach would also remove all null chunks, not just leading chunks. Or is that case guaranteed never to arise, in which case we\u0027d want to delay retrieving the subsequent non-None elements of the iterable.","commit_id":"4d99f95c4d6eaa2a615bc5c36c7d10eb3bfb86a3"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"13fe62511a6ede9f5e1d15d7c084b373f95777a8","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                while not chunk:"},{"line_number":99,"context_line":"                    chunk \u003d iterator.next()"},{"line_number":100,"context_line":"            except StopIteration:"},{"line_number":101,"context_line":"                chunk \u003d \u0027\u0027"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"            if start_response_args[0]:"},{"line_number":104,"context_line":"                start_response(*start_response_args[0])"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_a30c7e3c","line":101,"in_reply_to":"1ae5cdf2_351a647d","updated":"2014-06-04 15:51:50.000000000","message":"I have pickup the logic from an other swift middleware (it counts bytes too):  \n\nhttp://git.openstack.org/cgit/openstack/swift/tree/swift/common/middleware/proxy_logging.py#n243\n\nWe cannot read the whole response, it can be a list or a iterator and it can be really really big in case of an iterator.","commit_id":"4d99f95c4d6eaa2a615bc5c36c7d10eb3bfb86a3"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"abaa4b26b6d8db0c0c76d60025a3971bb9e98ca1","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                while not chunk:"},{"line_number":99,"context_line":"                    chunk \u003d iterator.next()"},{"line_number":100,"context_line":"            except StopIteration:"},{"line_number":101,"context_line":"                chunk \u003d \u0027\u0027"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"            if start_response_args[0]:"},{"line_number":104,"context_line":"                start_response(*start_response_args[0])"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_11586555","line":101,"in_reply_to":"1ae5cdf2_a30c7e3c","updated":"2014-06-10 10:07:21.000000000","message":"Makes sense.","commit_id":"4d99f95c4d6eaa2a615bc5c36c7d10eb3bfb86a3"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"1e3cd3e4a8ba87e75ef2d53738d0f210de5cfa6a","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                start_response(*start_response_args[0])"},{"line_number":105,"context_line":"            bytes_sent \u003d 0"},{"line_number":106,"context_line":"            try:"},{"line_number":107,"context_line":"                while chunk:"},{"line_number":108,"context_line":"                    bytes_sent +\u003d len(chunk)"},{"line_number":109,"context_line":"                    yield chunk"},{"line_number":110,"context_line":"                    chunk \u003d iterator.next()"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_b8de696b","line":107,"updated":"2014-06-04 08:10:26.000000000","message":"Would None be a more obvious sentinel value that an empty string in line 101?","commit_id":"4d99f95c4d6eaa2a615bc5c36c7d10eb3bfb86a3"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"abaa4b26b6d8db0c0c76d60025a3971bb9e98ca1","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                start_response(*start_response_args[0])"},{"line_number":105,"context_line":"            bytes_sent \u003d 0"},{"line_number":106,"context_line":"            try:"},{"line_number":107,"context_line":"                while chunk:"},{"line_number":108,"context_line":"                    bytes_sent +\u003d len(chunk)"},{"line_number":109,"context_line":"                    yield chunk"},{"line_number":110,"context_line":"                    chunk \u003d iterator.next()"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_d15d1d4a","line":107,"in_reply_to":"1ae5cdf2_150b962a","updated":"2014-06-10 10:07:21.000000000","message":"Make sense.","commit_id":"4d99f95c4d6eaa2a615bc5c36c7d10eb3bfb86a3"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"13fe62511a6ede9f5e1d15d7c084b373f95777a8","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                start_response(*start_response_args[0])"},{"line_number":105,"context_line":"            bytes_sent \u003d 0"},{"line_number":106,"context_line":"            try:"},{"line_number":107,"context_line":"                while chunk:"},{"line_number":108,"context_line":"                    bytes_sent +\u003d len(chunk)"},{"line_number":109,"context_line":"                    yield chunk"},{"line_number":110,"context_line":"                    chunk \u003d iterator.next()"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_150b962a","line":107,"in_reply_to":"1ae5cdf2_b8de696b","updated":"2014-06-04 15:51:50.000000000","message":"I prefer have the same behavior as other swift middleware.","commit_id":"4d99f95c4d6eaa2a615bc5c36c7d10eb3bfb86a3"}],"ceilometer/tests/objectstore/test_swift_middleware.py":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"9bede921067c25163f07bdbe13e636f44ed207e3","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.body \u003d body"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __call__(self, env, start_response):"},{"line_number":44,"context_line":"        yield"},{"line_number":45,"context_line":"        start_response(\u0027200 OK\u0027, ["},{"line_number":46,"context_line":"            (\u0027Content-Type\u0027, \u0027text/plain\u0027),"},{"line_number":47,"context_line":"            (\u0027Content-Length\u0027, str(sum(map(len, self.body))))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_3a171fa5","line":44,"updated":"2014-06-09 14:13:17.000000000","message":"out of curiosity, what\u0027s the point of adding yield here and switching to yield below?","commit_id":"4d99f95c4d6eaa2a615bc5c36c7d10eb3bfb86a3"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"9b8c151e961901ce3f689c92814b0f2ef68958a4","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.body \u003d body"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __call__(self, env, start_response):"},{"line_number":44,"context_line":"        yield"},{"line_number":45,"context_line":"        start_response(\u0027200 OK\u0027, ["},{"line_number":46,"context_line":"            (\u0027Content-Type\u0027, \u0027text/plain\u0027),"},{"line_number":47,"context_line":"            (\u0027Content-Length\u0027, str(sum(map(len, self.body))))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_aed4b0bd","line":44,"in_reply_to":"1ae5cdf2_3a171fa5","updated":"2014-06-10 09:33:32.000000000","message":"The real swift app, can return a list or iterator, the issue only occurs with iterator.\nThe iteration of the iterator of the real swift app needs to be started to have  start_response working correcly. So I have do that to simulate this behavior.","commit_id":"4d99f95c4d6eaa2a615bc5c36c7d10eb3bfb86a3"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"e5b830ca57374a3f90b4cecb1a482570ac50921b","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.body \u003d body"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __call__(self, env, start_response):"},{"line_number":44,"context_line":"        yield"},{"line_number":45,"context_line":"        start_response(\u0027200 OK\u0027, ["},{"line_number":46,"context_line":"            (\u0027Content-Type\u0027, \u0027text/plain\u0027),"},{"line_number":47,"context_line":"            (\u0027Content-Length\u0027, str(sum(map(len, self.body))))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_8b617d3b","line":44,"in_reply_to":"1ae5cdf2_aed4b0bd","updated":"2014-06-11 03:40:20.000000000","message":"It would be better to put those in code comment to help others understand","commit_id":"4d99f95c4d6eaa2a615bc5c36c7d10eb3bfb86a3"}]}
