)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0bfbcb121b5f381937ff290e0a0f2dd59e3b1e61","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Reschedule router if new external gateway is on other network"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Each L3 agent can be associated with at most one external network."},{"line_number":10,"context_line":"If router\u0027s new external gateway is on other network then the router"},{"line_number":11,"context_line":"needs to be rescheduled to the proper l3 agent"},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"AAAAU3%2F%2F4Hw%3D","line":9,"updated":"2014-02-24 10:43:55.000000000","message":"I think the commit message needs update here.\n\nNow it depends on the settings, right?","commit_id":"1e36a3479018348eb13688d9b3f417086438c25f"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"106a0ce08f1a2016f1545d4b87333b46a69ca71a","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Reschedule router if new external gateway is on other network"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Each L3 agent can be associated with at most one external network."},{"line_number":10,"context_line":"If router\u0027s new external gateway is on other network then the router"},{"line_number":11,"context_line":"needs to be rescheduled to the proper l3 agent"},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"AAAAU3%2F%2F35E%3D","line":9,"in_reply_to":"AAAAU3%2F%2F4Hw%3D","updated":"2014-02-24 11:15:10.000000000","message":"yes, thanks","commit_id":"1e36a3479018348eb13688d9b3f417086438c25f"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"5d41e89ed84342d24072b88c2a682cc067bc66ea","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Reschedule router if new external gateway is on other network"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"An L3 agent may be associated with just one external network."},{"line_number":10,"context_line":"If router\u0027s new external gateway is on other network then the router"},{"line_number":11,"context_line":"needs to be rescheduled to the proper l3 agent"},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"AAAAU3%2F%2Fs6c%3D","line":9,"updated":"2014-02-25 07:09:21.000000000","message":"Remember to update the commit message ;-)","commit_id":"b9c73754a978da7555b9110362fa3fbb2c96f6c9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"217accc33e88bc0f732d3c17a28ec0f40d26f44e","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Reschedule router if new external gateway is on other network"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"An L3 agent may be associated with just one external network."},{"line_number":10,"context_line":"If router\u0027s new external gateway is on other network then the router"},{"line_number":11,"context_line":"needs to be rescheduled to the proper l3 agent"},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"AAAAU3%2F%2Fgec%3D","line":9,"in_reply_to":"AAAAU3%2F%2Fs1U%3D","updated":"2014-02-26 08:26:22.000000000","message":"You\u0027re right, \"may\" :-)\n\nTotally correct now.","commit_id":"b9c73754a978da7555b9110362fa3fbb2c96f6c9"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"262be735e783398dab7de5fcd098e38bb9a2472d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Reschedule router if new external gateway is on other network"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"An L3 agent may be associated with just one external network."},{"line_number":10,"context_line":"If router\u0027s new external gateway is on other network then the router"},{"line_number":11,"context_line":"needs to be rescheduled to the proper l3 agent"},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"AAAAU3%2F%2Fs1U%3D","line":9,"in_reply_to":"AAAAU3%2F%2Fs6c%3D","updated":"2014-02-25 07:17:50.000000000","message":"Yeah, I think I\u0027ve updated it. So it is possible that an l3 agent is associated with just one ext net, isn\u0027t it?","commit_id":"b9c73754a978da7555b9110362fa3fbb2c96f6c9"}],"neutron/db/l3_agentschedulers_db.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a6f73e94f0b146ea60ea0b636b991ad82e5e522a","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                self.remove_router_from_l3_agent("},{"line_number":128,"context_line":"                    context, agent[\u0027id\u0027], router_id)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"            self.add_router_to_l3_agent(context, agent_id, router_id)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def list_routers_on_l3_agent(self, context, agent_id):"},{"line_number":133,"context_line":"        query \u003d context.session.query(RouterL3AgentBinding.router_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FNFI%3D","line":130,"updated":"2013-10-21 14:04:29.000000000","message":"In this method is notified l3 agent via rpc. There was an issue in the past causing deadlock if rpc was used while holding lock above database. I\u0027m thinking about passing bool parameter to lower functions using rpc calls (like add_router_to_l3_agent()) that says whether agent should be notified or not. Then we could notify agent explicitly after transaction context is exited.\n\nAnyway, rpc call mustn\u0027t be part of transaction.","commit_id":"7f8831625df3507cf29a493d02105234f2b5b95d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f9573234397d9fe388e1a53b30ec6f8d5dfe6276","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                self.remove_router_from_l3_agent("},{"line_number":128,"context_line":"                    context, agent[\u0027id\u0027], router_id)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"            self.add_router_to_l3_agent(context, agent_id, router_id)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def list_routers_on_l3_agent(self, context, agent_id):"},{"line_number":133,"context_line":"        query \u003d context.session.query(RouterL3AgentBinding.router_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FM8U%3D","line":130,"in_reply_to":"AAAATH%2F%2FNFI%3D","updated":"2013-10-21 15:20:53.000000000","message":"Agree, thanks for pointing","commit_id":"7f8831625df3507cf29a493d02105234f2b5b95d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"639876621cb338888c22250ca08479944d76e72b","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                    router_id\u003drouter_id, agent_id\u003dagent_id)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        l3_notifier \u003d self.agent_notifiers.get(constants.AGENT_TYPE_L3)"},{"line_number":91,"context_line":"        if l3_notifier and notify:"},{"line_number":92,"context_line":"            l3_notifier.router_added_to_agent("},{"line_number":93,"context_line":"                context, [router_id], agent_db.host)"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BnBY%3D","line":91,"updated":"2013-11-22 15:23:16.000000000","message":"\"if notify:\" could be inserted before line 90 and avoid getting l3_notifier if it will not be used.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f390fad705e55f257a029301c1e7aaaf5691b22f","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                    router_id\u003drouter_id, agent_id\u003dagent_id)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        l3_notifier \u003d self.agent_notifiers.get(constants.AGENT_TYPE_L3)"},{"line_number":91,"context_line":"        if l3_notifier and notify:"},{"line_number":92,"context_line":"            l3_notifier.router_added_to_agent("},{"line_number":93,"context_line":"                context, [router_id], agent_db.host)"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BhJE%3D","line":91,"in_reply_to":"AAAATn%2F%2BnBY%3D","updated":"2013-11-25 10:55:40.000000000","message":"Done","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"639876621cb338888c22250ca08479944d76e72b","unresolved":false,"context_lines":[{"line_number":112,"context_line":"                    router_id\u003drouter_id, agent_id\u003dagent_id)"},{"line_number":113,"context_line":"            context.session.delete(binding)"},{"line_number":114,"context_line":"        l3_notifier \u003d self.agent_notifiers.get(constants.AGENT_TYPE_L3)"},{"line_number":115,"context_line":"        if l3_notifier and notify:"},{"line_number":116,"context_line":"            l3_notifier.router_removed_from_agent("},{"line_number":117,"context_line":"                context, router_id, agent.host)"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BnBg%3D","line":115,"updated":"2013-11-22 15:23:16.000000000","message":"Same comment as line 89.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f390fad705e55f257a029301c1e7aaaf5691b22f","unresolved":false,"context_lines":[{"line_number":112,"context_line":"                    router_id\u003drouter_id, agent_id\u003dagent_id)"},{"line_number":113,"context_line":"            context.session.delete(binding)"},{"line_number":114,"context_line":"        l3_notifier \u003d self.agent_notifiers.get(constants.AGENT_TYPE_L3)"},{"line_number":115,"context_line":"        if l3_notifier and notify:"},{"line_number":116,"context_line":"            l3_notifier.router_removed_from_agent("},{"line_number":117,"context_line":"                context, router_id, agent.host)"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BhJA%3D","line":115,"in_reply_to":"AAAATn%2F%2BnBg%3D","updated":"2013-11-25 10:55:40.000000000","message":"Done","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"639876621cb338888c22250ca08479944d76e72b","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                    context, agent[\u0027id\u0027], router_id, notify\u003dFalse)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"            self.add_router_to_l3_agent(context, agent_id, router_id,"},{"line_number":133,"context_line":"                                        notify\u003dFalse)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        l3_notifier \u003d self.agent_notifiers.get(constants.AGENT_TYPE_L3)"},{"line_number":136,"context_line":"        if l3_notifier:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BnAQ%3D","line":133,"updated":"2013-11-22 15:23:16.000000000","message":"Just curious.  We might remove the router from more than one hosting l3 agent but there is no mechanism to schedule it back to more than one hosting agent.  Why is that?","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f390fad705e55f257a029301c1e7aaaf5691b22f","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                    context, agent[\u0027id\u0027], router_id, notify\u003dFalse)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"            self.add_router_to_l3_agent(context, agent_id, router_id,"},{"line_number":133,"context_line":"                                        notify\u003dFalse)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        l3_notifier \u003d self.agent_notifiers.get(constants.AGENT_TYPE_L3)"},{"line_number":136,"context_line":"        if l3_notifier:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BhIs%3D","line":133,"in_reply_to":"AAAATn%2F%2BnAQ%3D","updated":"2013-11-25 10:55:40.000000000","message":"In fact currently a router may be hosted by only one l3 agent, see L3AgentSchedulerDbMixin.add_router_to_l3_agent. If this is changed in future - the func should be updated as well.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"7f19c72fcb4c653bb91436665ea64843e1348008","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    router_scheduler \u003d None"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def add_router_to_l3_agent(self, context, agent_id, router_id,"},{"line_number":65,"context_line":"                               notify\u003dTrue):"},{"line_number":66,"context_line":"        \"\"\"Add a l3 agent to host a router.\"\"\""},{"line_number":67,"context_line":"        router \u003d self.get_router(context, router_id)"},{"line_number":68,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAVn%2F%2BxKQ%3D","line":65,"updated":"2014-03-12 09:46:57.000000000","message":"It seems we don\u0027t need this change anymore","commit_id":"425b514e0f2745d912a3406613d1fca061925116"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"7f19c72fcb4c653bb91436665ea64843e1348008","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                raise l3agentscheduler.RouterSchedulingFailed("},{"line_number":89,"context_line":"                    router_id\u003drouter_id, agent_id\u003dagent_id)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        if notify:"},{"line_number":92,"context_line":"            l3_notifier \u003d self.agent_notifiers.get(constants.AGENT_TYPE_L3)"},{"line_number":93,"context_line":"            if l3_notifier:"},{"line_number":94,"context_line":"                l3_notifier.router_added_to_agent("}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAVn%2F%2BxKA%3D","line":91,"updated":"2014-03-12 09:46:57.000000000","message":"ditto","commit_id":"425b514e0f2745d912a3406613d1fca061925116"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"7f19c72fcb4c653bb91436665ea64843e1348008","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                self.remove_router_from_l3_agent("},{"line_number":133,"context_line":"                    context, agent[\u0027id\u0027], router_id, notify\u003dFalse)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"            new_agent \u003d self.schedule_router(context, router_id)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        l3_notifier \u003d self.agent_notifiers.get(constants.AGENT_TYPE_L3)"},{"line_number":138,"context_line":"        if l3_notifier:"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAVn%2F%2BxJI%3D","line":135,"updated":"2014-03-12 09:46:57.000000000","message":"I think we should check whether the scheduler return an agent or not","commit_id":"425b514e0f2745d912a3406613d1fca061925116"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"263376aa843dc40d9ff546c089bd61935201084a","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                l3_notifier.router_removed_from_agent("},{"line_number":118,"context_line":"                    context, router_id, agent.host)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def reschedule_router(self, context, router_id):"},{"line_number":121,"context_line":"        \"\"\"Reschedule router to a new l3 agent"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        Remove the router from the agent(s) currently hosting it and"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAWH%2F%2B2QI%3D","line":120,"updated":"2014-03-23 08:30:35.000000000","message":"may need to add a new unit test case in test_l3_scheduler.py for reschedule_router here?","commit_id":"a6ced4571c09d1ec4cb58faba3c3db5d148b4165"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2704382252f6f5216a9fd732260f7339af165922","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                l3_notifier.router_removed_from_agent("},{"line_number":118,"context_line":"                    context, router_id, agent.host)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def reschedule_router(self, context, router_id):"},{"line_number":121,"context_line":"        \"\"\"Reschedule router to a new l3 agent"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        Remove the router from the agent(s) currently hosting it and"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAWH%2F%2BokI%3D","line":120,"in_reply_to":"AAAAWH%2F%2B2QI%3D","updated":"2014-03-25 12:45:39.000000000","message":"test_l3_schedulers.py contains tests for scheduler objects (ChanceScheduler, LeastRoutersScheduler) and not for l3 scheduler db mixin. I think tests added to test_l3_plugin cover rescheduling logic quite well.","commit_id":"a6ced4571c09d1ec4cb58faba3c3db5d148b4165"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"9cc5b504cdae87ba21fc09fb6965f7dac24a530d","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                l3_notifier.router_removed_from_agent("},{"line_number":118,"context_line":"                    context, router_id, agent.host)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def reschedule_router(self, context, router_id):"},{"line_number":121,"context_line":"        \"\"\"Reschedule router to a new l3 agent"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        Remove the router from the agent(s) currently hosting it and"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAWH%2F%2Biv0%3D","line":120,"in_reply_to":"AAAAWH%2F%2BokI%3D","updated":"2014-03-26 02:31:42.000000000","message":"Oleg, thanks for the clarification. I will leave comment in the new patch for the test.","commit_id":"a6ced4571c09d1ec4cb58faba3c3db5d148b4165"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ff2501f51abc2c25865f84a10bfb35a4c356c11b","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":127,"context_line":"            for agent in cur_agents:"},{"line_number":128,"context_line":"                self.remove_router_from_l3_agent("},{"line_number":129,"context_line":"                    context, agent[\u0027id\u0027], router_id, notify\u003dFalse)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"            new_agent \u003d self.schedule_router(context, router_id,"},{"line_number":132,"context_line":"                                             candidates\u003dcandidates)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAW3%2F%2FzxA%3D","line":129,"updated":"2014-04-10 09:32:25.000000000","message":"do you have any idea to prevent the agent being fetched again in remove_router_from_l3_agent?\n\nI think perhaps it might be worth considering:\n1) not calling at all remove_router_from_l3_agent_here\n\n2) create a method to encapsulate the router-agent binding removal (lines 102-111)\n\n3) call that method here and in remove_router_from_l3_agent\n\nthis might also make the notify parameter superfluous (which is another thing I did not like a lot, but just because I don\u0027t like if statements!)","commit_id":"ab2b63bbe8c20123c7915f1ef40f007068860ece"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a9178bf443c0e0fb6248f60826cece3cb9431d0d","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":127,"context_line":"            for agent in cur_agents:"},{"line_number":128,"context_line":"                self.remove_router_from_l3_agent("},{"line_number":129,"context_line":"                    context, agent[\u0027id\u0027], router_id, notify\u003dFalse)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"            new_agent \u003d self.schedule_router(context, router_id,"},{"line_number":132,"context_line":"                                             candidates\u003dcandidates)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAW3%2F%2FzVw%3D","line":129,"in_reply_to":"AAAAW3%2F%2FzxA%3D","updated":"2014-04-10 11:23:50.000000000","message":"Agree, nice suggestion, thanks!","commit_id":"ab2b63bbe8c20123c7915f1ef40f007068860ece"}],"neutron/db/l3_db.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"d1d96e59361a75deae9d9b25ca4585229d376ae7","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        # check whether router needs and can be rescheduled to the proper l3"},{"line_number":195,"context_line":"        # agent (associated with given external network)"},{"line_number":196,"context_line":"        new_agent_id \u003d self._check_router_needs_reschedulng("},{"line_number":197,"context_line":"            context, router_id, network_id)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        # figure out if we need to delete existing port"},{"line_number":200,"context_line":"        if gw_port and gw_port[\u0027network_id\u0027] !\u003d network_id:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FNBI%3D","line":197,"updated":"2013-10-21 14:11:59.000000000","message":"I\u0027d put call of this into the if statement above. Before if statement declare\n\n new_agent_id \u003d None","commit_id":"7f8831625df3507cf29a493d02105234f2b5b95d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f9573234397d9fe388e1a53b30ec6f8d5dfe6276","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        # check whether router needs and can be rescheduled to the proper l3"},{"line_number":195,"context_line":"        # agent (associated with given external network)"},{"line_number":196,"context_line":"        new_agent_id \u003d self._check_router_needs_reschedulng("},{"line_number":197,"context_line":"            context, router_id, network_id)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        # figure out if we need to delete existing port"},{"line_number":200,"context_line":"        if gw_port and gw_port[\u0027network_id\u0027] !\u003d network_id:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FMsQ%3D","line":197,"in_reply_to":"AAAATH%2F%2FNBI%3D","updated":"2013-10-21 15:20:53.000000000","message":"Done","commit_id":"7f8831625df3507cf29a493d02105234f2b5b95d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a6f73e94f0b146ea60ea0b636b991ad82e5e522a","unresolved":false,"context_lines":[{"line_number":226,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":227,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def _check_router_needs_reschedulng(self, context, router_id, network_id):"},{"line_number":230,"context_line":"        \"\"\"Checks whether router\u0027s l3 agent is associated with given network"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        Each L3 agent can be associated with at most one external network."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FNFo%3D","line":229,"updated":"2013-10-21 14:04:29.000000000","message":"typo: rescheduling","commit_id":"7f8831625df3507cf29a493d02105234f2b5b95d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f9573234397d9fe388e1a53b30ec6f8d5dfe6276","unresolved":false,"context_lines":[{"line_number":226,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":227,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def _check_router_needs_reschedulng(self, context, router_id, network_id):"},{"line_number":230,"context_line":"        \"\"\"Checks whether router\u0027s l3 agent is associated with given network"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        Each L3 agent can be associated with at most one external network."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FMsM%3D","line":229,"in_reply_to":"AAAATH%2F%2FNFo%3D","updated":"2013-10-21 15:20:53.000000000","message":"Done","commit_id":"7f8831625df3507cf29a493d02105234f2b5b95d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a6f73e94f0b146ea60ea0b636b991ad82e5e522a","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        needs to be rescheduled to the proper l3 agent"},{"line_number":235,"context_line":"        :return: agent_id if rescheduling needed, None otherwise"},{"line_number":236,"context_line":"        \"\"\""},{"line_number":237,"context_line":"        if not network_id:"},{"line_number":238,"context_line":"            return"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        nets \u003d self._core_plugin.get_networks("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FNFk%3D","line":237,"updated":"2013-10-21 14:04:29.000000000","message":"I\u0027d recommend:\n\n if network_id is None:\n     return","commit_id":"7f8831625df3507cf29a493d02105234f2b5b95d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f9573234397d9fe388e1a53b30ec6f8d5dfe6276","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        needs to be rescheduled to the proper l3 agent"},{"line_number":235,"context_line":"        :return: agent_id if rescheduling needed, None otherwise"},{"line_number":236,"context_line":"        \"\"\""},{"line_number":237,"context_line":"        if not network_id:"},{"line_number":238,"context_line":"            return"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        nets \u003d self._core_plugin.get_networks("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FMsI%3D","line":237,"in_reply_to":"AAAATH%2F%2FNFk%3D","updated":"2013-10-21 15:20:53.000000000","message":"Done","commit_id":"7f8831625df3507cf29a493d02105234f2b5b95d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a6f73e94f0b146ea60ea0b636b991ad82e5e522a","unresolved":false,"context_lines":[{"line_number":250,"context_line":"        if (not utils.is_extension_supported("},{"line_number":251,"context_line":"                l3_agent_scheduler,"},{"line_number":252,"context_line":"                l3_constants.L3_AGENT_SCHEDULER_EXT_ALIAS) or"},{"line_number":253,"context_line":"            not l3_agent_scheduler.router_scheduler):"},{"line_number":254,"context_line":"            msg \u003d (_(\"Can\u0027t reschedule router to l3 agent associated with \""},{"line_number":255,"context_line":"                     \"external network %s: l3 agent scheduling is not \""},{"line_number":256,"context_line":"                     \"supported\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FNEw%3D","line":253,"updated":"2013-10-21 14:04:29.000000000","message":"l3_agent_scheduler.router_scheduler is None","commit_id":"7f8831625df3507cf29a493d02105234f2b5b95d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f9573234397d9fe388e1a53b30ec6f8d5dfe6276","unresolved":false,"context_lines":[{"line_number":250,"context_line":"        if (not utils.is_extension_supported("},{"line_number":251,"context_line":"                l3_agent_scheduler,"},{"line_number":252,"context_line":"                l3_constants.L3_AGENT_SCHEDULER_EXT_ALIAS) or"},{"line_number":253,"context_line":"            not l3_agent_scheduler.router_scheduler):"},{"line_number":254,"context_line":"            msg \u003d (_(\"Can\u0027t reschedule router to l3 agent associated with \""},{"line_number":255,"context_line":"                     \"external network %s: l3 agent scheduling is not \""},{"line_number":256,"context_line":"                     \"supported\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FMsA%3D","line":253,"in_reply_to":"AAAATH%2F%2FNEw%3D","updated":"2013-10-21 15:20:53.000000000","message":"Done","commit_id":"7f8831625df3507cf29a493d02105234f2b5b95d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"639876621cb338888c22250ca08479944d76e72b","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                        \"network\") % network_id"},{"line_number":193,"context_line":"                raise q_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"},{"line_number":194,"context_line":"            # check whether router needs and can be rescheduled to the proper"},{"line_number":195,"context_line":"            # l3 agent (associated with given external network)"},{"line_number":196,"context_line":"            new_agent_id \u003d self._check_router_needs_rescheduling("},{"line_number":197,"context_line":"                context, router_id, network_id)"},{"line_number":198,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bm%2Bw%3D","line":195,"updated":"2013-11-22 15:23:16.000000000","message":"This comment doesn\u0027t seem to tell me anything that the code doesn\u0027t make clear.  IOW, I know from the code that I\u0027m in a method that is changing the gw info and I\u0027m going to check if the router needs rescheduling.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f390fad705e55f257a029301c1e7aaaf5691b22f","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                        \"network\") % network_id"},{"line_number":193,"context_line":"                raise q_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"},{"line_number":194,"context_line":"            # check whether router needs and can be rescheduled to the proper"},{"line_number":195,"context_line":"            # l3 agent (associated with given external network)"},{"line_number":196,"context_line":"            new_agent_id \u003d self._check_router_needs_rescheduling("},{"line_number":197,"context_line":"                context, router_id, network_id)"},{"line_number":198,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BhGs%3D","line":195,"in_reply_to":"AAAATn%2F%2Bm%2Bw%3D","updated":"2013-11-25 10:55:40.000000000","message":"The comment says why rescheduling might be needed","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fc8108b192d509191b557634f5ca610e901306be","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            self._create_router_gw_port(context, router, network_id)"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"            if new_agent_id:"},{"line_number":225,"context_line":"                scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":226,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":227,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"},{"line_number":228,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Fz4U%3D","line":225,"updated":"2013-10-28 17:35:42.000000000","message":"why are you getting the scheduler from the service plugins getter? Being a mixin class shouldn\u0027t you be able to access the scheduler directly. I am probably missing something.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"54a9cf8895e057aa87ca0f85182e2bc27d387904","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            self._create_router_gw_port(context, router, network_id)"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"            if new_agent_id:"},{"line_number":225,"context_line":"                scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":226,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":227,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"},{"line_number":228,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Fxb8%3D","line":225,"in_reply_to":"AAAATn%2F%2Fz4U%3D","updated":"2013-10-29 10:03:57.000000000","message":"please see my reply below","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"639876621cb338888c22250ca08479944d76e72b","unresolved":false,"context_lines":[{"line_number":226,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":227,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def _check_router_needs_rescheduling(self, context, router_id, network_id):"},{"line_number":230,"context_line":"        \"\"\"Checks whether router\u0027s l3 agent is associated with given network"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        Each L3 agent can be associated with at most one external network."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bm9w%3D","line":229,"updated":"2013-11-22 15:23:16.000000000","message":"The method name could be tweaked a little to make it clear that it is returning a new agent iff the router needs to be rescheduling.\n\nConsider this comment totally optional.  It really wasn\u0027t difficult to understand what you were doing on line 196 given that you captured the return value in \"new_agent_id\"","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"639876621cb338888c22250ca08479944d76e72b","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def _check_router_needs_rescheduling(self, context, router_id, network_id):"},{"line_number":230,"context_line":"        \"\"\"Checks whether router\u0027s l3 agent is associated with given network"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        Each L3 agent can be associated with at most one external network."},{"line_number":233,"context_line":"        If router\u0027s new external gateway is on other network then the router"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bm70%3D","line":230,"updated":"2013-11-22 15:23:16.000000000","message":"Something like:  \"Return new eligible agent id if router\u0027s l3 agent is not on network\" would tell me a little more about this method.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f390fad705e55f257a029301c1e7aaaf5691b22f","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def _check_router_needs_rescheduling(self, context, router_id, network_id):"},{"line_number":230,"context_line":"        \"\"\"Checks whether router\u0027s l3 agent is associated with given network"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        Each L3 agent can be associated with at most one external network."},{"line_number":233,"context_line":"        If router\u0027s new external gateway is on other network then the router"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BhC0%3D","line":230,"in_reply_to":"AAAATn%2F%2Bm70%3D","updated":"2013-11-25 10:55:40.000000000","message":"I don\u0027t think that \u0027l3 agent is not on network\u0027 would be clear for everyone.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"639876621cb338888c22250ca08479944d76e72b","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        nets \u003d self._core_plugin.get_networks("},{"line_number":241,"context_line":"            context, {external_net.EXTERNAL: [True]})"},{"line_number":242,"context_line":"        # nothing to do if there is only one external network"},{"line_number":243,"context_line":"        if len(nets) \u003d\u003d 1:"},{"line_number":244,"context_line":"            return"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"        # first get plugin supporting l3 agent scheduling"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bm7c%3D","line":243,"updated":"2013-11-22 15:23:16.000000000","message":"Is it possible for an l3 agent to not be associated with any external network?","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f390fad705e55f257a029301c1e7aaaf5691b22f","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        nets \u003d self._core_plugin.get_networks("},{"line_number":241,"context_line":"            context, {external_net.EXTERNAL: [True]})"},{"line_number":242,"context_line":"        # nothing to do if there is only one external network"},{"line_number":243,"context_line":"        if len(nets) \u003d\u003d 1:"},{"line_number":244,"context_line":"            return"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"        # first get plugin supporting l3 agent scheduling"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bg8s%3D","line":243,"in_reply_to":"AAAATn%2F%2Bm7c%3D","updated":"2013-11-25 10:55:40.000000000","message":"If there is only one external network then l3 agent is considered to be associated with it (no a need to specify network id in agent\u0027s config). Otherwise each l3 agent should be associated with a particular ext net","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fc8108b192d509191b557634f5ca610e901306be","unresolved":false,"context_lines":[{"line_number":245,"context_line":""},{"line_number":246,"context_line":"        # first get plugin supporting l3 agent scheduling"},{"line_number":247,"context_line":"        # (either l3 service plugin or core_plugin)"},{"line_number":248,"context_line":"        l3_agent_scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":249,"context_line":"            constants.L3_ROUTER_NAT)"},{"line_number":250,"context_line":"        if (not utils.is_extension_supported("},{"line_number":251,"context_line":"                l3_agent_scheduler,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Fz4I%3D","line":248,"updated":"2013-10-28 17:35:42.000000000","message":"ditto","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"54a9cf8895e057aa87ca0f85182e2bc27d387904","unresolved":false,"context_lines":[{"line_number":245,"context_line":""},{"line_number":246,"context_line":"        # first get plugin supporting l3 agent scheduling"},{"line_number":247,"context_line":"        # (either l3 service plugin or core_plugin)"},{"line_number":248,"context_line":"        l3_agent_scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":249,"context_line":"            constants.L3_ROUTER_NAT)"},{"line_number":250,"context_line":"        if (not utils.is_extension_supported("},{"line_number":251,"context_line":"                l3_agent_scheduler,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2FxcA%3D","line":248,"in_reply_to":"AAAATn%2F%2Fz4I%3D","updated":"2013-10-29 10:03:57.000000000","message":"At this point we need to ensure that l3 agent scheduling is supported. Not sure I got what you mean by access scheduler directly. Since it is a mixin it may be part of either core plugin or l3 service plugin (if used). Anyway service plugins getter will return the correct one. Core plugin however may support router extension but not l3_agent_scheduler extension - so we need to check it as well (#250)","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"639876621cb338888c22250ca08479944d76e72b","unresolved":false,"context_lines":[{"line_number":258,"context_line":"            LOG.warning(msg)"},{"line_number":259,"context_line":"            return"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"        # get l3 agent(s) currently hosting the router"},{"line_number":262,"context_line":"        cur_agents \u003d l3_agent_scheduler.list_l3_agents_hosting_router("},{"line_number":263,"context_line":"            context, router_id)[\u0027agents\u0027]"},{"line_number":264,"context_line":"        # check agent\u0027s gateway_external_network_id"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bm6I%3D","line":261,"updated":"2013-11-22 15:23:16.000000000","message":"Comment doesn\u0027t tell me anything that the code doesn\u0027t make clear.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f390fad705e55f257a029301c1e7aaaf5691b22f","unresolved":false,"context_lines":[{"line_number":258,"context_line":"            LOG.warning(msg)"},{"line_number":259,"context_line":"            return"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"        # get l3 agent(s) currently hosting the router"},{"line_number":262,"context_line":"        cur_agents \u003d l3_agent_scheduler.list_l3_agents_hosting_router("},{"line_number":263,"context_line":"            context, router_id)[\u0027agents\u0027]"},{"line_number":264,"context_line":"        # check agent\u0027s gateway_external_network_id"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bg40%3D","line":261,"in_reply_to":"AAAATn%2F%2Bm6I%3D","updated":"2013-11-25 10:55:40.000000000","message":"ok, I\u0027ll remove","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"639876621cb338888c22250ca08479944d76e72b","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        # get l3 agent(s) currently hosting the router"},{"line_number":262,"context_line":"        cur_agents \u003d l3_agent_scheduler.list_l3_agents_hosting_router("},{"line_number":263,"context_line":"            context, router_id)[\u0027agents\u0027]"},{"line_number":264,"context_line":"        # check agent\u0027s gateway_external_network_id"},{"line_number":265,"context_line":"        # if it matches with given network_id then nothing needs to be done"},{"line_number":266,"context_line":"        for agent in cur_agents:"},{"line_number":267,"context_line":"            if agent[\u0027configurations\u0027]["}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bm5w%3D","line":264,"updated":"2013-11-22 15:23:16.000000000","message":"This comment seems to be slightly misleading.  A more accurate comment might be:  \"check to see if any of the agents gateway_external_network_id matches the given network.  If any of them does, nothing needs to be done.\"\n\nHowever, I don\u0027t think that this comment clarifies anything that I cannot easily understand from the code.  I would just remove the comment.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f390fad705e55f257a029301c1e7aaaf5691b22f","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        # get l3 agent(s) currently hosting the router"},{"line_number":262,"context_line":"        cur_agents \u003d l3_agent_scheduler.list_l3_agents_hosting_router("},{"line_number":263,"context_line":"            context, router_id)[\u0027agents\u0027]"},{"line_number":264,"context_line":"        # check agent\u0027s gateway_external_network_id"},{"line_number":265,"context_line":"        # if it matches with given network_id then nothing needs to be done"},{"line_number":266,"context_line":"        for agent in cur_agents:"},{"line_number":267,"context_line":"            if agent[\u0027configurations\u0027]["}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bg6Q%3D","line":264,"in_reply_to":"AAAATn%2F%2Bm5w%3D","updated":"2013-11-25 10:55:40.000000000","message":"why \u0027any of the agents gateway_external_network_id\u0027? Each agent has only one \u0027gateway_external_network_id\u0027. Anyway I\u0027ll remove the comment","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"639876621cb338888c22250ca08479944d76e72b","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        # check agent\u0027s gateway_external_network_id"},{"line_number":265,"context_line":"        # if it matches with given network_id then nothing needs to be done"},{"line_number":266,"context_line":"        for agent in cur_agents:"},{"line_number":267,"context_line":"            if agent[\u0027configurations\u0027]["},{"line_number":268,"context_line":"                \u0027gateway_external_network_id\u0027] \u003d\u003d network_id:"},{"line_number":269,"context_line":"                return"},{"line_number":270,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bm4w%3D","line":267,"updated":"2013-11-22 15:23:16.000000000","message":"This logic is satisfied if one of the agents is associated with the given external network.  Shouldn\u0027t they *all* be associated with the given external network?","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e21946df5f26099a10e9d71b44cf8fc9b3ca40ee","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        # check agent\u0027s gateway_external_network_id"},{"line_number":265,"context_line":"        # if it matches with given network_id then nothing needs to be done"},{"line_number":266,"context_line":"        for agent in cur_agents:"},{"line_number":267,"context_line":"            if agent[\u0027configurations\u0027]["},{"line_number":268,"context_line":"                \u0027gateway_external_network_id\u0027] \u003d\u003d network_id:"},{"line_number":269,"context_line":"                return"},{"line_number":270,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BQ5A%3D","line":267,"in_reply_to":"AAAATn%2F%2BZEw%3D","updated":"2013-11-28 07:19:51.000000000","message":"Well, it\u0027s already written for \u0027one or more agents can host a router\u0027 (see list_l3_agents_hosting_router() returning a list) while in fact there is still a limitation that router can be hosted by only one agent (see add_router_to_l3_agent()) so this inconsistency wasn\u0027t introduced in this patch.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4562c967797d126a6ec5c5ec016002302129d2fe","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        # check agent\u0027s gateway_external_network_id"},{"line_number":265,"context_line":"        # if it matches with given network_id then nothing needs to be done"},{"line_number":266,"context_line":"        for agent in cur_agents:"},{"line_number":267,"context_line":"            if agent[\u0027configurations\u0027]["},{"line_number":268,"context_line":"                \u0027gateway_external_network_id\u0027] \u003d\u003d network_id:"},{"line_number":269,"context_line":"                return"},{"line_number":270,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BZEw%3D","line":267,"in_reply_to":"AAAATn%2F%2BgxY%3D","updated":"2013-11-26 15:49:39.000000000","message":"If only one can host it then why all the for loops?  The code should either be written for \u0027one and only one agent hosting a given router\u0027 or \u0027one or more agents hosting a router.\u0027  I don\u0027t like leaving it in between.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f390fad705e55f257a029301c1e7aaaf5691b22f","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        # check agent\u0027s gateway_external_network_id"},{"line_number":265,"context_line":"        # if it matches with given network_id then nothing needs to be done"},{"line_number":266,"context_line":"        for agent in cur_agents:"},{"line_number":267,"context_line":"            if agent[\u0027configurations\u0027]["},{"line_number":268,"context_line":"                \u0027gateway_external_network_id\u0027] \u003d\u003d network_id:"},{"line_number":269,"context_line":"                return"},{"line_number":270,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BgxY%3D","line":267,"in_reply_to":"AAAATn%2F%2Bm4w%3D","updated":"2013-11-25 10:55:40.000000000","message":"well, currently only one agent can host a router. Anyway if it is changed then I think one agent associated with a given network is enough.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"639876621cb338888c22250ca08479944d76e72b","unresolved":false,"context_lines":[{"line_number":268,"context_line":"                \u0027gateway_external_network_id\u0027] \u003d\u003d network_id:"},{"line_number":269,"context_line":"                return"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"},{"line_number":272,"context_line":"        active_agents \u003d l3_agent_scheduler.get_l3_agents(context, active\u003dTrue)"},{"line_number":273,"context_line":"        for agent in active_agents:"},{"line_number":274,"context_line":"            agent_conf \u003d l3_agent_scheduler.get_configuration_dict(agent)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bm3I%3D","line":271,"updated":"2013-11-22 15:23:16.000000000","message":"Just so you don\u0027t think I hate all comments I\u0027ll say that I like this particular comment.  It concisely summarizes what the next 7 lines of codes are trying to do.  Keep this comment!  :)","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"639876621cb338888c22250ca08479944d76e72b","unresolved":false,"context_lines":[{"line_number":273,"context_line":"        for agent in active_agents:"},{"line_number":274,"context_line":"            agent_conf \u003d l3_agent_scheduler.get_configuration_dict(agent)"},{"line_number":275,"context_line":"            if (agent_conf.get(\u0027gateway_external_network_id\u0027) \u003d\u003d network_id and"},{"line_number":276,"context_line":"                (not agent_conf.get(\u0027router_id\u0027) or"},{"line_number":277,"context_line":"                 agent_conf.get(\u0027router_id\u0027) \u003d\u003d router_id)):"},{"line_number":278,"context_line":"                return agent.id"},{"line_number":279,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bm08%3D","line":276,"updated":"2013-11-22 15:23:16.000000000","message":"Do we need this condition?  Didn\u0027t we already rule out the possibility that this agent already hosts this router above?","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f390fad705e55f257a029301c1e7aaaf5691b22f","unresolved":false,"context_lines":[{"line_number":273,"context_line":"        for agent in active_agents:"},{"line_number":274,"context_line":"            agent_conf \u003d l3_agent_scheduler.get_configuration_dict(agent)"},{"line_number":275,"context_line":"            if (agent_conf.get(\u0027gateway_external_network_id\u0027) \u003d\u003d network_id and"},{"line_number":276,"context_line":"                (not agent_conf.get(\u0027router_id\u0027) or"},{"line_number":277,"context_line":"                 agent_conf.get(\u0027router_id\u0027) \u003d\u003d router_id)):"},{"line_number":278,"context_line":"                return agent.id"},{"line_number":279,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BgwE%3D","line":276,"in_reply_to":"AAAATn%2F%2Bm08%3D","updated":"2013-11-25 10:55:40.000000000","message":"agent may be configured to host only one router with a particular id (namespaces are not supported, see router_id config description in l3 agent) - in this case we can\u0027t schedule another router to that agent","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":7576,"name":"Gary Duan","email":"garyduan@gmail.com","username":"garyduan"},"change_message_id":"3081926030c3fae5a2867c843e760e473653dc83","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":226,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":227,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def _check_router_needs_rescheduling(self, context, router_id, network_id):"},{"line_number":230,"context_line":"        \"\"\"Checks whether router\u0027s l3 agent is associated with given network"},{"line_number":231,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F920c%3D","line":228,"updated":"2013-12-05 07:12:08.000000000","message":"It\u0027s better to check if the router is bound to L3 agent or not by calling get_l3_agent_candidates(). If service type framework is supported in L3 service, it\u0027s possible that the router is not managed by L3 agent while L3 plugin does support L3 agent scheduler.","commit_id":"9361709ab930a59633a2fea0a2aea8faa9f31af8"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ba990710a144097958c466a22d7b5ca6141a59bd","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":226,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":227,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def _check_router_needs_rescheduling(self, context, router_id, network_id):"},{"line_number":230,"context_line":"        \"\"\"Checks whether router\u0027s l3 agent is associated with given network"},{"line_number":231,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F92nk%3D","line":228,"in_reply_to":"AAAATn%2F920c%3D","updated":"2013-12-05 08:21:21.000000000","message":"Not sure how get_l3_agent_candidates() can tell if router is bound to L3 agent. Can you please clarify your suggestion?","commit_id":"9361709ab930a59633a2fea0a2aea8faa9f31af8"},{"author":{"_account_id":7576,"name":"Gary Duan","email":"garyduan@gmail.com","username":"garyduan"},"change_message_id":"6e640ae4875f549ef24e6304e452bd943cbd1c83","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":226,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":227,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def _check_router_needs_rescheduling(self, context, router_id, network_id):"},{"line_number":230,"context_line":"        \"\"\"Checks whether router\u0027s l3 agent is associated with given network"},{"line_number":231,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9zqM%3D","line":228,"in_reply_to":"AAAATn%2F92nk%3D","updated":"2013-12-05 17:42:33.000000000","message":"get_l3_agent_candidates() returns a list of L3 agents can host the router. If router is not bound to L3 agent, it should return an empty list. I think logically it\u0027s a valid hook that can be used.","commit_id":"9361709ab930a59633a2fea0a2aea8faa9f31af8"},{"author":{"_account_id":7576,"name":"Gary Duan","email":"garyduan@gmail.com","username":"garyduan"},"change_message_id":"bf049a4a5f1c706d90e8827140fd55c150199f97","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":226,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":227,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def _check_router_needs_rescheduling(self, context, router_id, network_id):"},{"line_number":230,"context_line":"        \"\"\"Checks whether router\u0027s l3 agent is associated with given network"},{"line_number":231,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9t3Y%3D","line":228,"in_reply_to":"AAAATn%2F9woA%3D","updated":"2013-12-06 19:35:39.000000000","message":"OK. I guess I can add a function to check if a router supports an extension or not.","commit_id":"9361709ab930a59633a2fea0a2aea8faa9f31af8"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ce585288039c9441ca04e96c4bdf468966180c81","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":226,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":227,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def _check_router_needs_rescheduling(self, context, router_id, network_id):"},{"line_number":230,"context_line":"        \"\"\"Checks whether router\u0027s l3 agent is associated with given network"},{"line_number":231,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9woA%3D","line":228,"in_reply_to":"AAAATn%2F9zqM%3D","updated":"2013-12-06 09:34:51.000000000","message":"You\u0027re right, but currently the problem with get_l3_agent_candidates() is that it will always return empty list at this point - see https://github.com/openstack/neutron/blob/master/neutron/db/l3_agentschedulers_db.py#L231-L234 - router has not external_gateway_info yet and only one agent may have  handle_internal_only_routers set to True.\n\nI think when service type framework is supported there should be a separate checks showing if the router is bound to l3 agent or not, so this check should be added here as well.","commit_id":"9361709ab930a59633a2fea0a2aea8faa9f31af8"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"604b379115a4d3baf80d39c1a83bae4d30462c7a","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        active_agents \u003d l3_agent_scheduler.get_l3_agents(context, active\u003dTrue)"},{"line_number":270,"context_line":"        for agent in active_agents:"},{"line_number":271,"context_line":"            agent_conf \u003d l3_agent_scheduler.get_configuration_dict(agent)"},{"line_number":272,"context_line":"            if (agent_conf.get(\u0027gateway_external_network_id\u0027) \u003d\u003d network_id and"},{"line_number":273,"context_line":"                (not agent_conf.get(\u0027router_id\u0027) or"},{"line_number":274,"context_line":"                 agent_conf.get(\u0027router_id\u0027) \u003d\u003d router_id)):"},{"line_number":275,"context_line":"                return agent.id"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F8ykk%3D","line":272,"updated":"2013-12-20 09:31:02.000000000","message":"This patch https://review.openstack.org/#/c/59359, allows a l3 agent to handle all networks. In that case the gateway_external_network_id is set to *. IMHO this patch should depend on it and reworked in order to manage this specific case ?","commit_id":"9361709ab930a59633a2fea0a2aea8faa9f31af8"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"5370523628654548415af92a198274cd163ae1ce","unresolved":false,"context_lines":[{"line_number":258,"context_line":"                     \"external network %s: l3 agent scheduling is not \""},{"line_number":259,"context_line":"                     \"supported\")"},{"line_number":260,"context_line":"                   % network_id)"},{"line_number":261,"context_line":"            LOG.warning(msg)"},{"line_number":262,"context_line":"            return"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"        cur_agents \u003d l3_agent_scheduler.list_l3_agents_hosting_router("}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAU3%2F%2F6KE%3D","line":261,"updated":"2014-02-24 05:52:06.000000000","message":"If l3-agent is used, LOG.warning sounds reasonable, but it is really strange for plugins without l3-agent. l3_db.py is a common backend-free db implementation, so the code should not assume agent-based implementation.","commit_id":"782c9429ad2381a4920cb533755e81dccce2a908"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"c0e659698d5ee784c6120c047bbb06233772b16b","unresolved":false,"context_lines":[{"line_number":258,"context_line":"                     \"external network %s: l3 agent scheduling is not \""},{"line_number":259,"context_line":"                     \"supported\")"},{"line_number":260,"context_line":"                   % network_id)"},{"line_number":261,"context_line":"            LOG.warning(msg)"},{"line_number":262,"context_line":"            return"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"        cur_agents \u003d l3_agent_scheduler.list_l3_agents_hosting_router("}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAU3%2F%2F4Tg%3D","line":261,"in_reply_to":"AAAAU3%2F%2F6KE%3D","updated":"2014-02-24 10:24:05.000000000","message":"ok, I\u0027ll remove this warn log","commit_id":"782c9429ad2381a4920cb533755e81dccce2a908"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"d583a5820d4196a8d6b25e1a3e3564d5845c13cb","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                                                  subnet[\u0027cidr\u0027])"},{"line_number":221,"context_line":"            self._create_router_gw_port(context, router, network_id)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"            if new_agent_id:"},{"line_number":224,"context_line":"                scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":225,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":226,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAU3%2F%2FbY8%3D","line":223,"updated":"2014-02-26 17:55:28.000000000","message":"Rescheduling is not an obvious side effect of this method given that method name indicates that it\u0027s purpose to update gw info.","commit_id":"b9c73754a978da7555b9110362fa3fbb2c96f6c9"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"559ef2f49494468daa78b652a58f71dc6f261681","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                                                  subnet[\u0027cidr\u0027])"},{"line_number":221,"context_line":"            self._create_router_gw_port(context, router, network_id)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"            if new_agent_id:"},{"line_number":224,"context_line":"                scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":225,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":226,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAVX%2F%2F570%3D","line":223,"in_reply_to":"AAAAU3%2F%2FbY8%3D","updated":"2014-02-27 13:32:37.000000000","message":"The only option I can think of is to introduce new rpc call from l3 agent to plugin which will inform plugin that router needs to be rescheduled. It may be called here:\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/l3_agent.py#L719\n\nWhat do you think?","commit_id":"b9c73754a978da7555b9110362fa3fbb2c96f6c9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4aa4914073cdd17c57592069a6daee5b13fa93f4","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                                                  subnet[\u0027cidr\u0027])"},{"line_number":221,"context_line":"            self._create_router_gw_port(context, router, network_id)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"            if new_agent_id:"},{"line_number":224,"context_line":"                scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":225,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":226,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAVX%2F%2F21g%3D","line":223,"in_reply_to":"AAAAVX%2F%2F4fQ%3D","updated":"2014-02-27 19:41:37.000000000","message":"It makes sense.","commit_id":"b9c73754a978da7555b9110362fa3fbb2c96f6c9"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bb1c4c51ada05de547a1b80dd9a5cc524b3296b3","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                                                  subnet[\u0027cidr\u0027])"},{"line_number":221,"context_line":"            self._create_router_gw_port(context, router, network_id)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"            if new_agent_id:"},{"line_number":224,"context_line":"                scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":225,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":226,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAVX%2F%2F4fQ%3D","line":223,"in_reply_to":"AAAAVX%2F%2F4nc%3D","updated":"2014-02-27 16:02:55.000000000","message":"Good thought. I agree with Mark.","commit_id":"b9c73754a978da7555b9110362fa3fbb2c96f6c9"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"279ae9cbf1a07581a7539a6cb7f635032a19e846","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                                                  subnet[\u0027cidr\u0027])"},{"line_number":221,"context_line":"            self._create_router_gw_port(context, router, network_id)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"            if new_agent_id:"},{"line_number":224,"context_line":"                scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":225,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":226,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAVX%2F%2Fy%2Fw%3D","line":223,"in_reply_to":"AAAAVX%2F%2F4nc%3D","updated":"2014-02-28 07:57:46.000000000","message":"Thanks for the suggestion!","commit_id":"b9c73754a978da7555b9110362fa3fbb2c96f6c9"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"0d4645efa317eefe33ef64e44f1df84d28f98b94","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                                                  subnet[\u0027cidr\u0027])"},{"line_number":221,"context_line":"            self._create_router_gw_port(context, router, network_id)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"            if new_agent_id:"},{"line_number":224,"context_line":"                scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":225,"context_line":"                    constants.L3_ROUTER_NAT)"},{"line_number":226,"context_line":"                scheduler.reschedule_router(context, new_agent_id, router_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAVX%2F%2F4nc%3D","line":223,"in_reply_to":"AAAAVX%2F%2F570%3D","updated":"2014-02-27 15:50:21.000000000","message":"I don\u0027t think we need a new RPC call. I was more thinking we should add a method in update_router() that calls the check method below and then contains the rescheduling logic in 223-226.  Seems like we should be able to call the new method around line 151.","commit_id":"b9c73754a978da7555b9110362fa3fbb2c96f6c9"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"d583a5820d4196a8d6b25e1a3e3564d5845c13cb","unresolved":false,"context_lines":[{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"},{"line_number":272,"context_line":"        active_agents \u003d l3_agent_scheduler.get_l3_agents(context, active\u003dTrue)"},{"line_number":273,"context_line":"        for agent in active_agents:"},{"line_number":274,"context_line":"            agent_conf \u003d l3_agent_scheduler.get_configuration_dict(agent)"},{"line_number":275,"context_line":"            ext_net_id \u003d agent_conf.get(\u0027gateway_external_network_id\u0027)"},{"line_number":276,"context_line":"            ext_bridge \u003d agent_conf.get(\u0027external_network_bridge\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAU3%2F%2FbY0%3D","line":273,"updated":"2014-02-26 17:55:28.000000000","message":"Seems like we want to filter in the database vs filtering within python.","commit_id":"b9c73754a978da7555b9110362fa3fbb2c96f6c9"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"559ef2f49494468daa78b652a58f71dc6f261681","unresolved":false,"context_lines":[{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"},{"line_number":272,"context_line":"        active_agents \u003d l3_agent_scheduler.get_l3_agents(context, active\u003dTrue)"},{"line_number":273,"context_line":"        for agent in active_agents:"},{"line_number":274,"context_line":"            agent_conf \u003d l3_agent_scheduler.get_configuration_dict(agent)"},{"line_number":275,"context_line":"            ext_net_id \u003d agent_conf.get(\u0027gateway_external_network_id\u0027)"},{"line_number":276,"context_line":"            ext_bridge \u003d agent_conf.get(\u0027external_network_bridge\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAVX%2F%2F7o4%3D","line":273,"in_reply_to":"AAAAU3%2F%2FbY0%3D","updated":"2014-02-27 13:32:37.000000000","message":"agent configuration is stored as a json dict string so it\u0027s not possible to filter right in the db","commit_id":"b9c73754a978da7555b9110362fa3fbb2c96f6c9"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"0d4645efa317eefe33ef64e44f1df84d28f98b94","unresolved":false,"context_lines":[{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"},{"line_number":272,"context_line":"        active_agents \u003d l3_agent_scheduler.get_l3_agents(context, active\u003dTrue)"},{"line_number":273,"context_line":"        for agent in active_agents:"},{"line_number":274,"context_line":"            agent_conf \u003d l3_agent_scheduler.get_configuration_dict(agent)"},{"line_number":275,"context_line":"            ext_net_id \u003d agent_conf.get(\u0027gateway_external_network_id\u0027)"},{"line_number":276,"context_line":"            ext_bridge \u003d agent_conf.get(\u0027external_network_bridge\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAVX%2F%2F4m4%3D","line":273,"in_reply_to":"AAAAVX%2F%2F7o4%3D","updated":"2014-02-27 15:50:21.000000000","message":"You\u0027re right.  Thanks for correcting me.","commit_id":"b9c73754a978da7555b9110362fa3fbb2c96f6c9"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"7389f1883d764f8e9c67c4eaa5fdeedff8bf1771","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                \u0027gateway_external_network_id\u0027)"},{"line_number":210,"context_line":"            ext_bridge \u003d agent[\u0027configurations\u0027].get(\u0027external_network_bridge\u0027)"},{"line_number":211,"context_line":"            if (ext_net_id \u003d\u003d network_id or"},{"line_number":212,"context_line":"                    (ext_net_id \u003d\u003d \u0027\u0027 and ext_bridge \u003d\u003d \u0027\u0027)):"},{"line_number":213,"context_line":"                return"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2Fkbw%3D","line":212,"updated":"2014-03-05 12:12:13.000000000","message":"nit: (not ext_id and not ext_bridge)","commit_id":"94926621fce5969a41d65934d4af6e033edba6dd"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ebb496cf01247c9c0fcf77d78420850d5f81a1ce","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                \u0027gateway_external_network_id\u0027)"},{"line_number":210,"context_line":"            ext_bridge \u003d agent[\u0027configurations\u0027].get(\u0027external_network_bridge\u0027)"},{"line_number":211,"context_line":"            if (ext_net_id \u003d\u003d network_id or"},{"line_number":212,"context_line":"                    (ext_net_id \u003d\u003d \u0027\u0027 and ext_bridge \u003d\u003d \u0027\u0027)):"},{"line_number":213,"context_line":"                return"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2FEc4%3D","line":212,"in_reply_to":"AAAAVn%2F%2Fi7Q%3D","updated":"2014-03-10 08:19:21.000000000","message":"interesting:  not \u0027\u0027 \u003d\u003d True,   I didn\u0027t know that :)\n\nnot ext_net_id and not ext_bridge is more \"idiomatic\"","commit_id":"94926621fce5969a41d65934d4af6e033edba6dd"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"37ba51f14e4e472c9352f436d1b145dd7c296910","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                \u0027gateway_external_network_id\u0027)"},{"line_number":210,"context_line":"            ext_bridge \u003d agent[\u0027configurations\u0027].get(\u0027external_network_bridge\u0027)"},{"line_number":211,"context_line":"            if (ext_net_id \u003d\u003d network_id or"},{"line_number":212,"context_line":"                    (ext_net_id \u003d\u003d \u0027\u0027 and ext_bridge \u003d\u003d \u0027\u0027)):"},{"line_number":213,"context_line":"                return"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2Fi7Q%3D","line":212,"in_reply_to":"AAAAVn%2F%2Fkbw%3D","updated":"2014-03-05 14:01:43.000000000","message":"I guess this doesn\u0027t reflect the requirement of having values in config empty. i.e. empty string","commit_id":"94926621fce5969a41d65934d4af6e033edba6dd"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e6d3572446d7796cd50cbb828b4fe3968b01ccc3","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                \u0027gateway_external_network_id\u0027)"},{"line_number":210,"context_line":"            ext_bridge \u003d agent[\u0027configurations\u0027].get(\u0027external_network_bridge\u0027)"},{"line_number":211,"context_line":"            if (ext_net_id \u003d\u003d network_id or"},{"line_number":212,"context_line":"                    (ext_net_id \u003d\u003d \u0027\u0027 and ext_bridge \u003d\u003d \u0027\u0027)):"},{"line_number":213,"context_line":"                return"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2FijU%3D","line":212,"in_reply_to":"AAAAVn%2F%2Fkbw%3D","updated":"2014-03-11 14:29:13.000000000","message":"No strong opinion on this, will change according to Sylvain\u0027s suggestion","commit_id":"94926621fce5969a41d65934d4af6e033edba6dd"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"7389f1883d764f8e9c67c4eaa5fdeedff8bf1771","unresolved":false,"context_lines":[{"line_number":212,"context_line":"                    (ext_net_id \u003d\u003d \u0027\u0027 and ext_bridge \u003d\u003d \u0027\u0027)):"},{"line_number":213,"context_line":"                return"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"},{"line_number":216,"context_line":"        active_agents \u003d l3_agent_scheduler.get_l3_agents(context, active\u003dTrue)"},{"line_number":217,"context_line":"        for agent in active_agents:"},{"line_number":218,"context_line":"            agent_conf \u003d l3_agent_scheduler.get_configuration_dict(agent)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2Fju0%3D","line":215,"updated":"2014-03-05 12:12:13.000000000","message":"I seems this should be done by the scheduler in order to be sure that the chosen scheduling strategy is respected ? Now l3 agents are able to handle any networks.","commit_id":"94926621fce5969a41d65934d4af6e033edba6dd"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e6d3572446d7796cd50cbb828b4fe3968b01ccc3","unresolved":false,"context_lines":[{"line_number":212,"context_line":"                    (ext_net_id \u003d\u003d \u0027\u0027 and ext_bridge \u003d\u003d \u0027\u0027)):"},{"line_number":213,"context_line":"                return"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"},{"line_number":216,"context_line":"        active_agents \u003d l3_agent_scheduler.get_l3_agents(context, active\u003dTrue)"},{"line_number":217,"context_line":"        for agent in active_agents:"},{"line_number":218,"context_line":"            agent_conf \u003d l3_agent_scheduler.get_configuration_dict(agent)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2B48k%3D","line":215,"in_reply_to":"AAAAVn%2F%2FD8U%3D","updated":"2014-03-11 14:29:13.000000000","message":"Will use the confugured scheduler when rescheduling router","commit_id":"94926621fce5969a41d65934d4af6e033edba6dd"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"96602df01ae12b65115823da69a17b2d9e442830","unresolved":false,"context_lines":[{"line_number":212,"context_line":"                    (ext_net_id \u003d\u003d \u0027\u0027 and ext_bridge \u003d\u003d \u0027\u0027)):"},{"line_number":213,"context_line":"                return"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"},{"line_number":216,"context_line":"        active_agents \u003d l3_agent_scheduler.get_l3_agents(context, active\u003dTrue)"},{"line_number":217,"context_line":"        for agent in active_agents:"},{"line_number":218,"context_line":"            agent_conf \u003d l3_agent_scheduler.get_configuration_dict(agent)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2FD8U%3D","line":215,"in_reply_to":"AAAAVn%2F%2FEX4%3D","updated":"2014-03-10 09:42:13.000000000","message":"Ok, but there are many l3 scheduler, random, least, etc soon a HAScheduler and the constraint that will be introduced will have to be respected.","commit_id":"94926621fce5969a41d65934d4af6e033edba6dd"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ebb496cf01247c9c0fcf77d78420850d5f81a1ce","unresolved":false,"context_lines":[{"line_number":212,"context_line":"                    (ext_net_id \u003d\u003d \u0027\u0027 and ext_bridge \u003d\u003d \u0027\u0027)):"},{"line_number":213,"context_line":"                return"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"},{"line_number":216,"context_line":"        active_agents \u003d l3_agent_scheduler.get_l3_agents(context, active\u003dTrue)"},{"line_number":217,"context_line":"        for agent in active_agents:"},{"line_number":218,"context_line":"            agent_conf \u003d l3_agent_scheduler.get_configuration_dict(agent)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2FEX4%3D","line":215,"in_reply_to":"AAAAVn%2F%2Fju0%3D","updated":"2014-03-10 08:19:21.000000000","message":"You setup specific l3 agents to handle specific network_ids , or be just generic and handle any external network.\n\nI think that\u0027s what Oleg means.","commit_id":"94926621fce5969a41d65934d4af6e033edba6dd"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"7389f1883d764f8e9c67c4eaa5fdeedff8bf1771","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            ext_net_id \u003d agent_conf.get(\u0027gateway_external_network_id\u0027)"},{"line_number":220,"context_line":"            ext_bridge \u003d agent_conf.get(\u0027external_network_bridge\u0027)"},{"line_number":221,"context_line":"            if ((ext_net_id \u003d\u003d network_id or"},{"line_number":222,"context_line":"                 (ext_net_id \u003d\u003d \u0027\u0027 and ext_bridge \u003d\u003d \u0027\u0027)) and"},{"line_number":223,"context_line":"                (not agent_conf.get(\u0027router_id\u0027) or"},{"line_number":224,"context_line":"                 agent_conf.get(\u0027router_id\u0027) \u003d\u003d router_id)):"},{"line_number":225,"context_line":"                return agent.id"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2Fkaw%3D","line":222,"updated":"2014-03-05 12:12:13.000000000","message":"nit: same here","commit_id":"94926621fce5969a41d65934d4af6e033edba6dd"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e6d3572446d7796cd50cbb828b4fe3968b01ccc3","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            ext_net_id \u003d agent_conf.get(\u0027gateway_external_network_id\u0027)"},{"line_number":220,"context_line":"            ext_bridge \u003d agent_conf.get(\u0027external_network_bridge\u0027)"},{"line_number":221,"context_line":"            if ((ext_net_id \u003d\u003d network_id or"},{"line_number":222,"context_line":"                 (ext_net_id \u003d\u003d \u0027\u0027 and ext_bridge \u003d\u003d \u0027\u0027)) and"},{"line_number":223,"context_line":"                (not agent_conf.get(\u0027router_id\u0027) or"},{"line_number":224,"context_line":"                 agent_conf.get(\u0027router_id\u0027) \u003d\u003d router_id)):"},{"line_number":225,"context_line":"                return agent.id"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2B6SA%3D","line":222,"in_reply_to":"AAAAVn%2F%2Fkaw%3D","updated":"2014-03-11 14:29:13.000000000","message":"Done","commit_id":"94926621fce5969a41d65934d4af6e033edba6dd"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"41a2eb0d1a7cd740346f80faf2173456488eb0ec","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            if r.keys():"},{"line_number":159,"context_line":"                router_db.update(r)"},{"line_number":160,"context_line":"        if reschedule:"},{"line_number":161,"context_line":"            scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":162,"context_line":"                constants.L3_ROUTER_NAT)"},{"line_number":163,"context_line":"            scheduler.reschedule_router(context, id)"},{"line_number":164,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAWH%2F%2B3UM%3D","line":161,"updated":"2014-03-22 14:20:14.000000000","message":"Nit: I prefer l3_plugin to scheduler.","commit_id":"a6ced4571c09d1ec4cb58faba3c3db5d148b4165"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2704382252f6f5216a9fd732260f7339af165922","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            if r.keys():"},{"line_number":159,"context_line":"                router_db.update(r)"},{"line_number":160,"context_line":"        if reschedule:"},{"line_number":161,"context_line":"            scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":162,"context_line":"                constants.L3_ROUTER_NAT)"},{"line_number":163,"context_line":"            scheduler.reschedule_router(context, id)"},{"line_number":164,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAWH%2F%2Boj4%3D","line":161,"in_reply_to":"AAAAWH%2F%2B3UM%3D","updated":"2014-03-25 12:45:39.000000000","message":"Done","commit_id":"a6ced4571c09d1ec4cb58faba3c3db5d148b4165"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"41a2eb0d1a7cd740346f80faf2173456488eb0ec","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        If external_network_bridge is not set then the agent"},{"line_number":177,"context_line":"        can support multiple external networks and rescheduling is not needed"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        :return: True if rescheduling needed, None otherwise; raises"},{"line_number":180,"context_line":"        exception if there is no eligible l3 agent associated with target"},{"line_number":181,"context_line":"        external network"},{"line_number":182,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAWH%2F%2B3T8%3D","line":179,"updated":"2014-03-22 14:20:14.000000000","message":"Nit: True/False looks better than True/None.","commit_id":"a6ced4571c09d1ec4cb58faba3c3db5d148b4165"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2704382252f6f5216a9fd732260f7339af165922","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        If external_network_bridge is not set then the agent"},{"line_number":177,"context_line":"        can support multiple external networks and rescheduling is not needed"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        :return: True if rescheduling needed, None otherwise; raises"},{"line_number":180,"context_line":"        exception if there is no eligible l3 agent associated with target"},{"line_number":181,"context_line":"        external network"},{"line_number":182,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAWH%2F%2Bojc%3D","line":179,"in_reply_to":"AAAAWH%2F%2B3T8%3D","updated":"2014-03-25 12:45:39.000000000","message":"Done","commit_id":"a6ced4571c09d1ec4cb58faba3c3db5d148b4165"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"41a2eb0d1a7cd740346f80faf2173456488eb0ec","unresolved":false,"context_lines":[{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        # first get plugin supporting l3 agent scheduling"},{"line_number":194,"context_line":"        # (either l3 service plugin or core_plugin)"},{"line_number":195,"context_line":"        l3_agent_scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":196,"context_line":"            constants.L3_ROUTER_NAT)"},{"line_number":197,"context_line":"        if (not utils.is_extension_supported("},{"line_number":198,"context_line":"                l3_agent_scheduler,"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAWH%2F%2B3UQ%3D","line":195,"updated":"2014-03-22 14:20:14.000000000","message":"Nit: I prefer l3_plugin to l3_agent_scheduler.\n\nIt looks a bit tricky that l3_agent_scheduler does not support l3-agent-scheduler exntesion","commit_id":"a6ced4571c09d1ec4cb58faba3c3db5d148b4165"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2704382252f6f5216a9fd732260f7339af165922","unresolved":false,"context_lines":[{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        # first get plugin supporting l3 agent scheduling"},{"line_number":194,"context_line":"        # (either l3 service plugin or core_plugin)"},{"line_number":195,"context_line":"        l3_agent_scheduler \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":196,"context_line":"            constants.L3_ROUTER_NAT)"},{"line_number":197,"context_line":"        if (not utils.is_extension_supported("},{"line_number":198,"context_line":"                l3_agent_scheduler,"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAWH%2F%2BojE%3D","line":195,"in_reply_to":"AAAAWH%2F%2B3UQ%3D","updated":"2014-03-25 12:45:39.000000000","message":"Done","commit_id":"a6ced4571c09d1ec4cb58faba3c3db5d148b4165"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"38dcc2136d51de4190588c9b655551dcf12c4491","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            \u0027id\u0027: router_id,"},{"line_number":219,"context_line":"            \u0027external_gateway_info\u0027: {\u0027network_id\u0027: network_id}"},{"line_number":220,"context_line":"        }"},{"line_number":221,"context_line":"        candidates \u003d l3_plugin.get_l3_agent_candidates("},{"line_number":222,"context_line":"            router, active_agents)"},{"line_number":223,"context_line":"        if candidates:"},{"line_number":224,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAWH%2F96CM%3D","line":221,"updated":"2014-04-01 09:36:33.000000000","message":"nit : get_l3_agent_candidates is done twice. why don\u0027t you return those candidates and give it to the schedule method of L3Scheduler as an optional parameter, to force the scheduling on those agent?","commit_id":"9d0616ff074c99cc9c49bc9f10820ccf898c2447"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"cca66798f5d3ce39bb89445c147d8aa64ad84867","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            \u0027id\u0027: router_id,"},{"line_number":219,"context_line":"            \u0027external_gateway_info\u0027: {\u0027network_id\u0027: network_id}"},{"line_number":220,"context_line":"        }"},{"line_number":221,"context_line":"        candidates \u003d l3_plugin.get_l3_agent_candidates("},{"line_number":222,"context_line":"            router, active_agents)"},{"line_number":223,"context_line":"        if candidates:"},{"line_number":224,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAW3%2F%2F0SE%3D","line":221,"in_reply_to":"AAAAW3%2F%2F4hU%3D","updated":"2014-04-10 08:39:51.000000000","message":"Ok","commit_id":"9d0616ff074c99cc9c49bc9f10820ccf898c2447"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"eead6deda29e7e8b90d11a26f9b1ff6b422a8af1","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            \u0027id\u0027: router_id,"},{"line_number":219,"context_line":"            \u0027external_gateway_info\u0027: {\u0027network_id\u0027: network_id}"},{"line_number":220,"context_line":"        }"},{"line_number":221,"context_line":"        candidates \u003d l3_plugin.get_l3_agent_candidates("},{"line_number":222,"context_line":"            router, active_agents)"},{"line_number":223,"context_line":"        if candidates:"},{"line_number":224,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAW3%2F%2F4hU%3D","line":221,"in_reply_to":"AAAAWH%2F96CM%3D","updated":"2014-04-09 17:48:29.000000000","message":"Good idea.","commit_id":"9d0616ff074c99cc9c49bc9f10820ccf898c2447"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ff2501f51abc2c25865f84a10bfb35a4c356c11b","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        associated with target external network"},{"line_number":182,"context_line":"        \"\"\""},{"line_number":183,"context_line":"        network_id \u003d gw_info.get(\u0027network_id\u0027) if gw_info else None"},{"line_number":184,"context_line":"        if network_id is None:"},{"line_number":185,"context_line":"            return"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"        nets \u003d self._core_plugin.get_networks("}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAW3%2F%2Fzvg%3D","line":184,"updated":"2014-04-10 09:32:25.000000000","message":"perhaps just:\n\nif not network_id:\n\nwill be enough","commit_id":"ab2b63bbe8c20123c7915f1ef40f007068860ece"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a9178bf443c0e0fb6248f60826cece3cb9431d0d","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        associated with target external network"},{"line_number":182,"context_line":"        \"\"\""},{"line_number":183,"context_line":"        network_id \u003d gw_info.get(\u0027network_id\u0027) if gw_info else None"},{"line_number":184,"context_line":"        if network_id is None:"},{"line_number":185,"context_line":"            return"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"        nets \u003d self._core_plugin.get_networks("}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAW3%2F%2FzS4%3D","line":184,"in_reply_to":"AAAAW3%2F%2Fzvg%3D","updated":"2014-04-10 11:23:50.000000000","message":"sure","commit_id":"ab2b63bbe8c20123c7915f1ef40f007068860ece"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ff2501f51abc2c25865f84a10bfb35a4c356c11b","unresolved":false,"context_lines":[{"line_number":187,"context_line":"        nets \u003d self._core_plugin.get_networks("},{"line_number":188,"context_line":"            context, {external_net.EXTERNAL: [True]})"},{"line_number":189,"context_line":"        # nothing to do if there is only one external network"},{"line_number":190,"context_line":"        if len(nets) \u003d\u003d 1:"},{"line_number":191,"context_line":"            return"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        # first get plugin supporting l3 agent scheduling"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAW3%2F%2FzvU%3D","line":190,"updated":"2014-04-10 09:32:25.000000000","message":"and what if there\u0027s none? ;)","commit_id":"ab2b63bbe8c20123c7915f1ef40f007068860ece"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a9178bf443c0e0fb6248f60826cece3cb9431d0d","unresolved":false,"context_lines":[{"line_number":187,"context_line":"        nets \u003d self._core_plugin.get_networks("},{"line_number":188,"context_line":"            context, {external_net.EXTERNAL: [True]})"},{"line_number":189,"context_line":"        # nothing to do if there is only one external network"},{"line_number":190,"context_line":"        if len(nets) \u003d\u003d 1:"},{"line_number":191,"context_line":"            return"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        # first get plugin supporting l3 agent scheduling"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAW3%2F%2FzRM%3D","line":190,"in_reply_to":"AAAAW3%2F%2FzvU%3D","updated":"2014-04-10 11:23:50.000000000","message":"Well, I believe this shouldn\u0027t happen at this stage, but yes, \u003c\u003d 1 should be less confusing","commit_id":"ab2b63bbe8c20123c7915f1ef40f007068860ece"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ff2501f51abc2c25865f84a10bfb35a4c356c11b","unresolved":false,"context_lines":[{"line_number":200,"context_line":"            l3_plugin.router_scheduler is None):"},{"line_number":201,"context_line":"            # that might mean that we are dealing with non-agent-based"},{"line_number":202,"context_line":"            # implementation of l3 services"},{"line_number":203,"context_line":"            return"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        cur_agents \u003d l3_plugin.list_l3_agents_hosting_router("},{"line_number":206,"context_line":"            context, router_id)[\u0027agents\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAW3%2F%2Fzso%3D","line":203,"updated":"2014-04-10 09:32:25.000000000","message":"The above code block is probably telling us that l3_db is not the right place for this method.\nHowever, I\u0027ve looked around and I think there is not yet an ideal place. In theory the \u0027base\u0027 l3_router plugin could be the \u0027agent based\u0027 plugin, but that is an assumption that needs to be verified.\nAnother place is the agent scheduler itself, but we would need however a hook in l3_db\n\nAlso, there might be agent based monolithic plugins.\nSo I am ok with leaving this code here. A todo note stating that the db manager should not really deal with agent scheduling is welcome.","commit_id":"ab2b63bbe8c20123c7915f1ef40f007068860ece"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a9178bf443c0e0fb6248f60826cece3cb9431d0d","unresolved":false,"context_lines":[{"line_number":200,"context_line":"            l3_plugin.router_scheduler is None):"},{"line_number":201,"context_line":"            # that might mean that we are dealing with non-agent-based"},{"line_number":202,"context_line":"            # implementation of l3 services"},{"line_number":203,"context_line":"            return"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        cur_agents \u003d l3_plugin.list_l3_agents_hosting_router("},{"line_number":206,"context_line":"            context, router_id)[\u0027agents\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAW3%2F%2FzM0%3D","line":203,"in_reply_to":"AAAAW3%2F%2Fzso%3D","updated":"2014-04-10 11:23:50.000000000","message":"will add a todo","commit_id":"ab2b63bbe8c20123c7915f1ef40f007068860ece"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ff2501f51abc2c25865f84a10bfb35a4c356c11b","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                \u0027gateway_external_network_id\u0027)"},{"line_number":210,"context_line":"            ext_bridge \u003d agent[\u0027configurations\u0027].get(\u0027external_network_bridge\u0027)"},{"line_number":211,"context_line":"            if (ext_net_id \u003d\u003d network_id or"},{"line_number":212,"context_line":"                    (not ext_net_id and not ext_bridge)):"},{"line_number":213,"context_line":"                return"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAW3%2F%2FzqA%3D","line":212,"updated":"2014-04-10 09:32:25.000000000","message":"rolling upgrades question: agents running before this change will not send external bridge in their state report. \nIs there a possibility this will imply that a router which should be rescheduled won\u0027t?","commit_id":"ab2b63bbe8c20123c7915f1ef40f007068860ece"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a9178bf443c0e0fb6248f60826cece3cb9431d0d","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                \u0027gateway_external_network_id\u0027)"},{"line_number":210,"context_line":"            ext_bridge \u003d agent[\u0027configurations\u0027].get(\u0027external_network_bridge\u0027)"},{"line_number":211,"context_line":"            if (ext_net_id \u003d\u003d network_id or"},{"line_number":212,"context_line":"                    (not ext_net_id and not ext_bridge)):"},{"line_number":213,"context_line":"                return"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAW3%2F%2Fy6c%3D","line":212,"in_reply_to":"AAAAW3%2F%2FzqA%3D","updated":"2014-04-10 11:23:50.000000000","message":"yeah, it\u0027s better to add not None value (\u0027br-ex\u0027?) as default. Nice catch!","commit_id":"ab2b63bbe8c20123c7915f1ef40f007068860ece"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"db2edf9293eb95b7b4903e500c4ee077c0022042","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        associated with target external network"},{"line_number":182,"context_line":"        \"\"\""},{"line_number":183,"context_line":"        # TODO(obondarev): rethink placement of this func as l3 db manager is"},{"line_number":184,"context_line":"        # not really a proper place for agent scheduling stuff"},{"line_number":185,"context_line":"        network_id \u003d gw_info.get(\u0027network_id\u0027) if gw_info else None"},{"line_number":186,"context_line":"        if not network_id:"},{"line_number":187,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAW3%2F%2Fwus%3D","line":184,"updated":"2014-04-10 15:09:52.000000000","message":"Thanks for adding it. thanks Salavatore too. I totally forgot to comment it. I think splitting base l3_db plugin and l3-agent based impl into separate classes is a good start line.","commit_id":"5f749768676e6739db1e01a03ddb7f3cb43d48f8"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"c2a132f176713f417bbc41ecd7e9da326e22c1a4","unresolved":false,"context_lines":[{"line_number":212,"context_line":"            ext_bridge \u003d agent[\u0027configurations\u0027].get("},{"line_number":213,"context_line":"                \u0027external_network_bridge\u0027, \u0027br-ex\u0027)"},{"line_number":214,"context_line":"            if (ext_net_id \u003d\u003d network_id or"},{"line_number":215,"context_line":"                    (not ext_net_id and not ext_bridge)):"},{"line_number":216,"context_line":"                return"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAW3%2F%2Fw9M%3D","line":215,"updated":"2014-04-10 14:50:09.000000000","message":"Just a question, I am not sure I am following. If at line 212 you set ext_bridge to \"br-ext\" by default, what\u0027s the point of checking here  \"and not ext_bridge\" , this should always be false, right?","commit_id":"5f749768676e6739db1e01a03ddb7f3cb43d48f8"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"db2edf9293eb95b7b4903e500c4ee077c0022042","unresolved":false,"context_lines":[{"line_number":212,"context_line":"            ext_bridge \u003d agent[\u0027configurations\u0027].get("},{"line_number":213,"context_line":"                \u0027external_network_bridge\u0027, \u0027br-ex\u0027)"},{"line_number":214,"context_line":"            if (ext_net_id \u003d\u003d network_id or"},{"line_number":215,"context_line":"                    (not ext_net_id and not ext_bridge)):"},{"line_number":216,"context_line":"                return"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAW3%2F%2Fwvg%3D","line":215,"in_reply_to":"AAAAW3%2F%2Fw9M%3D","updated":"2014-04-10 15:09:52.000000000","message":"It is to support rolling upgrade case based on the comment in the previous patch set. Before l3-agent is upgraded, external_network_bridge is not passed. external_bridge is configurable and it cannot cover a case where external bridge is not the default value \u0027br-ex\u0027, but external_bridge is l3-agent specific configuration and we cannot know its configuration until l3-agent reports it. I think it is a good compromise. We can think this feature does not work until all l3-agent and neutron-server are upgraded and IMO it is a reasonable assumption.\n(Examples not using the default \u0027br-ex\u0027 is an external network with provider network and an external network with OpenFlow controlled).","commit_id":"5f749768676e6739db1e01a03ddb7f3cb43d48f8"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a7cce39cefc319af79d37592a303bfc0b942e0d2","unresolved":false,"context_lines":[{"line_number":212,"context_line":"            ext_bridge \u003d agent[\u0027configurations\u0027].get("},{"line_number":213,"context_line":"                \u0027external_network_bridge\u0027, \u0027br-ex\u0027)"},{"line_number":214,"context_line":"            if (ext_net_id \u003d\u003d network_id or"},{"line_number":215,"context_line":"                    (not ext_net_id and not ext_bridge)):"},{"line_number":216,"context_line":"                return"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAW3%2F%2Fws4%3D","line":215,"in_reply_to":"AAAAW3%2F%2Fw9M%3D","updated":"2014-04-10 15:15:13.000000000","message":"if agent[\u0027configurations\u0027] dict contains \u0027external_network_bridge\u0027 member (upgraded agent) then ext_bridge will be set to this value,  otherwise (non-upgraded agent) ext_bridge will be set to default \u0027br-ex\u0027.","commit_id":"5f749768676e6739db1e01a03ddb7f3cb43d48f8"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5ea931b38936ad52cbd3ef51ae5ec8c5af88217d","unresolved":false,"context_lines":[{"line_number":212,"context_line":"            ext_bridge \u003d agent[\u0027configurations\u0027].get("},{"line_number":213,"context_line":"                \u0027external_network_bridge\u0027, \u0027br-ex\u0027)"},{"line_number":214,"context_line":"            if (ext_net_id \u003d\u003d network_id or"},{"line_number":215,"context_line":"                    (not ext_net_id and not ext_bridge)):"},{"line_number":216,"context_line":"                return"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"        # otherwise find l3 agent with matching gateway_external_network_id"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAW3%2F%2FwU8%3D","line":215,"in_reply_to":"AAAAW3%2F%2Fws4%3D","updated":"2014-04-10 15:53:09.000000000","message":"Thanks Akihiro and Oleg. Got it now!","commit_id":"5f749768676e6739db1e01a03ddb7f3cb43d48f8"}],"neutron/extensions/l3agentscheduler.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"41a2eb0d1a7cd740346f80faf2173456488eb0ec","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"class RouterReschedulingFailed(exceptions.Conflict):"},{"line_number":167,"context_line":"    message \u003d _(\"Failed rescheduling router %(router_id)s: \""},{"line_number":168,"context_line":"                \"no eligible l3 agent found.\")"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"class RouterNotHostedByL3Agent(exceptions.Conflict):"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAWH%2F%2B3T4%3D","line":168,"updated":"2014-03-22 14:20:14.000000000","message":"This message will be returned for router_update (router-gateway-set), so \"rescheduling\" might be surprising for users.\nFor more user-friendly message, how about the following?\n\n  no eligible l3 agent found for the new external network.","commit_id":"a6ced4571c09d1ec4cb58faba3c3db5d148b4165"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2704382252f6f5216a9fd732260f7339af165922","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"class RouterReschedulingFailed(exceptions.Conflict):"},{"line_number":167,"context_line":"    message \u003d _(\"Failed rescheduling router %(router_id)s: \""},{"line_number":168,"context_line":"                \"no eligible l3 agent found.\")"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"class RouterNotHostedByL3Agent(exceptions.Conflict):"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAWH%2F%2BoiE%3D","line":168,"in_reply_to":"AAAAWH%2F%2B2SY%3D","updated":"2014-03-25 12:45:39.000000000","message":"Right, thanks Xu Han Peng.  So this module contains exceptions specific for scheduling","commit_id":"a6ced4571c09d1ec4cb58faba3c3db5d148b4165"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"263376aa843dc40d9ff546c089bd61935201084a","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"class RouterReschedulingFailed(exceptions.Conflict):"},{"line_number":167,"context_line":"    message \u003d _(\"Failed rescheduling router %(router_id)s: \""},{"line_number":168,"context_line":"                \"no eligible l3 agent found.\")"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"class RouterNotHostedByL3Agent(exceptions.Conflict):"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAWH%2F%2B2SY%3D","line":168,"in_reply_to":"AAAAWH%2F%2B3T4%3D","updated":"2014-03-23 08:30:35.000000000","message":"Akihiro, I think this exception is actually from reschedule_router after the check is done. \n\nDuring the check, if no eligible agent is found for the new externel network, a BadRequest exception is used instead, according to line 228 in l3_db.py in this patch.","commit_id":"a6ced4571c09d1ec4cb58faba3c3db5d148b4165"}],"neutron/tests/unit/test_agent_ext_plugin.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"639876621cb338888c22250ca08479944d76e72b","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                              time\u003dtimeutils.strtime())"},{"line_number":165,"context_line":"        return [dhcp_host]"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _register_one_l3_agent(self, host\u003dL3_HOSTA, internal_only\u003dTrue,"},{"line_number":168,"context_line":"                               ext_net_id\u003dNone):"},{"line_number":169,"context_line":"        l3 \u003d {"},{"line_number":170,"context_line":"            \u0027binary\u0027: \u0027neutron-l3-agent\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bmyk%3D","line":167,"updated":"2013-11-22 15:23:16.000000000","message":"I\u0027m not sure how this test tests the code being submitted.  Maybe I\u0027m missing something but if it is not testing the code in the patch then I\u0027d prefer it be submitted as a separate patch.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f390fad705e55f257a029301c1e7aaaf5691b22f","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                              time\u003dtimeutils.strtime())"},{"line_number":165,"context_line":"        return [dhcp_host]"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _register_one_l3_agent(self, host\u003dL3_HOSTA, internal_only\u003dTrue,"},{"line_number":168,"context_line":"                               ext_net_id\u003dNone):"},{"line_number":169,"context_line":"        l3 \u003d {"},{"line_number":170,"context_line":"            \u0027binary\u0027: \u0027neutron-l3-agent\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Bg74%3D","line":167,"in_reply_to":"AAAATn%2F%2Bmyk%3D","updated":"2013-11-25 10:55:40.000000000","message":"This is just a helper method which is used in test cases added to test_l3_plugin module.","commit_id":"8fa222a0c9ac5565d7b208045d4e5c7b764f0a44"}],"neutron/tests/unit/test_l3_plugin.py":[{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"df0ce4b661a3704e25bcc44cd9d655a3c38b9f8e","unresolved":false,"context_lines":[{"line_number":1853,"context_line":"                ext_net_id\u003ds1[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":1854,"context_line":"            self._register_one_l3_agent("},{"line_number":1855,"context_line":"                host\u003d\u0027host2\u0027, internal_only\u003dFalse,"},{"line_number":1856,"context_line":"                ext_net_id\u003d\u0027\u0027, ext_bridge\u003d\u0027\u0027)"},{"line_number":1857,"context_line":"            l3_rpc.sync_routers(self.adminContext,"},{"line_number":1858,"context_line":"                                host\u003d\u0027host1\u0027)"},{"line_number":1859,"context_line":"            self._assert_router_on_agent(r[\u0027router\u0027][\u0027id\u0027], \u0027host1\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F4Is%3D","line":1856,"updated":"2014-01-07 10:30:34.000000000","message":"Could you also add a test for the case where the router is already hosted on an agent which supports multiple networks ? In that case the router shouldn\u0027t be rescheduled.","commit_id":"c6a4ec3ac8ee3ef4e83ef73dd9754e5900631635"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"7378da9b0bf1a4124b41672a0ef63f9b7df1432c","unresolved":false,"context_lines":[{"line_number":1780,"context_line":"                           \u0027TestL3NatIntAgentSchedulingPlugin\u0027,"},{"line_number":1781,"context_line":"              ext_mgr\u003dNone, service_plugins\u003dNone):"},{"line_number":1782,"context_line":"        super(L3NatDBIntAgentSchedulingTestCase, self).setUp("},{"line_number":1783,"context_line":"            plugin, mock_rescheduling\u003dFalse)"},{"line_number":1784,"context_line":"        self.adminContext \u003d context.get_admin_context()"},{"line_number":1785,"context_line":""},{"line_number":1786,"context_line":"    def _assert_router_on_agent(self, router_id, agent_host):"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAWH%2F%2Bfg4%3D","line":1783,"updated":"2014-03-26 13:09:05.000000000","message":"I would like to keep arguments of setUp consistent and make mock_rescheduling a class attribute.\n\nWhen diamond inheritance happens like below.\n\n  class parent(object):\n     def func():\n         pass\n  class child1(parent):\n     def func():\n         super(child1, self).func()\n  class parent(object):\n     def func():\n         super(child2, self).func()\n  class grandchild(child1, child2):\n     def func():\n         super(grandchild, self).func()\n\nthe order of call sequence of func() will be:\n\n   grandchild.func -\u003e child1.func -\u003e child2.func -\u003e parent.func\n\nIt is the reason all inherited methods should have same signature.\n\nAt now, setUp() of some classes have service_plugins parameter and others do not. It needs to be cleanup.","commit_id":"b1c546cea7017176ea9f9ce9d0dc510fa73bc24d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"d39e0706200253631c40060281565c477c9da83c","unresolved":false,"context_lines":[{"line_number":1780,"context_line":"                           \u0027TestL3NatIntAgentSchedulingPlugin\u0027,"},{"line_number":1781,"context_line":"              ext_mgr\u003dNone, service_plugins\u003dNone):"},{"line_number":1782,"context_line":"        super(L3NatDBIntAgentSchedulingTestCase, self).setUp("},{"line_number":1783,"context_line":"            plugin, mock_rescheduling\u003dFalse)"},{"line_number":1784,"context_line":"        self.adminContext \u003d context.get_admin_context()"},{"line_number":1785,"context_line":""},{"line_number":1786,"context_line":"    def _assert_router_on_agent(self, router_id, agent_host):"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAWH%2F%2Ber0%3D","line":1783,"in_reply_to":"AAAAWH%2F%2Bfg4%3D","updated":"2014-03-26 14:34:10.000000000","message":"Done","commit_id":"b1c546cea7017176ea9f9ce9d0dc510fa73bc24d"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"19dd92707df974570a5f4b0448a292231c89415c","unresolved":false,"context_lines":[{"line_number":1815,"context_line":"            self._set_net_external(s2[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":1816,"context_line":"            self._add_external_gateway_to_router("},{"line_number":1817,"context_line":"                r[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1818,"context_line":"                s2[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":1819,"context_line":"            self._assert_router_on_agent(r[\u0027router\u0027][\u0027id\u0027], \u0027host2\u0027)"},{"line_number":1820,"context_line":""},{"line_number":1821,"context_line":"            self._remove_external_gateway_from_router("}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAWH%2F%2Biuo%3D","line":1818,"updated":"2014-03-26 02:42:03.000000000","message":"Since we are testing reschedule router here, suggest to validate the scheduler\u0027s reschedule_router is called here. Maybe mock the reschedule_router method of NeutronManager.get_service_plugins()[service_constants.L3_ROUTER_NAT].","commit_id":"b1c546cea7017176ea9f9ce9d0dc510fa73bc24d"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"7378da9b0bf1a4124b41672a0ef63f9b7df1432c","unresolved":false,"context_lines":[{"line_number":1815,"context_line":"            self._set_net_external(s2[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":1816,"context_line":"            self._add_external_gateway_to_router("},{"line_number":1817,"context_line":"                r[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1818,"context_line":"                s2[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":1819,"context_line":"            self._assert_router_on_agent(r[\u0027router\u0027][\u0027id\u0027], \u0027host2\u0027)"},{"line_number":1820,"context_line":""},{"line_number":1821,"context_line":"            self._remove_external_gateway_from_router("}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAWH%2F%2Bffs%3D","line":1818,"in_reply_to":"AAAAWH%2F%2Bhao%3D","updated":"2014-03-26 13:09:05.000000000","message":"Agree","commit_id":"b1c546cea7017176ea9f9ce9d0dc510fa73bc24d"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"f858fb215e62629e0f8bd89a16967d381fe374f5","unresolved":false,"context_lines":[{"line_number":1815,"context_line":"            self._set_net_external(s2[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":1816,"context_line":"            self._add_external_gateway_to_router("},{"line_number":1817,"context_line":"                r[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1818,"context_line":"                s2[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":1819,"context_line":"            self._assert_router_on_agent(r[\u0027router\u0027][\u0027id\u0027], \u0027host2\u0027)"},{"line_number":1820,"context_line":""},{"line_number":1821,"context_line":"            self._remove_external_gateway_from_router("}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAWH%2F%2BeQo%3D","line":1818,"in_reply_to":"AAAAWH%2F%2Bhao%3D","updated":"2014-03-26 15:15:10.000000000","message":"Oleg, it makes sense to me now. Thanks for clarification.","commit_id":"b1c546cea7017176ea9f9ce9d0dc510fa73bc24d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0f4281f5268d5b0708c8fcfd107e0520bc74820b","unresolved":false,"context_lines":[{"line_number":1815,"context_line":"            self._set_net_external(s2[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":1816,"context_line":"            self._add_external_gateway_to_router("},{"line_number":1817,"context_line":"                r[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1818,"context_line":"                s2[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":1819,"context_line":"            self._assert_router_on_agent(r[\u0027router\u0027][\u0027id\u0027], \u0027host2\u0027)"},{"line_number":1820,"context_line":""},{"line_number":1821,"context_line":"            self._remove_external_gateway_from_router("}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAWH%2F%2Bhao%3D","line":1818,"in_reply_to":"AAAAWH%2F%2Biuo%3D","updated":"2014-03-26 07:40:28.000000000","message":"We can\u0027t mock reschedule_router here as we are checking that router moved on another agent on #1819 - it won\u0027t happen if reschedule is mocked. Currently router on another agent means that reschedule was called.","commit_id":"b1c546cea7017176ea9f9ce9d0dc510fa73bc24d"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"19dd92707df974570a5f4b0448a292231c89415c","unresolved":false,"context_lines":[{"line_number":1846,"context_line":"            self._set_net_external(s2[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":1847,"context_line":"            self._add_external_gateway_to_router("},{"line_number":1848,"context_line":"                r[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1849,"context_line":"                s2[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":1850,"context_line":"            self._assert_router_on_agent(r[\u0027router\u0027][\u0027id\u0027], \u0027host2\u0027)"},{"line_number":1851,"context_line":""},{"line_number":1852,"context_line":"            self._remove_external_gateway_from_router("}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAWH%2F%2Biuk%3D","line":1849,"updated":"2014-03-26 02:42:03.000000000","message":"Same as above.","commit_id":"b1c546cea7017176ea9f9ce9d0dc510fa73bc24d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0f4281f5268d5b0708c8fcfd107e0520bc74820b","unresolved":false,"context_lines":[{"line_number":1846,"context_line":"            self._set_net_external(s2[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":1847,"context_line":"            self._add_external_gateway_to_router("},{"line_number":1848,"context_line":"                r[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1849,"context_line":"                s2[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":1850,"context_line":"            self._assert_router_on_agent(r[\u0027router\u0027][\u0027id\u0027], \u0027host2\u0027)"},{"line_number":1851,"context_line":""},{"line_number":1852,"context_line":"            self._remove_external_gateway_from_router("}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAWH%2F%2Bhak%3D","line":1849,"in_reply_to":"AAAAWH%2F%2Biuk%3D","updated":"2014-03-26 07:40:28.000000000","message":"same","commit_id":"b1c546cea7017176ea9f9ce9d0dc510fa73bc24d"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"19dd92707df974570a5f4b0448a292231c89415c","unresolved":false,"context_lines":[{"line_number":1862,"context_line":"                    self._add_external_gateway_to_router("},{"line_number":1863,"context_line":"                        r[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1864,"context_line":"                        s1[\u0027subnet\u0027][\u0027network_id\u0027],"},{"line_number":1865,"context_line":"                        expected_code\u003dexc.HTTPBadRequest.code)"},{"line_number":1866,"context_line":""},{"line_number":1867,"context_line":""},{"line_number":1868,"context_line":"class L3AgentDbIntTestCase(L3BaseForIntTests, L3AgentDbTestCaseBase):"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAWH%2F%2Bitw%3D","line":1865,"updated":"2014-03-26 02:42:03.000000000","message":"Same as above.","commit_id":"b1c546cea7017176ea9f9ce9d0dc510fa73bc24d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0f4281f5268d5b0708c8fcfd107e0520bc74820b","unresolved":false,"context_lines":[{"line_number":1862,"context_line":"                    self._add_external_gateway_to_router("},{"line_number":1863,"context_line":"                        r[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1864,"context_line":"                        s1[\u0027subnet\u0027][\u0027network_id\u0027],"},{"line_number":1865,"context_line":"                        expected_code\u003dexc.HTTPBadRequest.code)"},{"line_number":1866,"context_line":""},{"line_number":1867,"context_line":""},{"line_number":1868,"context_line":"class L3AgentDbIntTestCase(L3BaseForIntTests, L3AgentDbTestCaseBase):"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAWH%2F%2Bhag%3D","line":1865,"in_reply_to":"AAAAWH%2F%2Bitw%3D","updated":"2014-03-26 07:40:28.000000000","message":"same","commit_id":"b1c546cea7017176ea9f9ce9d0dc510fa73bc24d"}]}
