)]}'
{"neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e40febcc5dcc362459f8abdf68e7211fd3f28eed","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            if schedule_required:"},{"line_number":137,"context_line":"                agents \u003d self._schedule_network(admin_ctx, network, agents)"},{"line_number":138,"context_line":"            if len(agents) \u003d\u003d 0:"},{"line_number":139,"context_line":"                LOG.debug(\"There are no any agent that managing network: %s\","},{"line_number":140,"context_line":"                          network_id)"},{"line_number":141,"context_line":"            enabled_agents \u003d self._get_enabled_agents("},{"line_number":142,"context_line":"                context, network, agents, method, payload)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_637c2021","line":139,"updated":"2015-12-03 16:30:15.000000000","message":"\"Network %s is not hosted by any dhcp agent\"","commit_id":"6bfb599598e695f7f67bec5097205775c9bac350"},{"author":{"_account_id":14615,"name":"Sergey Belous","email":"belous.py@gmail.com","username":"sbelous"},"change_message_id":"2daa92cbbd94765d21b15828ccd6e9b9df97618c","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            if schedule_required:"},{"line_number":137,"context_line":"                agents \u003d self._schedule_network(admin_ctx, network, agents)"},{"line_number":138,"context_line":"            if len(agents) \u003d\u003d 0:"},{"line_number":139,"context_line":"                LOG.debug(\"There are no any agent that managing network: %s\","},{"line_number":140,"context_line":"                          network_id)"},{"line_number":141,"context_line":"            enabled_agents \u003d self._get_enabled_agents("},{"line_number":142,"context_line":"                context, network, agents, method, payload)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_158ce87d","line":139,"in_reply_to":"7a740942_637c2021","updated":"2015-12-07 16:56:32.000000000","message":"Thanks, Oleg!","commit_id":"6bfb599598e695f7f67bec5097205775c9bac350"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"8749d663dfd279d1aefc3fd672a620691885d35f","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                not self._is_reserved_dhcp_port(payload[\u0027port\u0027]))"},{"line_number":136,"context_line":"            if schedule_required:"},{"line_number":137,"context_line":"                agents \u003d self._schedule_network(admin_ctx, network, agents)"},{"line_number":138,"context_line":"            if len(agents) \u003d\u003d 0:"},{"line_number":139,"context_line":"                LOG.debug(\"Network %s is not hosted by any dhcp agent\","},{"line_number":140,"context_line":"                          network_id)"},{"line_number":141,"context_line":"            enabled_agents \u003d self._get_enabled_agents("}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_b125d609","line":138,"updated":"2015-12-08 00:19:09.000000000","message":"It\u0027s better to use \"if not agents\" when cheking empty list like L81.\n\nWhy do you check agents on both here and L81?","commit_id":"d52efbee01b150ed82ddf6169c50648edea3ab9b"},{"author":{"_account_id":14615,"name":"Sergey Belous","email":"belous.py@gmail.com","username":"sbelous"},"change_message_id":"57b77e20c23519d93261f79bd0051c4067576b95","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                not self._is_reserved_dhcp_port(payload[\u0027port\u0027]))"},{"line_number":136,"context_line":"            if schedule_required:"},{"line_number":137,"context_line":"                agents \u003d self._schedule_network(admin_ctx, network, agents)"},{"line_number":138,"context_line":"            if len(agents) \u003d\u003d 0:"},{"line_number":139,"context_line":"                LOG.debug(\"Network %s is not hosted by any dhcp agent\","},{"line_number":140,"context_line":"                          network_id)"},{"line_number":141,"context_line":"            enabled_agents \u003d self._get_enabled_agents("}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_fdb8f02b","line":138,"in_reply_to":"7a740942_b125d609","updated":"2015-12-08 13:55:05.000000000","message":"Hirofumi Ichihara, thanks for review! I will do here the same like L81.\nAbout double checking — I think, we must log debug message in this case, but we can\u0027t do it in _get_enabled_agents() method, it\u0027s will be wrong, and here, in _notify_agents() is the best place for log. Isn\u0027t?","commit_id":"d52efbee01b150ed82ddf6169c50648edea3ab9b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"6ce636be0d6b445f13048e3f343cf9d56a0ba7d8","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _get_enabled_agents(self, context, network, agents, method, payload):"},{"line_number":79,"context_line":"        \"\"\"Get the list of agents who can provide services.\"\"\""},{"line_number":80,"context_line":"        network_id \u003d network[\u0027id\u0027]"},{"line_number":81,"context_line":"        if not agents:"},{"line_number":82,"context_line":"            return []"},{"line_number":83,"context_line":"        enabled_agents \u003d agents"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_e23283a6","line":80,"updated":"2015-12-08 15:37:29.000000000","message":"this assignment could be done after the test below","commit_id":"5ac41bdc2bf9af3c23a7962ec87a7c6e4ea7d589"},{"author":{"_account_id":14615,"name":"Sergey Belous","email":"belous.py@gmail.com","username":"sbelous"},"change_message_id":"e9e7c148f004563e70e19f31781df6f01bd0a66b","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _get_enabled_agents(self, context, network, agents, method, payload):"},{"line_number":79,"context_line":"        \"\"\"Get the list of agents who can provide services.\"\"\""},{"line_number":80,"context_line":"        network_id \u003d network[\u0027id\u0027]"},{"line_number":81,"context_line":"        if not agents:"},{"line_number":82,"context_line":"            return []"},{"line_number":83,"context_line":"        enabled_agents \u003d agents"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_92ed91b9","line":80,"in_reply_to":"7a740942_e23283a6","updated":"2015-12-10 15:59:08.000000000","message":"Thanks for review, Gary. I will fix it in next PS.","commit_id":"5ac41bdc2bf9af3c23a7962ec87a7c6e4ea7d589"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"6ce636be0d6b445f13048e3f343cf9d56a0ba7d8","unresolved":false,"context_lines":[{"line_number":137,"context_line":"                agents \u003d self._schedule_network(admin_ctx, network, agents)"},{"line_number":138,"context_line":"            if not agents:"},{"line_number":139,"context_line":"                LOG.debug(\"Network %s is not hosted by any dhcp agent\","},{"line_number":140,"context_line":"                          network_id)"},{"line_number":141,"context_line":"            enabled_agents \u003d self._get_enabled_agents("},{"line_number":142,"context_line":"                context, network, agents, method, payload)"},{"line_number":143,"context_line":"            for agent in enabled_agents:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_4299177b","line":140,"updated":"2015-12-08 15:37:29.000000000","message":"why are we not checking this after line 129?\nin addition to this why are we not returning from the method here?","commit_id":"5ac41bdc2bf9af3c23a7962ec87a7c6e4ea7d589"},{"author":{"_account_id":14615,"name":"Sergey Belous","email":"belous.py@gmail.com","username":"sbelous"},"change_message_id":"e9e7c148f004563e70e19f31781df6f01bd0a66b","unresolved":false,"context_lines":[{"line_number":137,"context_line":"                agents \u003d self._schedule_network(admin_ctx, network, agents)"},{"line_number":138,"context_line":"            if not agents:"},{"line_number":139,"context_line":"                LOG.debug(\"Network %s is not hosted by any dhcp agent\","},{"line_number":140,"context_line":"                          network_id)"},{"line_number":141,"context_line":"            enabled_agents \u003d self._get_enabled_agents("},{"line_number":142,"context_line":"                context, network, agents, method, payload)"},{"line_number":143,"context_line":"            for agent in enabled_agents:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_524de997","line":140,"in_reply_to":"7a740942_4299177b","updated":"2015-12-10 15:59:08.000000000","message":"garyk, but before calling _get_enabled_agents() the agents can be updated if schedule_required is true (at L137). About returning here — good idea, thanks!","commit_id":"5ac41bdc2bf9af3c23a7962ec87a7c6e4ea7d589"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"4464f615b24a81ef0d5e56814f054e63950dc982","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def _get_enabled_agents(self, context, network, agents, method, payload):"},{"line_number":79,"context_line":"        \"\"\"Get the list of agents who can provide services.\"\"\""},{"line_number":80,"context_line":"        if not agents:"},{"line_number":81,"context_line":"            return []"},{"line_number":82,"context_line":"        network_id \u003d network[\u0027id\u0027]"},{"line_number":83,"context_line":"        enabled_agents \u003d agents"},{"line_number":84,"context_line":"        if not cfg.CONF.enable_services_on_agents_with_admin_state_down:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a740942_80f67bf7","line":81,"updated":"2015-12-11 00:35:31.000000000","message":"These two lines should be removed because we already check the agents on L139 and empty list is never passed into _get_enabled_agents().","commit_id":"18893eea3f9402f71645302e7d33aba8ff863970"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"42803b3b23fa6f5ef56c31d9b08bb1c68a0594fd","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def _get_enabled_agents(self, context, network, agents, method, payload):"},{"line_number":79,"context_line":"        \"\"\"Get the list of agents who can provide services.\"\"\""},{"line_number":80,"context_line":"        if not agents:"},{"line_number":81,"context_line":"            return []"},{"line_number":82,"context_line":"        network_id \u003d network[\u0027id\u0027]"},{"line_number":83,"context_line":"        enabled_agents \u003d agents"},{"line_number":84,"context_line":"        if not cfg.CONF.enable_services_on_agents_with_admin_state_down:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a740942_bf2aae8e","line":81,"in_reply_to":"7a740942_7fb9a6ca","updated":"2015-12-11 07:52:11.000000000","message":"It was actually the reason for error logs and for the bug, I think it\u0027s better to be on the safe side and not rely on each new caller of this method to not forget adding this check before calling. Do you really think it\u0027s a blocker?","commit_id":"18893eea3f9402f71645302e7d33aba8ff863970"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"12a92156a01c6750a6c7ee9f448f20e6ff9e9ec6","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def _get_enabled_agents(self, context, network, agents, method, payload):"},{"line_number":79,"context_line":"        \"\"\"Get the list of agents who can provide services.\"\"\""},{"line_number":80,"context_line":"        if not agents:"},{"line_number":81,"context_line":"            return []"},{"line_number":82,"context_line":"        network_id \u003d network[\u0027id\u0027]"},{"line_number":83,"context_line":"        enabled_agents \u003d agents"},{"line_number":84,"context_line":"        if not cfg.CONF.enable_services_on_agents_with_admin_state_down:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a740942_b220a6f8","line":81,"in_reply_to":"7a740942_80f67bf7","updated":"2015-12-11 06:31:08.000000000","message":"I think this check is ok since _get_enabled_agents() is a separate method and could potentially be called from some other place","commit_id":"18893eea3f9402f71645302e7d33aba8ff863970"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"129481fc8df5d17015daa2a947387fc03b73e67d","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def _get_enabled_agents(self, context, network, agents, method, payload):"},{"line_number":79,"context_line":"        \"\"\"Get the list of agents who can provide services.\"\"\""},{"line_number":80,"context_line":"        if not agents:"},{"line_number":81,"context_line":"            return []"},{"line_number":82,"context_line":"        network_id \u003d network[\u0027id\u0027]"},{"line_number":83,"context_line":"        enabled_agents \u003d agents"},{"line_number":84,"context_line":"        if not cfg.CONF.enable_services_on_agents_with_admin_state_down:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a740942_7fb9a6ca","line":81,"in_reply_to":"7a740942_b220a6f8","updated":"2015-12-11 07:38:02.000000000","message":"We may take care of it when we implement other method calls _get_enabled_agents(). Currently it seems lengthy.","commit_id":"18893eea3f9402f71645302e7d33aba8ff863970"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"67bf2ae8a47fea60d6293b271215ab375fe9e46a","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def _get_enabled_agents(self, context, network, agents, method, payload):"},{"line_number":79,"context_line":"        \"\"\"Get the list of agents who can provide services.\"\"\""},{"line_number":80,"context_line":"        if not agents:"},{"line_number":81,"context_line":"            return []"},{"line_number":82,"context_line":"        network_id \u003d network[\u0027id\u0027]"},{"line_number":83,"context_line":"        enabled_agents \u003d agents"},{"line_number":84,"context_line":"        if not cfg.CONF.enable_services_on_agents_with_admin_state_down:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a740942_f577f538","line":81,"in_reply_to":"7a740942_bf2aae8e","updated":"2015-12-11 08:28:12.000000000","message":"No, I don\u0027t. I guessed that we may check if agents are empty to create debug message before calling _get_enabled_agents() like this case.\n\nHowever, generally you\u0027re right. I don\u0027t have reason to make unsafe.","commit_id":"18893eea3f9402f71645302e7d33aba8ff863970"}]}
