)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16896,"name":"Ondřej Nový","email":"novy@ondrej.org","username":"onovy"},"change_message_id":"87234a225ffc98eac8b78565ba75ab8f2813dec0","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Kazuhiro MIYAHARA \u003cmiyahara.kazuhiro@lab.ntt.co.jp\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-17 16:50:56 +0900"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix disparsion-reports error message"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch fixes Swift to show message"},{"line_number":10,"context_line":"\"No objects to query. Has swift-dispersion-populate been run?\""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa1b9901_6fce3185","line":7,"updated":"2015-08-17 12:56:00.000000000","message":"typo /disparsion/dispersion/","commit_id":"2a640cef2b8e427218744d64e705bfe75ef29719"},{"author":{"_account_id":14766,"name":"Kazuhiro MIYAHARA","email":"miyahara.kazuhiro@lab.ntt.co.jp","username":"miyahara"},"change_message_id":"85d74d2886cc28d3295859e85d01e467fb469630","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Kazuhiro MIYAHARA \u003cmiyahara.kazuhiro@lab.ntt.co.jp\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-17 16:50:56 +0900"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix disparsion-reports error message"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch fixes Swift to show message"},{"line_number":10,"context_line":"\"No objects to query. Has swift-dispersion-populate been run?\""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa1b9901_23b2b4e5","line":7,"in_reply_to":"fa1b9901_6fce3185","updated":"2015-08-21 08:43:37.000000000","message":"Thank you for your comment.\n\nI will correct the typo.","commit_id":"2a640cef2b8e427218744d64e705bfe75ef29719"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"5f0df15155c0cd868183c16c16e022e91b6e32cf","unresolved":false,"context_lines":[{"line_number":10,"context_line":"\"No objects to query. Has swift-dispersion-populate been run?\""},{"line_number":11,"context_line":"for \"swift-dispersion-report —object-only”"},{"line_number":12,"context_line":"with no container for object dispersion."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I82da56709cfc296a27f5180681709bc56adbc13d"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa1b9901_7d31eca1","line":13,"updated":"2015-08-18 02:46:03.000000000","message":"Could you please add a \"Closes-Bug: #1468120\" sentence around here to link launchpad bug report?","commit_id":"2a640cef2b8e427218744d64e705bfe75ef29719"},{"author":{"_account_id":14766,"name":"Kazuhiro MIYAHARA","email":"miyahara.kazuhiro@lab.ntt.co.jp","username":"miyahara"},"change_message_id":"85d74d2886cc28d3295859e85d01e467fb469630","unresolved":false,"context_lines":[{"line_number":10,"context_line":"\"No objects to query. Has swift-dispersion-populate been run?\""},{"line_number":11,"context_line":"for \"swift-dispersion-report —object-only”"},{"line_number":12,"context_line":"with no container for object dispersion."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I82da56709cfc296a27f5180681709bc56adbc13d"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa1b9901_3594d589","line":13,"in_reply_to":"fa1b9901_7d31eca1","updated":"2015-08-21 08:43:37.000000000","message":"Thank you for your comment.\n\nI will add the link","commit_id":"2a640cef2b8e427218744d64e705bfe75ef29719"}],"bin/swift-dispersion-report":[{"author":{"_account_id":12193,"name":"Hisashi Osanai","email":"osanai.hisashi@jp.fujitsu.com","username":"ho"},"change_message_id":"bbbe09df8dfcac59b170fc5be82e96d150a3e5d1","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                container, prefix\u003d\u0027dispersion_\u0027, full_listing\u003dTrue)[1]]"},{"line_number":179,"context_line":"        except Exception as err:"},{"line_number":180,"context_line":"            if \u0027http_status\u0027 in err and err.http_status !\u003d 404:"},{"line_number":181,"context_line":"                raise"},{"line_number":182,"context_line":"            print \u003e\u003estderr, \u0027No objects to query. Has \u0027 \\"},{"line_number":183,"context_line":"                            \u0027swift-dispersion-populate been run?\u0027"},{"line_number":184,"context_line":"            stderr.flush()"}],"source_content_type":"application/octet-stream","patch_set":8,"id":"fa1b9901_cd2b69ea","line":181,"updated":"2015-08-25 03:02:21.000000000","message":"this is a command so it\u0027s better to output log and return(or exit) here. otherwise we might get another Traceback.","commit_id":"d42627ed7888061f5220d624b8540a76c7fee4a0"},{"author":{"_account_id":14766,"name":"Kazuhiro MIYAHARA","email":"miyahara.kazuhiro@lab.ntt.co.jp","username":"miyahara"},"change_message_id":"107eb47eeaf590d8cdfa1310b6ab9b30e8caac5c","unresolved":false,"context_lines":[{"line_number":182,"context_line":"                                \u0027swift-dispersion-populate been run?\u0027"},{"line_number":183,"context_line":"                stderr.flush()"},{"line_number":184,"context_line":"            else:"},{"line_number":185,"context_line":"                raise"},{"line_number":186,"context_line":"            return"},{"line_number":187,"context_line":"    objects_listed \u003d len(objects)"},{"line_number":188,"context_line":"    if not objects_listed:"}],"source_content_type":"application/octet-stream","patch_set":9,"id":"fa1b9901_3bfed16b","line":185,"updated":"2015-08-25 10:24:53.000000000","message":"Expected exception is only ClientException with 404 status.\nSo, in other cases, err raised to get Traceback.","commit_id":"c5a299aae5a482af96af7b672909c41af5153a31"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"71b81ea185cc27e8d2ca55d6c575e6f838800ebb","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                container, prefix\u003d\u0027dispersion_\u0027, full_listing\u003dTrue)[1]]"},{"line_number":180,"context_line":"        except urllib2.HTTPError as err:"},{"line_number":181,"context_line":"            if err.getcode() !\u003d 404:"},{"line_number":182,"context_line":"                raise err"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"            print \u003e\u003estderr, \u0027No objects to query. Has \u0027 \\"},{"line_number":185,"context_line":"                            \u0027swift-dispersion-populate been run?\u0027"}],"source_content_type":"application/octet-stream","patch_set":10,"id":"da20952f_8654bdca","line":182,"updated":"2015-09-01 22:19:41.000000000","message":"Re-raising like this loses the traceback, but a bare \"raise\" keeps it.","commit_id":"c690bcb68331818a04c94741b25f40cc40f7b3c4"},{"author":{"_account_id":14766,"name":"Kazuhiro MIYAHARA","email":"miyahara.kazuhiro@lab.ntt.co.jp","username":"miyahara"},"change_message_id":"9493b3bf2c4a142c18d15b4ab53b9947c7b53b7f","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                container, prefix\u003d\u0027dispersion_\u0027, full_listing\u003dTrue)[1]]"},{"line_number":180,"context_line":"        except urllib2.HTTPError as err:"},{"line_number":181,"context_line":"            if err.getcode() !\u003d 404:"},{"line_number":182,"context_line":"                raise err"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"            print \u003e\u003estderr, \u0027No objects to query. Has \u0027 \\"},{"line_number":185,"context_line":"                            \u0027swift-dispersion-populate been run?\u0027"}],"source_content_type":"application/octet-stream","patch_set":10,"id":"da20952f_9bbe4fd3","line":182,"in_reply_to":"da20952f_8654bdca","updated":"2015-09-02 02:04:06.000000000","message":"Thank you for your review and patch !","commit_id":"c690bcb68331818a04c94741b25f40cc40f7b3c4"}],"swift/common/internal_client.py":[{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"5f0df15155c0cd868183c16c16e022e91b6e32cf","unresolved":false,"context_lines":[{"line_number":814,"context_line":"                                              http_status\u003derr.getcode())"},{"line_number":815,"context_line":"                    else:"},{"line_number":816,"context_line":"                        raise ClientException(\"request failed %d times\""},{"line_number":817,"context_line":"                                              % retries)"},{"line_number":818,"context_line":"            sleep(backoff)"},{"line_number":819,"context_line":"            backoff \u003d min(backoff * 2, self.max_backoff)"},{"line_number":820,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_5d3748b0","line":817,"updated":"2015-08-18 02:46:03.000000000","message":"To save original behavior, I\u0027d like to catch just a HTTPError here and any other error should be raised up as it is.\n\ne.g.\n if isinstance(err, urllib2.HTTPError):\n      raise ClientException(\"request faild %d times\" % retries,\n                                   http_status\u003derr.getcode())\n else:\n      raise err\n\nThat is because ClientException might hide actual exception reason and traceback from the caller.","commit_id":"2a640cef2b8e427218744d64e705bfe75ef29719"},{"author":{"_account_id":14766,"name":"Kazuhiro MIYAHARA","email":"miyahara.kazuhiro@lab.ntt.co.jp","username":"miyahara"},"change_message_id":"85d74d2886cc28d3295859e85d01e467fb469630","unresolved":false,"context_lines":[{"line_number":814,"context_line":"                                              http_status\u003derr.getcode())"},{"line_number":815,"context_line":"                    else:"},{"line_number":816,"context_line":"                        raise ClientException(\"request failed %d times\""},{"line_number":817,"context_line":"                                              % retries)"},{"line_number":818,"context_line":"            sleep(backoff)"},{"line_number":819,"context_line":"            backoff \u003d min(backoff * 2, self.max_backoff)"},{"line_number":820,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_c6b6f189","line":817,"in_reply_to":"fa1b9901_5d3748b0","updated":"2015-08-21 08:43:37.000000000","message":"Thank you for your comment.\n\nI will correct the error handling code.","commit_id":"2a640cef2b8e427218744d64e705bfe75ef29719"},{"author":{"_account_id":12193,"name":"Hisashi Osanai","email":"osanai.hisashi@jp.fujitsu.com","username":"ho"},"change_message_id":"fd79727af6f303e63811d0204c4b211cac88a1d2","unresolved":false,"context_lines":[{"line_number":806,"context_line":"            try:"},{"line_number":807,"context_line":"                return self.base_request(method, **kwargs)"},{"line_number":808,"context_line":"            except (socket.error, httplib.HTTPException,"},{"line_number":809,"context_line":"                    urllib2.URLError) as err:"},{"line_number":810,"context_line":"                if self.attempts \u003e retries:"},{"line_number":811,"context_line":"                    if isinstance(err, urllib2.HTTPError):"},{"line_number":812,"context_line":"                        raise ClientException(\"request failed %d times\""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa1b9901_ccebf2da","line":809,"updated":"2015-08-21 05:52:38.000000000","message":"for my explanation I change the logic here:\ntry:\n    return self.base_request(method, **kwargs)\nexcept urllib2.HTTPError as err:\n    if self.attempts \u003e retries: (*1)\n        raise ClientException(\"request failed %d times\"\n                                      % retries,\n                                      http_status\u003derr.getcode())\nexcept (socket.error, httplib.HTTPException, urllib2.URLError) as err:\n    if self.attempts \u003e retries:\n        raise err (*2)\n\n(*1) When urllib2.HTTPError is caught and the code is 404,\n      there is not necessary to retry there. \n\n(*2) If (*1) is only case for \"there is no object\", the exceptions raises here but in object_dispersion_report can not handle them.\n\nIn the common library, we don\u0027t want to deal with dedicated error no but if we fix (*1), the code looks like following:\nexcept urllib2.HTTPError as err:\n    if err.code \u003d\u003d 404:\n        raise ClientException(\"request failed\",\n                                       http_status\u003derr.getcode())\n    else:\n        if self.attempts \u003e retries:\n            raise\nexcept (socket.error, httplib.HTTPException, urllib2.URLError):\n        if self.attempts \u003e retries:\n            raise\n\nMy *main* concern is ClientException is not used in this root and in (*2) case if there is a case, HTTPException with 404, the patch doesn\u0027t work. So I wrote the comment. my image is: \n\nhttp://paste.openstack.org/show/423140/","commit_id":"8853f9a4f2740b65918948cd0d9e20e189dcfa98"},{"author":{"_account_id":14766,"name":"Kazuhiro MIYAHARA","email":"miyahara.kazuhiro@lab.ntt.co.jp","username":"miyahara"},"change_message_id":"45188cf4ec7c49b7a69396c49d0001c7ba5f3fde","unresolved":false,"context_lines":[{"line_number":806,"context_line":"            try:"},{"line_number":807,"context_line":"                return self.base_request(method, **kwargs)"},{"line_number":808,"context_line":"            except (socket.error, httplib.HTTPException,"},{"line_number":809,"context_line":"                    urllib2.URLError) as err:"},{"line_number":810,"context_line":"                if self.attempts \u003e retries:"},{"line_number":811,"context_line":"                    if isinstance(err, urllib2.HTTPError):"},{"line_number":812,"context_line":"                        raise ClientException(\"request failed %d times\""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa1b9901_c34e583a","line":809,"in_reply_to":"fa1b9901_ccebf2da","updated":"2015-08-21 08:47:02.000000000","message":"Thank you for your comment.\n\nI agree to your proposal.\n\nAnd I will update my patch set.","commit_id":"8853f9a4f2740b65918948cd0d9e20e189dcfa98"},{"author":{"_account_id":12193,"name":"Hisashi Osanai","email":"osanai.hisashi@jp.fujitsu.com","username":"ho"},"change_message_id":"bbbe09df8dfcac59b170fc5be82e96d150a3e5d1","unresolved":false,"context_lines":[{"line_number":812,"context_line":"                                          http_status\u003dhttp_status)"},{"line_number":813,"context_line":"                else:"},{"line_number":814,"context_line":"                    if self.attempts \u003e retries:"},{"line_number":815,"context_line":"                        raise"},{"line_number":816,"context_line":"            except (socket.error, httplib.HTTPException, urllib2.URLError):"},{"line_number":817,"context_line":"                if self.attempts \u003e retries:"},{"line_number":818,"context_line":"                    raise"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_6dc6dd4a","line":815,"updated":"2015-08-25 03:02:21.000000000","message":"I prefer to use ClientException here. because the exception is already handled so it\u0027s better to wrap here.","commit_id":"d42627ed7888061f5220d624b8540a76c7fee4a0"},{"author":{"_account_id":14766,"name":"Kazuhiro MIYAHARA","email":"miyahara.kazuhiro@lab.ntt.co.jp","username":"miyahara"},"change_message_id":"107eb47eeaf590d8cdfa1310b6ab9b30e8caac5c","unresolved":false,"context_lines":[{"line_number":812,"context_line":"                    # class information will be broken in some caller method."},{"line_number":813,"context_line":"                    # e.g. object_dispersion_report method"},{"line_number":814,"context_line":"                    # in bin/swift-dispersion-report."},{"line_number":815,"context_line":"                    if isinstance(err, urllib2.HTTPError):"},{"line_number":816,"context_line":"                        http_status \u003d err.getcode()"},{"line_number":817,"context_line":"                        raise ClientException(\"request failed\","},{"line_number":818,"context_line":"                                              http_status\u003dhttp_status)"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_5b470577","line":815,"updated":"2015-08-25 10:24:53.000000000","message":"If err is instance of urllib2.HTTPError and it is raised, err\u0027s class information will be broken in object_dispersion_report method in bin/swift-dispersion-report (because of urllib2\u0027s bug?).\nTherefore, the code raises ClientException instead of err.\n\nIn other cases, the code raises err as it is in order to get err\u0027s information.","commit_id":"c5a299aae5a482af96af7b672909c41af5153a31"}],"test/unit/common/test_internal_client.py":[{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"cee909c1e7539430317cf55076da578fb9199399","unresolved":false,"context_lines":[{"line_number":1646,"context_line":"        with mock.patch(\u0027swift.common.internal_client.sleep\u0027) as mock_sleep:"},{"line_number":1647,"context_line":"            self.assertRaises(ClientException,"},{"line_number":1648,"context_line":"                              c.retry_request, \u0027HEAD\u0027, container\u003d\u0027con\u0027,"},{"line_number":1649,"context_line":"                              retries\u003d1)"},{"line_number":1650,"context_line":"        self.assertEqual(mock_sleep.call_count, 0)"},{"line_number":1651,"context_line":"        self.assertEqual(mock_urlopen.call_count, 1)"},{"line_number":1652,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa1b9901_d2c92f27","line":1649,"updated":"2015-08-21 20:31:29.000000000","message":"A method could be created to capture the duplicate code in these tests so that each case could simply pass in the different request method.\n\nFor example, there are several where the only difference is the request method.  So there could be one method that several test cases call, but they pass in the request method as an argument.","commit_id":"d3af72dc55aa3bcfdf05f53c53febe09696358bb"},{"author":{"_account_id":14766,"name":"Kazuhiro MIYAHARA","email":"miyahara.kazuhiro@lab.ntt.co.jp","username":"miyahara"},"change_message_id":"d4c5eee7c589979dcd3f95a63d093e55ad82ca53","unresolved":false,"context_lines":[{"line_number":1646,"context_line":"        with mock.patch(\u0027swift.common.internal_client.sleep\u0027) as mock_sleep:"},{"line_number":1647,"context_line":"            self.assertRaises(ClientException,"},{"line_number":1648,"context_line":"                              c.retry_request, \u0027HEAD\u0027, container\u003d\u0027con\u0027,"},{"line_number":1649,"context_line":"                              retries\u003d1)"},{"line_number":1650,"context_line":"        self.assertEqual(mock_sleep.call_count, 0)"},{"line_number":1651,"context_line":"        self.assertEqual(mock_urlopen.call_count, 1)"},{"line_number":1652,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa1b9901_8c7dace9","line":1649,"in_reply_to":"fa1b9901_d2c92f27","updated":"2015-08-24 01:22:01.000000000","message":"Thank you for your comment.\n\nI will correct these tests.","commit_id":"d3af72dc55aa3bcfdf05f53c53febe09696358bb"}]}
