)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"6f6e8137b641b267278d081bbabec55ce1e51b6c","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Return immediately if no agent be selected"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"if num_agents \u003d\u003d 0 or hostable_agents \u003d\u003d [] the"},{"line_number":10,"context_line":"function should be return []. no need to call"},{"line_number":11,"context_line":"select or bind.it can save time and avoid abnormal"},{"line_number":12,"context_line":" data pass other functions to cause possible problem."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"da85f559_c1958540","line":9,"updated":"2015-11-14 18:07:24.000000000","message":"Please improve commit message. It requires polishing, especially capital letters.","commit_id":"d4f213250ad188c94996859711f4f4aa5060b09b"}],"neutron/scheduler/base_scheduler.py":[{"author":{"_account_id":704,"name":"Edgar Magana","email":"emagana@gmail.com","username":"emagana"},"change_message_id":"0a46f74ffa23e73d34d9c9e8ce1e7bf8994b4571","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        num_agents \u003d filtered_agents_dict[\u0027n_agents\u0027]"},{"line_number":46,"context_line":"        hostable_agents \u003d filtered_agents_dict[\u0027hostable_agents\u0027]"},{"line_number":47,"context_line":"        if not (filtered_agents_dict and num_agents):"},{"line_number":48,"context_line":"            return []"},{"line_number":49,"context_line":"        chosen_agents \u003d self.select(plugin, context, hostable_agents,"},{"line_number":50,"context_line":"                                    num_agents)"},{"line_number":51,"context_line":"        # bind the resource to the agents"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_44cd8b64","line":48,"updated":"2015-09-06 14:55:05.000000000","message":"needs unit test","commit_id":"683ef2008d33d9a05d2aad629dd4f99edf44a111"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"bf3960e250ef37218beab21872f11b5b007733e5","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            plugin, context, resource)"},{"line_number":45,"context_line":"        num_agents \u003d filtered_agents_dict[\u0027n_agents\u0027]"},{"line_number":46,"context_line":"        hostable_agents \u003d filtered_agents_dict[\u0027hostable_agents\u0027]"},{"line_number":47,"context_line":"        if not (filtered_agents_dict and num_agents):"},{"line_number":48,"context_line":"            return []"},{"line_number":49,"context_line":"        chosen_agents \u003d self.select(plugin, context, hostable_agents,"},{"line_number":50,"context_line":"                                    num_agents)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_df0ac6d1","line":47,"updated":"2015-09-06 16:19:41.000000000","message":"you maybe mean :\n\n\"if not (hostable_agents and num_agents):\"\n\n???","commit_id":"56d4c7f23bec5cc997af8a78373ee901a5ccc673"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"57beb1ac65fe4fe047204c7db944daac86947936","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            plugin, context, resource)"},{"line_number":45,"context_line":"        num_agents \u003d filtered_agents_dict[\u0027n_agents\u0027]"},{"line_number":46,"context_line":"        hostable_agents \u003d filtered_agents_dict[\u0027hostable_agents\u0027]"},{"line_number":47,"context_line":"        if not (num_agents and hostable_agents):"},{"line_number":48,"context_line":"            return []"},{"line_number":49,"context_line":"        chosen_agents \u003d self.select(plugin, context, hostable_agents,"},{"line_number":50,"context_line":"                                    num_agents)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_846ff990","line":47,"updated":"2015-09-08 04:02:46.000000000","message":"if any ((num_agents\u003d\u003d0, hostable_agents\u003d\u003d0)): return [] ?","commit_id":"1d77b93cfcc7a07050c7b25baf7052b39a1a8c4f"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"f2763966fb82de1fa018e5686e5841206b7d6ea9","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        num_agents \u003d filtered_agents_dict[\u0027n_agents\u0027]"},{"line_number":46,"context_line":"        hostable_agents \u003d filtered_agents_dict[\u0027hostable_agents\u0027]"},{"line_number":47,"context_line":"        if not (num_agents and hostable_agents):"},{"line_number":48,"context_line":"            return []"},{"line_number":49,"context_line":"        chosen_agents \u003d self.select(plugin, context, hostable_agents,"},{"line_number":50,"context_line":"                                    num_agents)"},{"line_number":51,"context_line":"        # bind the resource to the agents"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_77276263","line":48,"updated":"2015-09-11 08:22:07.000000000","message":"can you explain the benefit this shortcut provides?","commit_id":"cb434163f9f53c66ccb50e65845bfdffa900908a"},{"author":{"_account_id":16053,"name":"Pengtao Huang","email":"huangpengtao@huawei.com","username":"huangpengtao"},"change_message_id":"8ab9a2f3350c5133e618673a514935682239dd24","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        num_agents \u003d filtered_agents_dict[\u0027n_agents\u0027]"},{"line_number":46,"context_line":"        hostable_agents \u003d filtered_agents_dict[\u0027hostable_agents\u0027]"},{"line_number":47,"context_line":"        if not (num_agents and hostable_agents):"},{"line_number":48,"context_line":"            return []"},{"line_number":49,"context_line":"        chosen_agents \u003d self.select(plugin, context, hostable_agents,"},{"line_number":50,"context_line":"                                    num_agents)"},{"line_number":51,"context_line":"        # bind the resource to the agents"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_ba7e3fe2","line":48,"in_reply_to":"da20952f_77276263","updated":"2015-09-11 09:01:08.000000000","message":"it can save time and maybe code to avoid many check below to give result more quickly.\nit avoid abnormal data pass other functions and also avoid possible problem.","commit_id":"cb434163f9f53c66ccb50e65845bfdffa900908a"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"6f6e8137b641b267278d081bbabec55ce1e51b6c","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            plugin, context, resource)"},{"line_number":45,"context_line":"        num_agents \u003d filtered_agents_dict[\u0027n_agents\u0027]"},{"line_number":46,"context_line":"        hostable_agents \u003d filtered_agents_dict[\u0027hostable_agents\u0027]"},{"line_number":47,"context_line":"        if not (num_agents and hostable_agents):"},{"line_number":48,"context_line":"            return []"},{"line_number":49,"context_line":"        chosen_agents \u003d self.select(plugin, context, hostable_agents,"},{"line_number":50,"context_line":"                                    num_agents)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da85f559_819f7d5e","line":47,"updated":"2015-11-14 18:07:24.000000000","message":"nit: brackets are not necessary","commit_id":"d4f213250ad188c94996859711f4f4aa5060b09b"}],"neutron/tests/unit/scheduler/test_dhcp_agent_scheduler.py":[{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"4f62b4265ededd3650099f592d8092f9fb331c4f","unresolved":false,"context_lines":[{"line_number":388,"context_line":"                                               {\u0027id\u0027: \u00271111\u0027})"},{"line_number":389,"context_line":"        agents \u003d self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":390,"context_line":"                                                              [\u00271111\u0027])"},{"line_number":391,"context_line":"        self.assertEqual(0, len(agents))"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    def test_scheduler_no_active_agents(self):"},{"line_number":394,"context_line":"        self._save_networks([\u00271111\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_9a1d1264","line":391,"updated":"2015-09-08 05:54:56.000000000","message":"This doesn\u0027t test your patch because schedule() returns [] without your patch. Why not check whether or not select() was called?\n\nHowever, this test itself is useful so please keep here :)","commit_id":"1d77b93cfcc7a07050c7b25baf7052b39a1a8c4f"},{"author":{"_account_id":16053,"name":"Pengtao Huang","email":"huangpengtao@huawei.com","username":"huangpengtao"},"change_message_id":"67dcc4ab69b65edd4a79936d59ab755e089576a9","unresolved":false,"context_lines":[{"line_number":388,"context_line":"                                               {\u0027id\u0027: \u00271111\u0027})"},{"line_number":389,"context_line":"        agents \u003d self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":390,"context_line":"                                                              [\u00271111\u0027])"},{"line_number":391,"context_line":"        self.assertEqual(0, len(agents))"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    def test_scheduler_no_active_agents(self):"},{"line_number":394,"context_line":"        self._save_networks([\u00271111\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_9ab3d299","line":391,"in_reply_to":"da20952f_9a1d1264","updated":"2015-09-08 06:22:28.000000000","message":"please tell me detail how to check whether or not select() was called? is it impossible?","commit_id":"1d77b93cfcc7a07050c7b25baf7052b39a1a8c4f"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"81421e4f452eda36775b9dac5d1edcea6461ed54","unresolved":false,"context_lines":[{"line_number":388,"context_line":"                                               {\u0027id\u0027: \u00271111\u0027})"},{"line_number":389,"context_line":"        agents \u003d self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":390,"context_line":"                                                              [\u00271111\u0027])"},{"line_number":391,"context_line":"        self.assertEqual(0, len(agents))"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    def test_scheduler_no_active_agents(self):"},{"line_number":394,"context_line":"        self._save_networks([\u00271111\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_19910bf2","line":391,"in_reply_to":"da20952f_9ab3d299","updated":"2015-09-08 09:22:11.000000000","message":"It\u0027s possible.\n\nFor example:\n with mock.patch.object(self.plugin.network_scheduler, \u0027select\u0027) as select:\n     self._save_networks([\u00271111\u0027])\n     self.plugin.network_scheduler.schedule(self.plugin, self.ctx, {\u0027id\u0027: \u00271111\u0027})\n     agents \u003d self.plugin.get_dhcp_agents_hosting_networks(self.ctx, [\u00271111\u0027])\n     self.assertFalse(select.called)","commit_id":"1d77b93cfcc7a07050c7b25baf7052b39a1a8c4f"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"fc1c974c5ce493a46bebb6b0a7c6e0baf54aa5bd","unresolved":false,"context_lines":[{"line_number":405,"context_line":"            self.assertFalse(select.called)"},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"    def test_scheduler_none_agents_return_immediately(self):"},{"line_number":408,"context_line":"        cfg.CONF.set_override(\u0027dhcp_agents_per_network\u0027, 2)"},{"line_number":409,"context_line":"        with mock.patch.object(self.plugin.network_scheduler,"},{"line_number":410,"context_line":"                               \u0027select\u0027) as select:"},{"line_number":411,"context_line":"            self._save_networks([\u00271111\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_c32930f4","line":408,"updated":"2015-09-09 08:18:00.000000000","message":"This override is unnecessary.","commit_id":"131ab76cfd4e54fc8f8a263299d3c905fa183d25"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8c9e24e2c99335a3a74f15965ba44e977e9ec0bc","unresolved":false,"context_lines":[{"line_number":380,"context_line":"        self.assertEqual(2, len(agents))"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def test_scheduler_two_agents_none_per_network(self):"},{"line_number":383,"context_line":"        cfg.CONF.set_override(\u0027dhcp_agents_per_network\u0027, 0)"},{"line_number":384,"context_line":"        self._save_networks([\u00271111\u0027])"},{"line_number":385,"context_line":"        helpers.register_dhcp_agent(HOST_C)"},{"line_number":386,"context_line":"        helpers.register_dhcp_agent(HOST_D)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_9b24d8c6","line":383,"updated":"2015-09-10 02:19:53.000000000","message":"this seems unrelated to this change.","commit_id":"cb434163f9f53c66ccb50e65845bfdffa900908a"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"00ff6a61bbe10d920823d3b42a08d5dc380c2e35","unresolved":false,"context_lines":[{"line_number":380,"context_line":"        self.assertEqual(2, len(agents))"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def test_scheduler_two_agents_none_per_network(self):"},{"line_number":383,"context_line":"        cfg.CONF.set_override(\u0027dhcp_agents_per_network\u0027, 0)"},{"line_number":384,"context_line":"        self._save_networks([\u00271111\u0027])"},{"line_number":385,"context_line":"        helpers.register_dhcp_agent(HOST_C)"},{"line_number":386,"context_line":"        helpers.register_dhcp_agent(HOST_D)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_cccff427","line":383,"in_reply_to":"da20952f_0e1164af","updated":"2015-09-10 05:02:37.000000000","message":"Yes. I believe it raises test coverage rate.","commit_id":"cb434163f9f53c66ccb50e65845bfdffa900908a"},{"author":{"_account_id":16053,"name":"Pengtao Huang","email":"huangpengtao@huawei.com","username":"huangpengtao"},"change_message_id":"b1716e20542f184063663e34e5461e16fd4548ea","unresolved":false,"context_lines":[{"line_number":380,"context_line":"        self.assertEqual(2, len(agents))"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def test_scheduler_two_agents_none_per_network(self):"},{"line_number":383,"context_line":"        cfg.CONF.set_override(\u0027dhcp_agents_per_network\u0027, 0)"},{"line_number":384,"context_line":"        self._save_networks([\u00271111\u0027])"},{"line_number":385,"context_line":"        helpers.register_dhcp_agent(HOST_C)"},{"line_number":386,"context_line":"        helpers.register_dhcp_agent(HOST_D)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_0e1164af","line":383,"in_reply_to":"da20952f_9b24d8c6","updated":"2015-09-10 03:01:56.000000000","message":"However, this test itself is useful proposed by Hirofumi Ichihara","commit_id":"cb434163f9f53c66ccb50e65845bfdffa900908a"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"f2763966fb82de1fa018e5686e5841206b7d6ea9","unresolved":false,"context_lines":[{"line_number":402,"context_line":"                                                   {\u0027id\u0027: \u00271111\u0027})"},{"line_number":403,"context_line":"            self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":404,"context_line":"                                                         [\u00271111\u0027])"},{"line_number":405,"context_line":"            self.assertFalse(select.called)"},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"    def test_scheduler_none_agents_return_immediately(self):"},{"line_number":408,"context_line":"        with mock.patch.object(self.plugin.network_scheduler,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_d7518eda","line":405,"updated":"2015-09-11 08:22:07.000000000","message":"ideally unit tests should just check the outputs for the given inputs.  they shouldn\u0027t see implementation details like this.","commit_id":"cb434163f9f53c66ccb50e65845bfdffa900908a"},{"author":{"_account_id":16053,"name":"Pengtao Huang","email":"huangpengtao@huawei.com","username":"huangpengtao"},"change_message_id":"b298f25fd2ecba2aca26083d074eb562a8aae421","unresolved":false,"context_lines":[{"line_number":402,"context_line":"                                                   {\u0027id\u0027: \u00271111\u0027})"},{"line_number":403,"context_line":"            self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":404,"context_line":"                                                         [\u00271111\u0027])"},{"line_number":405,"context_line":"            self.assertFalse(select.called)"},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"    def test_scheduler_none_agents_return_immediately(self):"},{"line_number":408,"context_line":"        with mock.patch.object(self.plugin.network_scheduler,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_0c30e755","line":405,"in_reply_to":"da20952f_d7518eda","updated":"2015-09-12 08:45:00.000000000","message":"it do need to test if the select is called, or it can\u0027t test right.","commit_id":"cb434163f9f53c66ccb50e65845bfdffa900908a"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"0e050f04ff84b17dd6e26a903d74c5a6bc8a6686","unresolved":false,"context_lines":[{"line_number":413,"context_line":"                                                   {\u0027id\u0027: \u00271111\u0027})"},{"line_number":414,"context_line":"            self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":415,"context_line":"                                                         [\u00271111\u0027])"},{"line_number":416,"context_line":"            self.assertFalse(select.called)"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    def test_scheduler_no_active_agents(self):"},{"line_number":419,"context_line":"        self._save_networks([\u00271111\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_bbf2fc99","line":416,"updated":"2015-09-10 02:05:01.000000000","message":"It seems that this is duplicated by test_scheduler_no_active_agents. IMO, your test achieves the goal by test_scheduler_set_conf_zero_return_immediately.\n\nHowever, I don\u0027t encourage removing it since these test\u0027s intention is different.","commit_id":"cb434163f9f53c66ccb50e65845bfdffa900908a"}]}
