)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"58975492f02b2a00dc1c4be081fcb8f3b76f80ec","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     zhangchunlong1@huawei.com \u003czhangchunlong1@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-09-23 19:54:21 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"check the configuration item num_retries"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"we need to to check the value of the configuration item num_retries in the"},{"line_number":10,"context_line":"code in order to ensure the \"num_retries \" equal or bigger than 0 , done"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"da9df570_4c619738","line":7,"updated":"2014-09-23 12:34:19.000000000","message":"Can you add a prefix for the commit title? like:\n\n  glance: add a better coverage for num_retries\u0027s option","commit_id":"14ac224ac6976b0aba78c4e30215dc8193b6f907"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"58975492f02b2a00dc1c4be081fcb8f3b76f80ec","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"check the configuration item num_retries"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"we need to to check the value of the configuration item num_retries in the"},{"line_number":10,"context_line":"code in order to ensure the \"num_retries \" equal or bigger than 0 , done"},{"line_number":11,"context_line":"like that the configuration item network_allocate_retries"},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"da9df570_8c5b7f86","line":9,"updated":"2014-09-23 12:34:19.000000000","message":"Ensures that the glance num_retries\u0027s option is equal or bigger than zero.","commit_id":"14ac224ac6976b0aba78c4e30215dc8193b6f907"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"58975492f02b2a00dc1c4be081fcb8f3b76f80ec","unresolved":false,"context_lines":[{"line_number":10,"context_line":"code in order to ensure the \"num_retries \" equal or bigger than 0 , done"},{"line_number":11,"context_line":"like that the configuration item network_allocate_retries"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I6a8fd8a2fe7e4b105aaaab8af8be250d9b0f9056"},{"line_number":14,"context_line":"Closes-Bug: #1372426"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"da9df570_cc54a756","line":13,"updated":"2014-09-23 12:34:19.000000000","message":"Change-Id should be at the very end of the commit message.","commit_id":"14ac224ac6976b0aba78c4e30215dc8193b6f907"},{"author":{"_account_id":6763,"name":"jingliuqing","email":"jing.liuqing@99cloud.net","username":"jing"},"change_message_id":"ddbea6ee9254958fcbbbd47de2cbf81b2e17ad32","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     zhangchunlong1@huawei.com \u003czhangchunlong1@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-12-09 20:15:43 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"glance:check the num_retries\u0027option"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Ensure that the glance num_retries\u0027s option is equal or bigger than 0 , done"},{"line_number":10,"context_line":"like that the configuration item network_allocate_retries"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"3a961159_18f1386b","line":7,"updated":"2014-12-11 13:23:30.000000000","message":"num_retries\u0027option -\u003enum_retries option","commit_id":"02e191e614e21f535c6d5e7dc54b59cf75a4e3c3"},{"author":{"_account_id":6763,"name":"jingliuqing","email":"jing.liuqing@99cloud.net","username":"jing"},"change_message_id":"ddbea6ee9254958fcbbbd47de2cbf81b2e17ad32","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"glance:check the num_retries\u0027option"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Ensure that the glance num_retries\u0027s option is equal or bigger than 0 , done"},{"line_number":10,"context_line":"like that the configuration item network_allocate_retries"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Closes-Bug: #1372426"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"3a961159_58e740ac","line":9,"updated":"2014-12-11 13:23:30.000000000","message":"num_retries\u0027option -\u003enum_retries option","commit_id":"02e191e614e21f535c6d5e7dc54b59cf75a4e3c3"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"6b17dc94c851643cb6917b49548612be3e6b765a","unresolved":false,"context_lines":[{"line_number":7,"context_line":"glance:check the num_retries\u0027option"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Ensure that the glance num_retries\u0027s option is equal or bigger than 0 , done"},{"line_number":10,"context_line":"like that the configuration item network_allocate_retries"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Closes-Bug: #1372426"},{"line_number":13,"context_line":"Change-Id: I6a8fd8a2fe7e4b105aaaab8af8be250d9b0f9056"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"3a961159_d2915948","line":10,"updated":"2014-12-11 06:52:18.000000000","message":"you added \nglance_num_retries\nin the code , I think it\u0027s worthy to mention it","commit_id":"02e191e614e21f535c6d5e7dc54b59cf75a4e3c3"},{"author":{"_account_id":7488,"name":"Jeffrey Zhang","email":"zhang.lei.fly@gmail.com","username":"Jeffrey4l"},"change_message_id":"fb00bad7f914fda756db1f992c8bc0b483ce8987","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Ensure that the glance num_retries option is equal or bigger than 0 ,done"},{"line_number":10,"context_line":"like that the configuration item network_allocate_retries"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Co-Authored-By:Kevin_Zheng\u003czhengzhenyu@huawei.com\u003e"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #1372426"},{"line_number":15,"context_line":"Change-Id: I6a8fd8a2fe7e4b105aaaab8af8be250d9b0f9056"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"fa32b979_f03425e0","line":12,"updated":"2015-06-28 00:52:37.000000000","message":"Extra space is required, see [0]\n\n\u003e We encourage the use of Co-Authored-By: name \u003cname@example.com\u003e in commit messages to indicate people who worked on a particular patch. It\u0027s a convention for recognizing multiple authors, and our projects would encourage the stats tools to observe it when collecting statistics.\n\nThe expected format should be \n\nCo-Authored-By: Kevin_Zheng \u003czhengzhenyu@huawei.com\u003e\n\n[0] https://wiki.openstack.org/wiki/GitCommitMessages","commit_id":"454dd6d47aaf917381abec6e8fb2b82087aa6bdf"},{"author":{"_account_id":12898,"name":"Tony Breeds","email":"tony@bakeyournoodle.com","username":"tonyb"},"change_message_id":"0fecf51e95a8ac6373719bb4d0717839abd3085c","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Kevin_Zheng \u003czhengzhenyu@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-07-01 11:49:52 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"glance:check the num_retries option"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Ensure that the glance num_retries option is equal or bigger than 0 ,done"},{"line_number":10,"context_line":"like that the configuration item network_allocate_retries"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"ba3cc151_89647322","line":7,"updated":"2015-07-01 04:25:02.000000000","message":"\"glance: Check the num_retries option\"","commit_id":"d42de6691f828667e7a5d31d18c686d9ed130297"},{"author":{"_account_id":12898,"name":"Tony Breeds","email":"tony@bakeyournoodle.com","username":"tonyb"},"change_message_id":"0fecf51e95a8ac6373719bb4d0717839abd3085c","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"glance:check the num_retries option"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Ensure that the glance num_retries option is equal or bigger than 0 ,done"},{"line_number":10,"context_line":"like that the configuration item network_allocate_retries"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Co-Authored-By:Kevin_Zheng\u003czhengzhenyu@huawei.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"ba3cc151_e97dffb1","line":9,"updated":"2015-07-01 04:25:02.000000000","message":"\"Ensure that the glance num_retries option is equal or bigger than 0, done\"","commit_id":"d42de6691f828667e7a5d31d18c686d9ed130297"},{"author":{"_account_id":12898,"name":"Tony Breeds","email":"tony@bakeyournoodle.com","username":"tonyb"},"change_message_id":"0fecf51e95a8ac6373719bb4d0717839abd3085c","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Ensure that the glance num_retries option is equal or bigger than 0 ,done"},{"line_number":10,"context_line":"like that the configuration item network_allocate_retries"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Co-Authored-By:Kevin_Zheng\u003czhengzhenyu@huawei.com\u003e"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #1372426"},{"line_number":15,"context_line":"Change-Id: I6a8fd8a2fe7e4b105aaaab8af8be250d9b0f9056"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"ba3cc151_49450b6e","line":12,"updated":"2015-07-01 04:25:02.000000000","message":"\"Co-Authored-By: Kevin_Zheng \u003czhengzhenyu@huawei.com\u003e\"","commit_id":"d42de6691f828667e7a5d31d18c686d9ed130297"}],"nova/image/glance.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"9d12246803389bfe46e504ac1128595ae82d1856","unresolved":false,"context_lines":[{"line_number":68,"context_line":"               deprecated_group\u003d\u0027DEFAULT\u0027,"},{"line_number":69,"context_line":"               deprecated_name\u003d\u0027glance_api_insecure\u0027),"},{"line_number":70,"context_line":"    cfg.IntOpt(\u0027num_retries\u0027,"},{"line_number":71,"context_line":"               default\u003d0,"},{"line_number":72,"context_line":"               help\u003d\u0027Number of retries when downloading an image from glance\u0027,"},{"line_number":73,"context_line":"               deprecated_group\u003d\u0027DEFAULT\u0027,"},{"line_number":74,"context_line":"               deprecated_name\u003d\u0027glance_num_retries\u0027),"}],"source_content_type":"text/x-python","patch_set":1,"id":"da9df570_c71acb6d","line":71,"updated":"2014-09-23 06:49:16.000000000","message":"It\u0027s better to update this message to say, if the value is \u003c\u003d0 means disable retry.","commit_id":"e7445088c5bfb3e8d0097bef20552127bd95d745"},{"author":{"_account_id":11530,"name":"zhangtralon","email":"ztralon@hotmail.com","username":"zhangtralon"},"change_message_id":"7465513f648270b99a1a7aff115f79fb5aab2204","unresolved":false,"context_lines":[{"line_number":68,"context_line":"               deprecated_group\u003d\u0027DEFAULT\u0027,"},{"line_number":69,"context_line":"               deprecated_name\u003d\u0027glance_api_insecure\u0027),"},{"line_number":70,"context_line":"    cfg.IntOpt(\u0027num_retries\u0027,"},{"line_number":71,"context_line":"               default\u003d0,"},{"line_number":72,"context_line":"               help\u003d\u0027Number of retries when downloading an image from glance\u0027,"},{"line_number":73,"context_line":"               deprecated_group\u003d\u0027DEFAULT\u0027,"},{"line_number":74,"context_line":"               deprecated_name\u003d\u0027glance_num_retries\u0027),"}],"source_content_type":"text/x-python","patch_set":1,"id":"da9df570_897d3171","line":71,"in_reply_to":"da9df570_c71acb6d","updated":"2014-09-23 11:26:57.000000000","message":"yes, it\u0027s a good idea","commit_id":"e7445088c5bfb3e8d0097bef20552127bd95d745"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"58975492f02b2a00dc1c4be081fcb8f3b76f80ec","unresolved":false,"context_lines":[{"line_number":71,"context_line":"               default\u003d0,"},{"line_number":72,"context_line":"               help\u003d\u0027Number of retries when downloading an image from \u0027"},{"line_number":73,"context_line":"                    \u0027glance and num_retries less than or equal to zero\u0027"},{"line_number":74,"context_line":"                    \u0027means disable retry\u0027,"},{"line_number":75,"context_line":"               deprecated_group\u003d\u0027DEFAULT\u0027,"},{"line_number":76,"context_line":"               deprecated_name\u003d\u0027glance_num_retries\u0027),"},{"line_number":77,"context_line":"    cfg.ListOpt(\u0027allowed_direct_url_schemes\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9df570_cc02e73d","line":74,"updated":"2014-09-23 12:34:19.000000000","message":"something like:\n\n..from glance (0 disables retry)\n\ncould be enough","commit_id":"14ac224ac6976b0aba78c4e30215dc8193b6f907"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e615336ab9715ee082ea2cff7a0bb20249841fe3","unresolved":false,"context_lines":[{"line_number":61,"context_line":"               default\u003d0,"},{"line_number":62,"context_line":"               help\u003d\u0027Number of retries when downloading an image from \u0027"},{"line_number":63,"context_line":"                    \u0027glance (0 disables retry)\u0027,"},{"line_number":64,"context_line":"               deprecated_group\u003d\u0027DEFAULT\u0027,"},{"line_number":65,"context_line":"               deprecated_name\u003d\u0027glance_num_retries\u0027),"},{"line_number":66,"context_line":"    cfg.ListOpt(\u0027allowed_direct_url_schemes\u0027,"},{"line_number":67,"context_line":"                default\u003d[],"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_c38b4666","line":64,"updated":"2014-12-11 12:12:50.000000000","message":"we do not need the deprecated group - this code was deprecated in J","commit_id":"02e191e614e21f535c6d5e7dc54b59cf75a4e3c3"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"af548e28ea0ba4d785fa7d1763bd6e0cf0f9201b","unresolved":false,"context_lines":[{"line_number":62,"context_line":"               help\u003d\u0027Number of retries when downloading an image from \u0027"},{"line_number":63,"context_line":"                    \u0027glance (0 disables retry)\u0027,"},{"line_number":64,"context_line":"               deprecated_group\u003d\u0027DEFAULT\u0027,"},{"line_number":65,"context_line":"               deprecated_name\u003d\u0027glance_num_retries\u0027),"},{"line_number":66,"context_line":"    cfg.ListOpt(\u0027allowed_direct_url_schemes\u0027,"},{"line_number":67,"context_line":"                default\u003d[],"},{"line_number":68,"context_line":"                help\u003d\u0027A list of url scheme that can be downloaded directly \u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_03949935","line":65,"updated":"2014-12-10 12:30:49.000000000","message":"I think we doesn\u0027t need deprecated_group for now?","commit_id":"02e191e614e21f535c6d5e7dc54b59cf75a4e3c3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b1b53f236097c06b7f93c2dd7f4a09232649933e","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        retry_excs \u003d (glanceclient.exc.ServiceUnavailable,"},{"line_number":211,"context_line":"                glanceclient.exc.InvalidEndpoint,"},{"line_number":212,"context_line":"                glanceclient.exc.CommunicationError)"},{"line_number":213,"context_line":"        num_attempts \u003d 1 + max(0, CONF.glance.num_retries)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        for attempt in xrange(1, num_attempts + 1):"},{"line_number":216,"context_line":"            client \u003d self.client or self._create_onetime_client(context,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9b358b_ce6514e2","line":213,"updated":"2015-03-30 05:44:36.000000000","message":"num_attempts \u003d max(1, CONF.glance.num_retries)","commit_id":"70e45a65a62791ee4f41f47dfb1d7bf7497c6eba"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"7fc48234dc23ab63d2d5367132f9e059951f618f","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        retry_excs \u003d (glanceclient.exc.ServiceUnavailable,"},{"line_number":211,"context_line":"                glanceclient.exc.InvalidEndpoint,"},{"line_number":212,"context_line":"                glanceclient.exc.CommunicationError)"},{"line_number":213,"context_line":"        num_attempts \u003d 1 + max(0, CONF.glance.num_retries)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        for attempt in xrange(1, num_attempts + 1):"},{"line_number":216,"context_line":"            client \u003d self.client or self._create_onetime_client(context,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a016987_99ad72eb","line":213,"in_reply_to":"da9b358b_ce6514e2","updated":"2015-05-30 02:59:00.000000000","message":"Done","commit_id":"70e45a65a62791ee4f41f47dfb1d7bf7497c6eba"},{"author":{"_account_id":11530,"name":"zhangtralon","email":"ztralon@hotmail.com","username":"zhangtralon"},"change_message_id":"08e5823d467d6ae46e3ddeab85bde678d28d7932","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        retry_excs \u003d (glanceclient.exc.ServiceUnavailable,"},{"line_number":211,"context_line":"                glanceclient.exc.InvalidEndpoint,"},{"line_number":212,"context_line":"                glanceclient.exc.CommunicationError)"},{"line_number":213,"context_line":"        num_attempts \u003d 1 + max(0, CONF.glance.num_retries)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        for attempt in xrange(1, num_attempts + 1):"},{"line_number":216,"context_line":"            client \u003d self.client or self._create_onetime_client(context,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9b358b_f1b08b45","line":213,"in_reply_to":"da9b358b_ce6514e2","updated":"2015-03-31 09:17:06.000000000","message":"num_attempts \u003d max(1, CONF.glance.num_retries) may be not clear for the meaning! thanks","commit_id":"70e45a65a62791ee4f41f47dfb1d7bf7497c6eba"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"366723ac162a451b81f87c27185ba3243a6c4866","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        retry_excs \u003d (glanceclient.exc.ServiceUnavailable,"},{"line_number":211,"context_line":"                glanceclient.exc.InvalidEndpoint,"},{"line_number":212,"context_line":"                glanceclient.exc.CommunicationError)"},{"line_number":213,"context_line":"        num_attempts \u003d 1 + max(0, CONF.glance.num_retries)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        for attempt in xrange(1, num_attempts + 1):"},{"line_number":216,"context_line":"            client \u003d self.client or self._create_onetime_client(context,"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa32b979_4f28d585","line":213,"updated":"2015-06-27 13:09:12.000000000","message":"In the case of network_allocate_retries, we log a warning if the config option value is less than 0:\n\nhttp://git.openstack.org/cgit/openstack/nova/tree/nova/compute/manager.py#n1523\n\nWhy not also do that here since it\u0027s a misconfiguration?  Someone might think that -1 means retry indefinitely, like how -1 is interpreted elsewhere (like with quotas).\n\nSo I\u0027d probably log a warning for retries \u003c 0 like network_allocate_retries.","commit_id":"454dd6d47aaf917381abec6e8fb2b82087aa6bdf"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"366723ac162a451b81f87c27185ba3243a6c4866","unresolved":false,"context_lines":[{"line_number":212,"context_line":"                glanceclient.exc.CommunicationError)"},{"line_number":213,"context_line":"        num_attempts \u003d 1 + max(0, CONF.glance.num_retries)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        for attempt in xrange(1, num_attempts + 1):"},{"line_number":216,"context_line":"            client \u003d self.client or self._create_onetime_client(context,"},{"line_number":217,"context_line":"                                                                version)"},{"line_number":218,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa32b979_8f2edd8a","line":215,"updated":"2015-06-27 13:09:12.000000000","message":"I kind of wonder why we add another 1 to the retry attempts here when 1 is added initially above.  So if glance.num_retries is 3, num_retries above would be 4 and then we\u0027d make it 5 here, which means we\u0027d actually try 4 times rather than the configured 3.  Maybe it\u0027s taken literally as \u0027retries\u0027 so the first pass is the initial attempt and the rest are retries.\n\nI guess network_allocate_retries does the same thing in the compute manager.  I don\u0027t really care either way, just seemed odd at first glance.","commit_id":"454dd6d47aaf917381abec6e8fb2b82087aa6bdf"},{"author":{"_account_id":7488,"name":"Jeffrey Zhang","email":"zhang.lei.fly@gmail.com","username":"Jeffrey4l"},"change_message_id":"aebf47f4aec51f28485726fdf7c4bbce7b3d01c7","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        retries \u003d CONF.glance.num_retries"},{"line_number":214,"context_line":"        if retries \u003c 0:"},{"line_number":215,"context_line":"            LOG.warning(_LW(\"Treating negative config value (%(retries)s) for \""},{"line_number":216,"context_line":"                            \"\u0027create_static_client\u0027 as 0.\"),"},{"line_number":217,"context_line":"                        {\u0027retries\u0027: retries})"},{"line_number":218,"context_line":"            retries \u003d 0"},{"line_number":219,"context_line":"        num_attempts \u003d retries + 1"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba3cc151_20a53ba1","line":216,"updated":"2015-07-01 02:48:14.000000000","message":"The `create_static_client` is improperty.  The OPs has no ideas about that term.\n\nI prefer to use \"xxx for \u0027glance.num_retries\u0027 as 0\"","commit_id":"00aa8fed9716d1037926e943793d09106354e98f"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"bcdedbc185a828488603a093e2eba98868b9d421","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        retries \u003d CONF.glance.num_retries"},{"line_number":214,"context_line":"        if retries \u003c 0:"},{"line_number":215,"context_line":"            LOG.warning(_LW(\"Treating negative config value (%(retries)s) for \""},{"line_number":216,"context_line":"                            \"\u0027create_static_client\u0027 as 0.\"),"},{"line_number":217,"context_line":"                        {\u0027retries\u0027: retries})"},{"line_number":218,"context_line":"            retries \u003d 0"},{"line_number":219,"context_line":"        num_attempts \u003d retries + 1"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba3cc151_e6452cb3","line":216,"in_reply_to":"ba3cc151_20a53ba1","updated":"2015-07-01 03:31:37.000000000","message":"Done","commit_id":"00aa8fed9716d1037926e943793d09106354e98f"}],"nova/tests/unit/image/test_glance.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"30d0444359f24aa21a37d519361f011fefe42ed8","unresolved":false,"context_lines":[{"line_number":301,"context_line":"    @mock.patch(\u0027time.sleep\u0027)"},{"line_number":302,"context_line":"    @mock.patch(\u0027nova.image.glance._create_glance_client\u0027)"},{"line_number":303,"context_line":"    def test_static_client_with_retries_negative(self, create_client_mock,"},{"line_number":304,"context_line":"                                           sleep_mock):"},{"line_number":305,"context_line":"        client_mock \u003d mock.MagicMock()"},{"line_number":306,"context_line":"        images_mock \u003d mock.MagicMock()"},{"line_number":307,"context_line":"        images_mock.get.side_effect \u003d glanceclient.exc.ServiceUnavailable"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_8680cac1","line":304,"updated":"2015-06-16 23:20:26.000000000","message":"The indention is strange here","commit_id":"29f608899751d2fd415b397f1c1eaa6d4f85273e"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"24b8c9a59e834f79fad562e932508efb6d2f7116","unresolved":false,"context_lines":[{"line_number":301,"context_line":"    @mock.patch(\u0027time.sleep\u0027)"},{"line_number":302,"context_line":"    @mock.patch(\u0027nova.image.glance._create_glance_client\u0027)"},{"line_number":303,"context_line":"    def test_static_client_with_retries_negative(self, create_client_mock,"},{"line_number":304,"context_line":"                                           sleep_mock):"},{"line_number":305,"context_line":"        client_mock \u003d mock.MagicMock()"},{"line_number":306,"context_line":"        images_mock \u003d mock.MagicMock()"},{"line_number":307,"context_line":"        images_mock.get.side_effect \u003d glanceclient.exc.ServiceUnavailable"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_f8852ecf","line":304,"in_reply_to":"fa32b979_8680cac1","updated":"2015-06-26 01:05:48.000000000","message":"Done","commit_id":"29f608899751d2fd415b397f1c1eaa6d4f85273e"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"30d0444359f24aa21a37d519361f011fefe42ed8","unresolved":false,"context_lines":[{"line_number":302,"context_line":"    @mock.patch(\u0027nova.image.glance._create_glance_client\u0027)"},{"line_number":303,"context_line":"    def test_static_client_with_retries_negative(self, create_client_mock,"},{"line_number":304,"context_line":"                                           sleep_mock):"},{"line_number":305,"context_line":"        client_mock \u003d mock.MagicMock()"},{"line_number":306,"context_line":"        images_mock \u003d mock.MagicMock()"},{"line_number":307,"context_line":"        images_mock.get.side_effect \u003d glanceclient.exc.ServiceUnavailable"},{"line_number":308,"context_line":"        type(client_mock).images \u003d mock.PropertyMock(return_value\u003dimages_mock)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_2658de89","line":305,"updated":"2015-06-16 23:20:26.000000000","message":"It\u0027s best to use a Mock object with a spec instead of a MagicMock that will allow any method call (even invalid ones) to succeed in the tested code. For example, I think this one would be:\n\n client_mock \u003d mock.Mock(spec\u003dglanceclient.Client)","commit_id":"29f608899751d2fd415b397f1c1eaa6d4f85273e"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"24b8c9a59e834f79fad562e932508efb6d2f7116","unresolved":false,"context_lines":[{"line_number":302,"context_line":"    @mock.patch(\u0027nova.image.glance._create_glance_client\u0027)"},{"line_number":303,"context_line":"    def test_static_client_with_retries_negative(self, create_client_mock,"},{"line_number":304,"context_line":"                                           sleep_mock):"},{"line_number":305,"context_line":"        client_mock \u003d mock.MagicMock()"},{"line_number":306,"context_line":"        images_mock \u003d mock.MagicMock()"},{"line_number":307,"context_line":"        images_mock.get.side_effect \u003d glanceclient.exc.ServiceUnavailable"},{"line_number":308,"context_line":"        type(client_mock).images \u003d mock.PropertyMock(return_value\u003dimages_mock)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_d8806ac2","line":305,"in_reply_to":"fa32b979_2658de89","updated":"2015-06-26 01:05:48.000000000","message":"Done","commit_id":"29f608899751d2fd415b397f1c1eaa6d4f85273e"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"30d0444359f24aa21a37d519361f011fefe42ed8","unresolved":false,"context_lines":[{"line_number":303,"context_line":"    def test_static_client_with_retries_negative(self, create_client_mock,"},{"line_number":304,"context_line":"                                           sleep_mock):"},{"line_number":305,"context_line":"        client_mock \u003d mock.MagicMock()"},{"line_number":306,"context_line":"        images_mock \u003d mock.MagicMock()"},{"line_number":307,"context_line":"        images_mock.get.side_effect \u003d glanceclient.exc.ServiceUnavailable"},{"line_number":308,"context_line":"        type(client_mock).images \u003d mock.PropertyMock(return_value\u003dimages_mock)"},{"line_number":309,"context_line":"        create_client_mock.return_value \u003d client_mock"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_a62dcea9","line":306,"updated":"2015-06-16 23:20:26.000000000","message":"Since we don\u0027t really have access to the spec for images, just make this:\n\n images_mock \u003d mock.Mock()\n\nand we\u0027ll define only \"get\" ourselves.","commit_id":"29f608899751d2fd415b397f1c1eaa6d4f85273e"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"24b8c9a59e834f79fad562e932508efb6d2f7116","unresolved":false,"context_lines":[{"line_number":303,"context_line":"    def test_static_client_with_retries_negative(self, create_client_mock,"},{"line_number":304,"context_line":"                                           sleep_mock):"},{"line_number":305,"context_line":"        client_mock \u003d mock.MagicMock()"},{"line_number":306,"context_line":"        images_mock \u003d mock.MagicMock()"},{"line_number":307,"context_line":"        images_mock.get.side_effect \u003d glanceclient.exc.ServiceUnavailable"},{"line_number":308,"context_line":"        type(client_mock).images \u003d mock.PropertyMock(return_value\u003dimages_mock)"},{"line_number":309,"context_line":"        create_client_mock.return_value \u003d client_mock"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_1877b209","line":306,"in_reply_to":"fa32b979_a62dcea9","updated":"2015-06-26 01:05:48.000000000","message":"Done","commit_id":"29f608899751d2fd415b397f1c1eaa6d4f85273e"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"30d0444359f24aa21a37d519361f011fefe42ed8","unresolved":false,"context_lines":[{"line_number":305,"context_line":"        client_mock \u003d mock.MagicMock()"},{"line_number":306,"context_line":"        images_mock \u003d mock.MagicMock()"},{"line_number":307,"context_line":"        images_mock.get.side_effect \u003d glanceclient.exc.ServiceUnavailable"},{"line_number":308,"context_line":"        type(client_mock).images \u003d mock.PropertyMock(return_value\u003dimages_mock)"},{"line_number":309,"context_line":"        create_client_mock.return_value \u003d client_mock"},{"line_number":310,"context_line":"        self.flags(num_retries\u003d-1, group\u003d\u0027glance\u0027)"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_c6e01299","line":308,"updated":"2015-06-16 23:20:26.000000000","message":"This line would no longer be needed.","commit_id":"29f608899751d2fd415b397f1c1eaa6d4f85273e"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"24b8c9a59e834f79fad562e932508efb6d2f7116","unresolved":false,"context_lines":[{"line_number":305,"context_line":"        client_mock \u003d mock.MagicMock()"},{"line_number":306,"context_line":"        images_mock \u003d mock.MagicMock()"},{"line_number":307,"context_line":"        images_mock.get.side_effect \u003d glanceclient.exc.ServiceUnavailable"},{"line_number":308,"context_line":"        type(client_mock).images \u003d mock.PropertyMock(return_value\u003dimages_mock)"},{"line_number":309,"context_line":"        create_client_mock.return_value \u003d client_mock"},{"line_number":310,"context_line":"        self.flags(num_retries\u003d-1, group\u003d\u0027glance\u0027)"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa32b979_781b5ecb","line":308,"in_reply_to":"fa32b979_c6e01299","updated":"2015-06-26 01:05:48.000000000","message":"Done","commit_id":"29f608899751d2fd415b397f1c1eaa6d4f85273e"}]}
