)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c7a15f0c172ad6e3482c370f18af79dd24caf475","unresolved":false,"context_lines":[{"line_number":14,"context_line":"manually scheduled to a L3 agent if the number of agents-per-router is"},{"line_number":15,"context_line":"not capped and the router is not already scheduled to that given L3 agent."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Closes-Bug: #1401095"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I1e2d281cfec50e7fff4ec68659882fc7c0cb4a29"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"3a961159_069c8b0d","line":17,"updated":"2015-01-05 23:22:03.000000000","message":"I understand this change overcomes the conflict error, but would the right plumbing happen underneath?\n\nMaybe Assaf can educate me on this.","commit_id":"bf98cb8aee056d3cd7a15b8766a4b1625c3db323"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"8d33ec630e3d5df13c55318f222ffbe288464869","unresolved":false,"context_lines":[{"line_number":14,"context_line":"manually scheduled to a L3 agent if the number of agents-per-router is"},{"line_number":15,"context_line":"not capped and the router is not already scheduled to that given L3 agent."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Closes-Bug: #1401095"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I1e2d281cfec50e7fff4ec68659882fc7c0cb4a29"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"3a961159_688991c9","line":17,"in_reply_to":"3a961159_069c8b0d","updated":"2015-01-06 08:37:02.000000000","message":"I will check it out more throughly.\nI\u0027ll mark this as a WIP.","commit_id":"bf98cb8aee056d3cd7a15b8766a4b1625c3db323"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"49dbf580b06f8ac65d606789e062ef0df98ecefa","unresolved":false,"context_lines":[{"line_number":14,"context_line":"manually scheduled to a L3 agent if the number of agents-per-router is"},{"line_number":15,"context_line":"not capped and the router is not already scheduled to that given L3 agent."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Closes-Bug: #1401095"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I1e2d281cfec50e7fff4ec68659882fc7c0cb4a29"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"3a961159_471ca2c2","line":17,"in_reply_to":"3a961159_688991c9","updated":"2015-01-11 09:01:01.000000000","message":"I have verified that the entire \u0027flow\u0027 functions properly with my change. The agent is scheduled with the router and the entire \u0027plumbing\u0027 is done - namespace created, \"keepalived\" configures IPs etc. I have also verified that failover occurs properly so that a manually added agent takes charge once the other one goes down.\n\nThere is only one thing that was missing even before my patch.\nIt seems that manually scheduling a router on an agent that was NEVER a part of an HA router doesn\u0027t create HA ports on it.\n\nI will send a new patch with a fix.","commit_id":"bf98cb8aee056d3cd7a15b8766a4b1625c3db323"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"c8b3e7e3a8a1509e120cdce4334eb00bc08aceb6","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"In addition when manually adding an HA router on an agent that did"},{"line_number":14,"context_line":"not host that router before we didn\u0027t create an HA port in that router\u0027s"},{"line_number":15,"context_line":"namespace on that agent."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch takes care of HA routers by allowing them to be"},{"line_number":18,"context_line":"manually scheduled to a L3 agent if the number of agents-per-router is"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"9a80dd14_a81ace14","line":15,"updated":"2015-03-12 12:31:30.000000000","message":"This phrase doesn\u0027t compile into something comprehensible..","commit_id":"f81b4f8993646f2c42ac4d4730daece347ec6e33"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"cf388d25ecfc6b6af3d66694a5f03bb548de786a","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"In addition when manually adding an HA router on an agent that did"},{"line_number":14,"context_line":"not host that router before we didn\u0027t create an HA port in that router\u0027s"},{"line_number":15,"context_line":"namespace on that agent."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch takes care of HA routers by allowing them to be"},{"line_number":18,"context_line":"manually scheduled to a L3 agent if the number of agents-per-router is"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"9a80dd14_eb81b7c3","line":15,"in_reply_to":"9a80dd14_a81ace14","updated":"2015-03-16 12:23:46.000000000","message":"Done","commit_id":"f81b4f8993646f2c42ac4d4730daece347ec6e33"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"c8b3e7e3a8a1509e120cdce4334eb00bc08aceb6","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch takes care of HA routers by allowing them to be"},{"line_number":18,"context_line":"manually scheduled to a L3 agent if the number of agents-per-router is"},{"line_number":19,"context_line":"not capped and the router is not already scheduled to that given L3 agent."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The patch also adds an HA port in the router\u0027s namespace on the newly"},{"line_number":22,"context_line":"scheduled L3 agent."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"9a80dd14_68ce1685","line":19,"updated":"2015-03-12 12:31:30.000000000","message":"\"if the number of agents-per-router is not capped\" - not ture anymore..","commit_id":"f81b4f8993646f2c42ac4d4730daece347ec6e33"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"cf388d25ecfc6b6af3d66694a5f03bb548de786a","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch takes care of HA routers by allowing them to be"},{"line_number":18,"context_line":"manually scheduled to a L3 agent if the number of agents-per-router is"},{"line_number":19,"context_line":"not capped and the router is not already scheduled to that given L3 agent."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The patch also adds an HA port in the router\u0027s namespace on the newly"},{"line_number":22,"context_line":"scheduled L3 agent."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"9a80dd14_0b852bce","line":19,"in_reply_to":"9a80dd14_68ce1685","updated":"2015-03-16 12:23:46.000000000","message":"Done","commit_id":"f81b4f8993646f2c42ac4d4730daece347ec6e33"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"f0434b5135679ece1d6f8569246f570cf6c7441e","unresolved":false,"context_lines":[{"line_number":25,"context_line":"enforcement when manually schedulling a router on a agent. This is"},{"line_number":26,"context_line":"done as the admin should be able to schedule a router on an agent"},{"line_number":27,"context_line":"if he desires, moreover this is consistent with the"},{"line_number":28,"context_line":"\u0027min_l3_agents_per_router\u0027 that is not enforced when menually"},{"line_number":29,"context_line":"descheduling a router from an agent."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Closes-Bug: #1401095"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"9a80dd14_266a61ee","line":28,"updated":"2015-03-13 08:08:45.000000000","message":"manually*","commit_id":"f81b4f8993646f2c42ac4d4730daece347ec6e33"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"cf388d25ecfc6b6af3d66694a5f03bb548de786a","unresolved":false,"context_lines":[{"line_number":25,"context_line":"enforcement when manually schedulling a router on a agent. This is"},{"line_number":26,"context_line":"done as the admin should be able to schedule a router on an agent"},{"line_number":27,"context_line":"if he desires, moreover this is consistent with the"},{"line_number":28,"context_line":"\u0027min_l3_agents_per_router\u0027 that is not enforced when menually"},{"line_number":29,"context_line":"descheduling a router from an agent."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Closes-Bug: #1401095"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"9a80dd14_2b6f4f2c","line":28,"in_reply_to":"9a80dd14_266a61ee","updated":"2015-03-16 12:23:46.000000000","message":"Done","commit_id":"f81b4f8993646f2c42ac4d4730daece347ec6e33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"ec056bf404bbfabc6cb10652959a46b419e0c7b1","unresolved":false,"context_lines":[{"line_number":14,"context_line":"The HA port is created within the router\u0027s namespace on that agent."},{"line_number":15,"context_line":"Previously when manually scheduling this was not done at all."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"not host that router before we didn\u0027t create an HA port in that router\u0027s"},{"line_number":18,"context_line":"namespace on that agent."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"This patch takes care of HA routers by allowing them to be"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":29,"id":"9a80dd14_21a674ab","line":17,"updated":"2015-03-16 14:13:30.000000000","message":"This sentence still doesn\u0027t make sense.","commit_id":"cc0d743aaf6239050ceb6154cdbefa47789d5727"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"faac82d00d68b57ac4688fcc859f641c524a8911","unresolved":false,"context_lines":[{"line_number":14,"context_line":"The HA port is created within the router\u0027s namespace on that agent."},{"line_number":15,"context_line":"Previously when manually scheduling this was not done at all."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"not host that router before we didn\u0027t create an HA port in that router\u0027s"},{"line_number":18,"context_line":"namespace on that agent."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"This patch takes care of HA routers by allowing them to be"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":29,"id":"da9b358b_f280c848","line":17,"in_reply_to":"9a80dd14_21a674ab","updated":"2015-03-31 05:50:30.000000000","message":"Done","commit_id":"cc0d743aaf6239050ceb6154cdbefa47789d5727"}],"neutron/db/l3_agentschedulers_db.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4216ecba569acd13149c93680e9bc44b4968267e","unresolved":false,"context_lines":[{"line_number":199,"context_line":"                # router already bound to the agent we need"},{"line_number":200,"context_line":"                return False"},{"line_number":201,"context_line":"        if router.get(\u0027distributed\u0027):"},{"line_number":202,"context_line":"            return False"},{"line_number":203,"context_line":"        # ha case: check max agent per router is not capped after scheduling"},{"line_number":204,"context_line":"        if router.get(\u0027ha\u0027):"},{"line_number":205,"context_line":"            return cfg.CONF.max_l3_agents_per_router \u003e\u003d (len(bindings) + 1)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_a1ade434","line":202,"updated":"2014-12-25 11:28:36.000000000","message":"I think you could extract this logic to a function, allowing you to remove the comment, and build a nice, tiny test for it.","commit_id":"ad095b9c73f4c0927cea92f8fcce535afc07deae"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"0cb87e8aa10d8d3b500f7928ccd2de49f2e94706","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            agent_id\u003dbindings[0].l3_agent_id)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def check_ha_router_agent_scheduling_valid(self, agent_bindings):"},{"line_number":211,"context_line":"        \"\"\"Check max agent per router is not capped after scheduling"},{"line_number":212,"context_line":"        a router on a available agent"},{"line_number":213,"context_line":"        \"\"\""},{"line_number":214,"context_line":"        return cfg.CONF.max_l3_agents_per_router \u003e\u003d (len(agent_bindings) + 1)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_a95b0a54","line":211,"updated":"2014-12-25 14:25:37.000000000","message":"a -\u003e an\nmissing period at the end of the sentence.\n\nI would maybe rephrase the sentence to something like: Verify that scheduling another router is legal according to max_l3_agents_per_router.","commit_id":"0bab69fdd59560f61ca4cf50e31b7c3d37590bb8"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"52f60d61191a66d22c248e5dfb99d15aec8d51cf","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            agent_id\u003dbindings[0].l3_agent_id)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def check_ha_router_agent_scheduling_valid(self, agent_bindings):"},{"line_number":211,"context_line":"        \"\"\"Check max agent per router is not capped after scheduling"},{"line_number":212,"context_line":"        a router on a available agent"},{"line_number":213,"context_line":"        \"\"\""},{"line_number":214,"context_line":"        return cfg.CONF.max_l3_agents_per_router \u003e\u003d (len(agent_bindings) + 1)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_d438d73f","line":211,"in_reply_to":"3a961159_a95b0a54","updated":"2014-12-28 06:10:12.000000000","message":"Done","commit_id":"0bab69fdd59560f61ca4cf50e31b7c3d37590bb8"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"0cb87e8aa10d8d3b500f7928ccd2de49f2e94706","unresolved":false,"context_lines":[{"line_number":210,"context_line":"    def check_ha_router_agent_scheduling_valid(self, agent_bindings):"},{"line_number":211,"context_line":"        \"\"\"Check max agent per router is not capped after scheduling"},{"line_number":212,"context_line":"        a router on a available agent"},{"line_number":213,"context_line":"        \"\"\""},{"line_number":214,"context_line":"        return cfg.CONF.max_l3_agents_per_router \u003e\u003d (len(agent_bindings) + 1)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_493466fb","line":213,"updated":"2014-12-25 14:25:37.000000000","message":"I just remembered an important detail: Setting max_l3_agents_per_router to 0 means \u0027unlimited\u0027, so this should probably be max_l3_agents_per_router \u003d\u003d 0 or ...","commit_id":"0bab69fdd59560f61ca4cf50e31b7c3d37590bb8"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"52f60d61191a66d22c248e5dfb99d15aec8d51cf","unresolved":false,"context_lines":[{"line_number":210,"context_line":"    def check_ha_router_agent_scheduling_valid(self, agent_bindings):"},{"line_number":211,"context_line":"        \"\"\"Check max agent per router is not capped after scheduling"},{"line_number":212,"context_line":"        a router on a available agent"},{"line_number":213,"context_line":"        \"\"\""},{"line_number":214,"context_line":"        return cfg.CONF.max_l3_agents_per_router \u003e\u003d (len(agent_bindings) + 1)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_f43cf332","line":213,"in_reply_to":"3a961159_493466fb","updated":"2014-12-28 06:10:12.000000000","message":"Done","commit_id":"0bab69fdd59560f61ca4cf50e31b7c3d37590bb8"},{"author":{"_account_id":14039,"name":"watanabe isao","email":"watanabe.isao.openstack@gmail.com","username":"watanabe.isao"},"change_message_id":"e8bc9c59a6cfd688aeb3bceadfa5bc8c76f13630","unresolved":false,"context_lines":[{"line_number":211,"context_line":"        \"\"\"Check max agent per router is not capped after scheduling"},{"line_number":212,"context_line":"        a router on a available agent"},{"line_number":213,"context_line":"        \"\"\""},{"line_number":214,"context_line":"        return cfg.CONF.max_l3_agents_per_router \u003e\u003d (len(agent_bindings) + 1)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"},{"line_number":217,"context_line":"        \"\"\"Create router to agent binding.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_5dbdfcd6","line":214,"updated":"2014-12-26 00:30:58.000000000","message":"So, there must be  reason you are using \"\u003e\u003d (len(agent_bindings) + 1)\" instead of \"\u003e len(agent_bindings)\"?\nMaybe either is ok, I think.","commit_id":"0bab69fdd59560f61ca4cf50e31b7c3d37590bb8"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"52f60d61191a66d22c248e5dfb99d15aec8d51cf","unresolved":false,"context_lines":[{"line_number":211,"context_line":"        \"\"\"Check max agent per router is not capped after scheduling"},{"line_number":212,"context_line":"        a router on a available agent"},{"line_number":213,"context_line":"        \"\"\""},{"line_number":214,"context_line":"        return cfg.CONF.max_l3_agents_per_router \u003e\u003d (len(agent_bindings) + 1)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"},{"line_number":217,"context_line":"        \"\"\"Create router to agent binding.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_b4334b61","line":214,"in_reply_to":"3a961159_5dbdfcd6","updated":"2014-12-28 06:10:12.000000000","message":"Either is good, the \u0027(len(agent_bindings) + 1)\u0027 gives more of a sense on what this expression means. You are correct - logically both are ok","commit_id":"0bab69fdd59560f61ca4cf50e31b7c3d37590bb8"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6da369fc4f309e78c6ca81c61f031a0114f55b57","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            router_id\u003drouter_id,"},{"line_number":208,"context_line":"            agent_id\u003dbindings[0].l3_agent_id)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def check_ha_router_agent_scheduling_valid(self, agent_bindings):"},{"line_number":211,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid according"},{"line_number":212,"context_line":"        to the \u0027max_l3_agents_per_router\u0027 configuration value."},{"line_number":213,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_6a0e5734","line":210,"updated":"2014-12-29 11:19:12.000000000","message":"Please stick to the openstack hacking guidelines: http://docs.openstack.org/developer/hacking/#docstrings","commit_id":"92da08355c2e2eeffe5264b0d6dfa6d0f891e954"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"f8cb4a32d7be96a775a66818a3627d1543b788b2","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            router_id\u003drouter_id,"},{"line_number":208,"context_line":"            agent_id\u003dbindings[0].l3_agent_id)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def check_ha_router_agent_scheduling_valid(self, agent_bindings):"},{"line_number":211,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid according"},{"line_number":212,"context_line":"        to the \u0027max_l3_agents_per_router\u0027 configuration value."},{"line_number":213,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_a572300f","line":210,"in_reply_to":"3a961159_6a0e5734","updated":"2014-12-29 12:23:15.000000000","message":"Done","commit_id":"92da08355c2e2eeffe5264b0d6dfa6d0f891e954"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6da369fc4f309e78c6ca81c61f031a0114f55b57","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        \"\"\""},{"line_number":214,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":215,"context_line":"        actual_agents \u003d len(agent_bindings) + 1"},{"line_number":216,"context_line":"        schedule_valid \u003d (max_agents \u003d\u003d 0) or (max_agents \u003e\u003d actual_agents)"},{"line_number":217,"context_line":"        return schedule_valid"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_ca24abb4","line":216,"updated":"2014-12-29 11:19:12.000000000","message":"(no action required): you can simply return the wanted value (no need to create a variable for this).","commit_id":"92da08355c2e2eeffe5264b0d6dfa6d0f891e954"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"f8cb4a32d7be96a775a66818a3627d1543b788b2","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        \"\"\""},{"line_number":214,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":215,"context_line":"        actual_agents \u003d len(agent_bindings) + 1"},{"line_number":216,"context_line":"        schedule_valid \u003d (max_agents \u003d\u003d 0) or (max_agents \u003e\u003d actual_agents)"},{"line_number":217,"context_line":"        return schedule_valid"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_e592784a","line":216,"in_reply_to":"3a961159_ca24abb4","updated":"2014-12-29 12:23:15.000000000","message":"In my opinion using a variable makes the expression more readable.","commit_id":"92da08355c2e2eeffe5264b0d6dfa6d0f891e954"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"454a1fa75fd65553894e5cd3d1a281015640a9a4","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        raise l3agentscheduler.RouterHostedByL3Agent("},{"line_number":207,"context_line":"            router_id\u003drouter_id,"},{"line_number":208,"context_line":"            agent_id\u003dbindings[0].l3_agent_id)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def check_ha_router_agent_scheduling_valid(self, agent_bindings):"},{"line_number":211,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid"},{"line_number":212,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_77447bb7","line":209,"updated":"2014-12-29 12:36:29.000000000","message":"Since you only use the len of agent_bindings, please change the signature so that it accepts the number of agent_bindings and not use the bindings themselves. This will make both the code and tests make more sense (Since here you pass the bindings themselves, and during tests you send a list of IDs).","commit_id":"cf8caca4a13788d5a3a83d6b85b9482cf7f47053"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"810ffa04f0e831fab145be3cee1a840b53a7dde6","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        raise l3agentscheduler.RouterHostedByL3Agent("},{"line_number":207,"context_line":"            router_id\u003drouter_id,"},{"line_number":208,"context_line":"            agent_id\u003dbindings[0].l3_agent_id)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def check_ha_router_agent_scheduling_valid(self, agent_bindings):"},{"line_number":211,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid"},{"line_number":212,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_da1e365f","line":209,"in_reply_to":"3a961159_77447bb7","updated":"2014-12-29 13:14:48.000000000","message":"Done","commit_id":"cf8caca4a13788d5a3a83d6b85b9482cf7f47053"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"54fb127ba1b23d0b72c7ef07d864bf617173e2c2","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            router_id\u003drouter_id,"},{"line_number":208,"context_line":"            agent_id\u003dbindings[0].l3_agent_id)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def check_ha_router_agent_scheduling_valid(self, num_scheduled_agents):"},{"line_number":211,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        Verify that scheduling a router on an agent is valid according"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_e5b7aa1f","line":210,"updated":"2014-12-31 20:29:11.000000000","message":"Please change the prefix of this method from \u0027check_\u0027 to \u0027is_\u0027.  A prefix of \u0027check_\u0027 is commonly used to indicate that the method will throw an exception if the expected condition is not realized.  The fact that the client of this method ignores this convention - and mixes exception throwing with boolean return - is problematic, and not a good reason to buck the convention for this new method.","commit_id":"95397bde1737eff7b7313d792be551fb6049a8b6"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"c10b4c3e405b43b4c959c38491fec0e2b61bb2ad","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            router_id\u003drouter_id,"},{"line_number":208,"context_line":"            agent_id\u003dbindings[0].l3_agent_id)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def check_ha_router_agent_scheduling_valid(self, num_scheduled_agents):"},{"line_number":211,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        Verify that scheduling a router on an agent is valid according"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_90ae222e","line":210,"in_reply_to":"3a961159_e5b7aa1f","updated":"2015-01-01 05:27:34.000000000","message":"Done.\nThis was my initial thought, i just didn\u0027t know which convention was \u0027true\u0027, the \u0027is\u0027 or the \u0027check\u0027.","commit_id":"95397bde1737eff7b7313d792be551fb6049a8b6"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"54fb127ba1b23d0b72c7ef07d864bf617173e2c2","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            agent_id\u003dbindings[0].l3_agent_id)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def check_ha_router_agent_scheduling_valid(self, num_scheduled_agents):"},{"line_number":211,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        Verify that scheduling a router on an agent is valid according"},{"line_number":214,"context_line":"        to the \u0027max_l3_agents_per_router\u0027 configuration value."}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_2539b2a3","line":211,"updated":"2014-12-31 20:29:11.000000000","message":"Verify that -\u003e Determine whether","commit_id":"95397bde1737eff7b7313d792be551fb6049a8b6"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"c10b4c3e405b43b4c959c38491fec0e2b61bb2ad","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            agent_id\u003dbindings[0].l3_agent_id)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def check_ha_router_agent_scheduling_valid(self, num_scheduled_agents):"},{"line_number":211,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        Verify that scheduling a router on an agent is valid according"},{"line_number":214,"context_line":"        to the \u0027max_l3_agents_per_router\u0027 configuration value."}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_70b8d675","line":211,"in_reply_to":"3a961159_2539b2a3","updated":"2015-01-01 05:27:34.000000000","message":"Done","commit_id":"95397bde1737eff7b7313d792be551fb6049a8b6"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"09c8f5bdf8326b655733c69e7f1d82c442a83b20","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        :param num_scheduled_agents: The number of already scheduled agents"},{"line_number":216,"context_line":"        :returns: True if the scheduling is valid, False otherwise"},{"line_number":217,"context_line":"        \"\"\""},{"line_number":218,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":219,"context_line":"        actual_agents \u003d num_scheduled_agents + 1"},{"line_number":220,"context_line":"        schedule_valid \u003d (max_agents \u003d\u003d 0) or (max_agents \u003e\u003d actual_agents)"},{"line_number":221,"context_line":"        return schedule_valid"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_9a8d8e2d","line":218,"range":{"start_line":218,"start_character":30,"end_line":218,"end_character":54},"updated":"2014-12-29 13:38:21.000000000","message":"why not use self.max_ha_agents?","commit_id":"95397bde1737eff7b7313d792be551fb6049a8b6"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"2df322d88d86cf5c411a1855ec0ac9d2bc952a40","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        :param num_scheduled_agents: The number of already scheduled agents"},{"line_number":216,"context_line":"        :returns: True if the scheduling is valid, False otherwise"},{"line_number":217,"context_line":"        \"\"\""},{"line_number":218,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":219,"context_line":"        actual_agents \u003d num_scheduled_agents + 1"},{"line_number":220,"context_line":"        schedule_valid \u003d (max_agents \u003d\u003d 0) or (max_agents \u003e\u003d actual_agents)"},{"line_number":221,"context_line":"        return schedule_valid"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_3502c7b4","line":218,"in_reply_to":"3a961159_9a8d8e2d","updated":"2014-12-31 07:54:51.000000000","message":"I was unable to find this member in this class (or supers).\nI can see it in \u0027L3Scheduler\u0027, which i can\u0027t reach.\n\nCan you please elaborate ?","commit_id":"95397bde1737eff7b7313d792be551fb6049a8b6"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"09c8f5bdf8326b655733c69e7f1d82c442a83b20","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        \"\"\""},{"line_number":218,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":219,"context_line":"        actual_agents \u003d num_scheduled_agents + 1"},{"line_number":220,"context_line":"        schedule_valid \u003d (max_agents \u003d\u003d 0) or (max_agents \u003e\u003d actual_agents)"},{"line_number":221,"context_line":"        return schedule_valid"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_5af08691","line":220,"updated":"2014-12-29 13:38:21.000000000","message":"return max_agents \u003d\u003d 0 or max_agents \u003e\u003d actual_agents\n\nYou do not need the brackets","commit_id":"95397bde1737eff7b7313d792be551fb6049a8b6"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"54fb127ba1b23d0b72c7ef07d864bf617173e2c2","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        \"\"\""},{"line_number":218,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":219,"context_line":"        actual_agents \u003d num_scheduled_agents + 1"},{"line_number":220,"context_line":"        schedule_valid \u003d (max_agents \u003d\u003d 0) or (max_agents \u003e\u003d actual_agents)"},{"line_number":221,"context_line":"        return schedule_valid"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_c58e2e79","line":220,"in_reply_to":"3a961159_3533a7f7","updated":"2014-12-31 20:29:11.000000000","message":"Given that garyk\u0027s suggestion is a non-functional nit, you can feel free to ignore it if you so choose.","commit_id":"95397bde1737eff7b7313d792be551fb6049a8b6"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"2df322d88d86cf5c411a1855ec0ac9d2bc952a40","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        \"\"\""},{"line_number":218,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":219,"context_line":"        actual_agents \u003d num_scheduled_agents + 1"},{"line_number":220,"context_line":"        schedule_valid \u003d (max_agents \u003d\u003d 0) or (max_agents \u003e\u003d actual_agents)"},{"line_number":221,"context_line":"        return schedule_valid"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_3533a7f7","line":220,"in_reply_to":"3a961159_5af08691","updated":"2014-12-31 07:54:51.000000000","message":"You mean lose the variable and remove the brackets (remove both) ?","commit_id":"95397bde1737eff7b7313d792be551fb6049a8b6"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"53b6da4ac8c2969812b226b1bebe709500e0e654","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        :returns: True if the scheduling is valid, False otherwise"},{"line_number":218,"context_line":"        \"\"\""},{"line_number":219,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":220,"context_line":"        actual_agents \u003d num_scheduled_agents + 1"},{"line_number":221,"context_line":"        return max_agents \u003d\u003d 0 or max_agents \u003e\u003d actual_agents"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_e84ae181","line":220,"updated":"2015-01-06 08:39:24.000000000","message":"I looked comments in patch set 3 but you should not go so far as to add 1 line.","commit_id":"bf98cb8aee056d3cd7a15b8766a4b1625c3db323"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"68e738833572eac712158c3ff5cfc5535dd61e9f","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        :returns: True if the scheduling is valid, False otherwise"},{"line_number":218,"context_line":"        \"\"\""},{"line_number":219,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":220,"context_line":"        actual_agents \u003d num_scheduled_agents + 1"},{"line_number":221,"context_line":"        return max_agents \u003d\u003d 0 or max_agents \u003e\u003d actual_agents"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_a14ee893","line":220,"in_reply_to":"3a961159_4efbfa7a","updated":"2015-01-08 14:41:26.000000000","message":"Assuming the goal is to determine whether an additional agent can be scheduled, consider removing this line and change the one below to read:\n\n return max_agents \u003d\u003d 0 or num_scheduled_agents \u003c max_agents","commit_id":"bf98cb8aee056d3cd7a15b8766a4b1625c3db323"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d85ba4b3ca802b2defb9e127e26ffce8948a74b1","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        :returns: True if the scheduling is valid, False otherwise"},{"line_number":218,"context_line":"        \"\"\""},{"line_number":219,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":220,"context_line":"        actual_agents \u003d num_scheduled_agents + 1"},{"line_number":221,"context_line":"        return max_agents \u003d\u003d 0 or max_agents \u003e\u003d actual_agents"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_c16bf4b6","line":220,"in_reply_to":"3a961159_4efbfa7a","updated":"2015-01-08 14:48:57.000000000","message":"I think the point is that instead of adding one, you could test max_agents \u003e actual_agents","commit_id":"bf98cb8aee056d3cd7a15b8766a4b1625c3db323"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"49dbf580b06f8ac65d606789e062ef0df98ecefa","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        :returns: True if the scheduling is valid, False otherwise"},{"line_number":218,"context_line":"        \"\"\""},{"line_number":219,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":220,"context_line":"        actual_agents \u003d num_scheduled_agents + 1"},{"line_number":221,"context_line":"        return max_agents \u003d\u003d 0 or max_agents \u003e\u003d actual_agents"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_a5015f06","line":220,"in_reply_to":"3a961159_c16bf4b6","updated":"2015-01-11 09:01:01.000000000","message":"I changed it to what you and Maru suggested, which is practically the same thing.","commit_id":"bf98cb8aee056d3cd7a15b8766a4b1625c3db323"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"7ca82b53f65db72c20174a32fc521173112cdcd8","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        :returns: True if the scheduling is valid, False otherwise"},{"line_number":218,"context_line":"        \"\"\""},{"line_number":219,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":220,"context_line":"        actual_agents \u003d num_scheduled_agents + 1"},{"line_number":221,"context_line":"        return max_agents \u003d\u003d 0 or max_agents \u003e\u003d actual_agents"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_4efbfa7a","line":220,"in_reply_to":"3a961159_e84ae181","updated":"2015-01-06 11:54:16.000000000","message":"I\u0027m not sure what you mean, can you please elaborate ?","commit_id":"bf98cb8aee056d3cd7a15b8766a4b1625c3db323"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d85ba4b3ca802b2defb9e127e26ffce8948a74b1","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        \"\"\""},{"line_number":219,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":220,"context_line":"        actual_agents \u003d num_scheduled_agents + 1"},{"line_number":221,"context_line":"        return max_agents \u003d\u003d 0 or max_agents \u003e\u003d actual_agents"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"},{"line_number":224,"context_line":"        \"\"\"Create router to agent binding.\"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_21abd8d6","line":221,"updated":"2015-01-08 14:48:57.000000000","message":"Given the meaning of 0 is special, maybe define a literal, UNLIMITED would make this clearer?\n\n    return max_agents \u003d\u003d UNLIMITED or max_agents \u003e  num_scheduled_agents","commit_id":"bf98cb8aee056d3cd7a15b8766a4b1625c3db323"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"49dbf580b06f8ac65d606789e062ef0df98ecefa","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        \"\"\""},{"line_number":219,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":220,"context_line":"        actual_agents \u003d num_scheduled_agents + 1"},{"line_number":221,"context_line":"        return max_agents \u003d\u003d 0 or max_agents \u003e\u003d actual_agents"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"},{"line_number":224,"context_line":"        \"\"\"Create router to agent binding.\"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_85fc630e","line":221,"in_reply_to":"3a961159_21abd8d6","updated":"2015-01-11 09:01:01.000000000","message":"Done","commit_id":"bf98cb8aee056d3cd7a15b8766a4b1625c3db323"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d85ba4b3ca802b2defb9e127e26ffce8948a74b1","unresolved":false,"context_lines":[{"line_number":399,"context_line":""},{"line_number":400,"context_line":"            agent_modes \u003d filters.get(\u0027agent_modes\u0027, [])"},{"line_number":401,"context_line":"            if agent_modes:"},{"line_number":402,"context_line":"                agent_mode_key \u003d \u0027\\\"agent_mode\\\": \\\"\u0027"},{"line_number":403,"context_line":"                configuration_filter \u003d ("},{"line_number":404,"context_line":"                    [agents_db.Agent.configurations.contains(\u0027%s%s\\\"\u0027 %"},{"line_number":405,"context_line":"                     (agent_mode_key, agent_mode))"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_81d48c20","line":402,"updated":"2015-01-08 14:48:57.000000000","message":"nit: don\u0027t need escapes:\n    agent_mode_key \u003d \u0027\"agent_mode\": \"\u0027","commit_id":"bf98cb8aee056d3cd7a15b8766a4b1625c3db323"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"30e8a327b2b16dde54e9ff0cce04df0ee0a53ffe","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"UNLIMITED \u003d 0"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"L3_AGENTS_SCHEDULER_OPTS \u003d ["},{"line_number":51,"context_line":"    cfg.StrOpt(\u0027router_scheduler_driver\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_e960840f","line":48,"updated":"2015-01-12 19:46:35.000000000","message":"UNLIMITED what?  The fact that I can\u0027t look at the constant name and know what is being referred to, even knowing the purpose of the module, is an indication that a more descriptive name is required.","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"0abb1866925c35f3452b9f994fc5a8ddbc78423d","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"UNLIMITED \u003d 0"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"L3_AGENTS_SCHEDULER_OPTS \u003d ["},{"line_number":51,"context_line":"    cfg.StrOpt(\u0027router_scheduler_driver\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_9933bf61","line":48,"in_reply_to":"3a961159_e960840f","updated":"2015-01-13 05:35:27.000000000","message":"Will do","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"30e8a327b2b16dde54e9ff0cce04df0ee0a53ffe","unresolved":false,"context_lines":[{"line_number":241,"context_line":"            self.validate_agent_router_combination(context, agent, router)"},{"line_number":242,"context_line":"            if self.check_agent_router_scheduling_needed("},{"line_number":243,"context_line":"                context, agent, router):"},{"line_number":244,"context_line":"                if router.get(\u0027ha\u0027):"},{"line_number":245,"context_line":"                    plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":246,"context_line":"                        service_constants.L3_ROUTER_NAT)"},{"line_number":247,"context_line":"                    self._add_router_ha_port(router, agent, plugin, context)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_0c3a3e98","line":244,"updated":"2015-01-12 19:46:35.000000000","message":"Where is the test that targets this code change?  Regardless of whether it is tested implicitly, I would expect a targeted test.","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"0abb1866925c35f3452b9f994fc5a8ddbc78423d","unresolved":false,"context_lines":[{"line_number":241,"context_line":"            self.validate_agent_router_combination(context, agent, router)"},{"line_number":242,"context_line":"            if self.check_agent_router_scheduling_needed("},{"line_number":243,"context_line":"                context, agent, router):"},{"line_number":244,"context_line":"                if router.get(\u0027ha\u0027):"},{"line_number":245,"context_line":"                    plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":246,"context_line":"                        service_constants.L3_ROUTER_NAT)"},{"line_number":247,"context_line":"                    self._add_router_ha_port(router, agent, plugin, context)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_799613f1","line":244,"in_reply_to":"3a961159_0c3a3e98","updated":"2015-01-13 05:35:27.000000000","message":"i\u0027ll add one","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"30e8a327b2b16dde54e9ff0cce04df0ee0a53ffe","unresolved":false,"context_lines":[{"line_number":254,"context_line":"            l3_notifier.router_added_to_agent("},{"line_number":255,"context_line":"                context, [router_id], agent.host)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    def _add_router_ha_port(self, router, agent, plugin, context):"},{"line_number":258,"context_line":"        tenant_id \u003d router[\u0027tenant_id\u0027]"},{"line_number":259,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"},{"line_number":260,"context_line":"        port_binding \u003d plugin.add_ha_port(context.elevated(), router[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_299d2c0b","line":257,"updated":"2015-01-12 19:46:35.000000000","message":"Please fix this argument ordering so that it is consistent with the other methods, e.g.\n\n_add_router_had_port(self, context, plugin, agent, router)\n\nI think it\u0027s important to try to maintain consistency (where it is reasonable to do so) when maintaining a legacy codebase like neutron\u0027s.  \u0027context\u0027 is nearly always provided as the first argument, and the order of subsequent arguments is generally related to their relative importance.  Only when their isn\u0027t an obvious ordering between parameters and no precedence in surrounding code is arbitrary ordering suggested.\n\nAlso, where is the corresponding test for this addition?","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"0abb1866925c35f3452b9f994fc5a8ddbc78423d","unresolved":false,"context_lines":[{"line_number":254,"context_line":"            l3_notifier.router_added_to_agent("},{"line_number":255,"context_line":"                context, [router_id], agent.host)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    def _add_router_ha_port(self, router, agent, plugin, context):"},{"line_number":258,"context_line":"        tenant_id \u003d router[\u0027tenant_id\u0027]"},{"line_number":259,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"},{"line_number":260,"context_line":"        port_binding \u003d plugin.add_ha_port(context.elevated(), router[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_59931700","line":257,"in_reply_to":"3a961159_299d2c0b","updated":"2015-01-13 05:35:27.000000000","message":"I\u0027ll add one","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"30e8a327b2b16dde54e9ff0cce04df0ee0a53ffe","unresolved":false,"context_lines":[{"line_number":258,"context_line":"        tenant_id \u003d router[\u0027tenant_id\u0027]"},{"line_number":259,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"},{"line_number":260,"context_line":"        port_binding \u003d plugin.add_ha_port(context.elevated(), router[\u0027id\u0027],"},{"line_number":261,"context_line":"                              ha_network.network.id, tenant_id)"},{"line_number":262,"context_line":"        port_binding.l3_agent_id \u003d agent[\u0027id\u0027]"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def remove_router_from_l3_agent(self, context, agent_id, router_id):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_29b44c81","line":261,"updated":"2015-01-12 19:46:35.000000000","message":"PEP8 - if parameters are provided on the first line of a multi-line function call, subsequent lines should be aligned to the opening bracket.\n\nSee: https://www.python.org/dev/peps/pep-0008/#indentation","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"0abb1866925c35f3452b9f994fc5a8ddbc78423d","unresolved":false,"context_lines":[{"line_number":258,"context_line":"        tenant_id \u003d router[\u0027tenant_id\u0027]"},{"line_number":259,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"},{"line_number":260,"context_line":"        port_binding \u003d plugin.add_ha_port(context.elevated(), router[\u0027id\u0027],"},{"line_number":261,"context_line":"                              ha_network.network.id, tenant_id)"},{"line_number":262,"context_line":"        port_binding.l3_agent_id \u003d agent[\u0027id\u0027]"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def remove_router_from_l3_agent(self, context, agent_id, router_id):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_595eb77a","line":261,"in_reply_to":"3a961159_29b44c81","updated":"2015-01-13 05:35:27.000000000","message":"Done","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"beb6c10285ab99c43ce87736f89197b332b6e80a","unresolved":false,"context_lines":[{"line_number":243,"context_line":"            if self.check_agent_router_scheduling_needed("},{"line_number":244,"context_line":"                context, agent, router):"},{"line_number":245,"context_line":"                if router.get(\u0027ha\u0027):"},{"line_number":246,"context_line":"                    plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":247,"context_line":"                        service_constants.L3_ROUTER_NAT)"},{"line_number":248,"context_line":"                    self._add_router_ha_port(context, agent, router, plugin)"},{"line_number":249,"context_line":"                self.create_router_to_agent_binding(context, agent, router)"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a961159_dddc051b","line":246,"updated":"2015-01-14 23:38:00.000000000","message":"I\u0027m sorry for missing this previously, but given that the plugin is only used by this method call, is there a reason not to retrieve it in _add_router_ha_port instead of passing it as a parameter?","commit_id":"6f01ab855fbbe9dd358e889fa952b01c4764aef9"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"d2e49155cb490fe320c198cf2fde964afe8c474a","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        if router.get(\u0027distributed\u0027):"},{"line_number":206,"context_line":"            return False"},{"line_number":207,"context_line":"        if router.get(\u0027ha\u0027):"},{"line_number":208,"context_line":"            return self.is_ha_router_agent_scheduling_valid(len(bindings))"},{"line_number":209,"context_line":"        # non-dvr case: centralized router is already bound to some agent"},{"line_number":210,"context_line":"        raise l3agentscheduler.RouterHostedByL3Agent("},{"line_number":211,"context_line":"            router_id\u003drouter_id,"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_4638d69f","line":208,"updated":"2015-01-19 13:46:40.000000000","message":"The following comment doesn\u0027t make a whole lot of sense now that this function has both an \u0027is dvr\u0027 and an \u0027is ha\u0027 logic :( Consider rewriting it.","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"53aa6e9622a31319ca3133ba17aa85577affb461","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        if router.get(\u0027distributed\u0027):"},{"line_number":206,"context_line":"            return False"},{"line_number":207,"context_line":"        if router.get(\u0027ha\u0027):"},{"line_number":208,"context_line":"            return self.is_ha_router_agent_scheduling_valid(len(bindings))"},{"line_number":209,"context_line":"        # non-dvr case: centralized router is already bound to some agent"},{"line_number":210,"context_line":"        raise l3agentscheduler.RouterHostedByL3Agent("},{"line_number":211,"context_line":"            router_id\u003drouter_id,"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_1037c84e","line":208,"in_reply_to":"3a961159_4638d69f","updated":"2015-01-20 07:02:49.000000000","message":"Agreed, i\u0027ll change it.","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"d2e49155cb490fe320c198cf2fde964afe8c474a","unresolved":false,"context_lines":[{"line_number":212,"context_line":"            agent_id\u003dbindings[0].l3_agent_id)"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    def is_ha_router_agent_scheduling_valid(self, num_scheduled_agents):"},{"line_number":215,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        Determine whether scheduling a router on an agent is valid according"},{"line_number":218,"context_line":"        to the \u0027max_l3_agents_per_router\u0027 configuration value."}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_a6d89a81","line":215,"updated":"2015-01-19 13:46:40.000000000","message":"nit: please add a dot at the end of the sentence (for consistency)","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"53aa6e9622a31319ca3133ba17aa85577affb461","unresolved":false,"context_lines":[{"line_number":212,"context_line":"            agent_id\u003dbindings[0].l3_agent_id)"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    def is_ha_router_agent_scheduling_valid(self, num_scheduled_agents):"},{"line_number":215,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        Determine whether scheduling a router on an agent is valid according"},{"line_number":218,"context_line":"        to the \u0027max_l3_agents_per_router\u0027 configuration value."}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_6a9d7e6c","line":215,"in_reply_to":"3a961159_a6d89a81","updated":"2015-01-20 07:02:49.000000000","message":"Done","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"d2e49155cb490fe320c198cf2fde964afe8c474a","unresolved":false,"context_lines":[{"line_number":214,"context_line":"    def is_ha_router_agent_scheduling_valid(self, num_scheduled_agents):"},{"line_number":215,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        Determine whether scheduling a router on an agent is valid according"},{"line_number":218,"context_line":"        to the \u0027max_l3_agents_per_router\u0027 configuration value."},{"line_number":219,"context_line":"        :param num_scheduled_agents: The number of already scheduled agents"},{"line_number":220,"context_line":"        :returns: True if the scheduling is valid, False otherwise"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_c66a0682","line":217,"updated":"2015-01-19 13:46:40.000000000","message":"nittiest of nits: scheduling a router -\u003e scheduling a ha router","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"53aa6e9622a31319ca3133ba17aa85577affb461","unresolved":false,"context_lines":[{"line_number":214,"context_line":"    def is_ha_router_agent_scheduling_valid(self, num_scheduled_agents):"},{"line_number":215,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        Determine whether scheduling a router on an agent is valid according"},{"line_number":218,"context_line":"        to the \u0027max_l3_agents_per_router\u0027 configuration value."},{"line_number":219,"context_line":"        :param num_scheduled_agents: The number of already scheduled agents"},{"line_number":220,"context_line":"        :returns: True if the scheduling is valid, False otherwise"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_8abb8ae3","line":217,"in_reply_to":"3a961159_54130701","updated":"2015-01-20 07:02:49.000000000","message":"\u0027an HA router\u0027 it is","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"2f03d62867150229c5ae96e12646af424a6f2466","unresolved":false,"context_lines":[{"line_number":214,"context_line":"    def is_ha_router_agent_scheduling_valid(self, num_scheduled_agents):"},{"line_number":215,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        Determine whether scheduling a router on an agent is valid according"},{"line_number":218,"context_line":"        to the \u0027max_l3_agents_per_router\u0027 configuration value."},{"line_number":219,"context_line":"        :param num_scheduled_agents: The number of already scheduled agents"},{"line_number":220,"context_line":"        :returns: True if the scheduling is valid, False otherwise"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_f0fa3c76","line":217,"in_reply_to":"3a961159_54130701","updated":"2015-01-20 06:39:19.000000000","message":"a too-far-gone nit: putting \"an ha\" here will hurt consistency along this file :)","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6300923dd7d035d3ee9e07c2be1d2e74edf966ef","unresolved":false,"context_lines":[{"line_number":214,"context_line":"    def is_ha_router_agent_scheduling_valid(self, num_scheduled_agents):"},{"line_number":215,"context_line":"        \"\"\"Verify that scheduling a router on an agent is valid"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        Determine whether scheduling a router on an agent is valid according"},{"line_number":218,"context_line":"        to the \u0027max_l3_agents_per_router\u0027 configuration value."},{"line_number":219,"context_line":"        :param num_scheduled_agents: The number of already scheduled agents"},{"line_number":220,"context_line":"        :returns: True if the scheduling is valid, False otherwise"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_54130701","line":217,"in_reply_to":"3a961159_c66a0682","updated":"2015-01-20 03:07:35.000000000","message":"a nit too far: a ha -\u003e an ha\n\n(a soft h is considered a vowel for the purposes of deciding between \u0027a\u0027 an \u0027an\u0027)","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"d2e49155cb490fe320c198cf2fde964afe8c474a","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                context, [router_id], agent.host)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def _add_router_ha_port(self, context, agent, router):"},{"line_number":257,"context_line":"        \"\"\"Add a HA port to a router on a given agent.\"\"\""},{"line_number":258,"context_line":"        plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":259,"context_line":"            service_constants.L3_ROUTER_NAT)"},{"line_number":260,"context_line":"        tenant_id \u003d router[\u0027tenant_id\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_2184940d","line":257,"updated":"2015-01-19 13:46:40.000000000","message":"(No action required) this code looks a lot like the code in [1]. We can probably refactor that code (rename to \u0027add_router_ha_port\u0027, remove the call to bind_router() from that function, add bind_router() in the 2 places that call the function), but I\u0027m not sure removing this code duplication (which packs some non-trivial logic and changes in one code will probably require changes in the other) is worth it in this case (should we refactor that code? is it even in the scope?)\n\nI\u0027m not going hard press it myself though, unless someone else does.\n\n[1]: https://github.com/openstack/neutron/blob/master/neutron/scheduler/l3_agent_scheduler.py#L290","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6300923dd7d035d3ee9e07c2be1d2e74edf966ef","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                context, [router_id], agent.host)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def _add_router_ha_port(self, context, agent, router):"},{"line_number":257,"context_line":"        \"\"\"Add a HA port to a router on a given agent.\"\"\""},{"line_number":258,"context_line":"        plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":259,"context_line":"            service_constants.L3_ROUTER_NAT)"},{"line_number":260,"context_line":"        tenant_id \u003d router[\u0027tenant_id\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_f41b131b","line":257,"in_reply_to":"3a961159_2184940d","updated":"2015-01-20 03:07:35.000000000","message":"I think John\u0027s comment is actionable.  Consider creating a static helper method on this class that can be called here and by l3_agent_scheduler, e.g.\n\n@staticmethod\ndef prepare_router_ha_port(plugin, context, router_id, tenant_id, agent_id):\n  ...","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"53aa6e9622a31319ca3133ba17aa85577affb461","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                context, [router_id], agent.host)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def _add_router_ha_port(self, context, agent, router):"},{"line_number":257,"context_line":"        \"\"\"Add a HA port to a router on a given agent.\"\"\""},{"line_number":258,"context_line":"        plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":259,"context_line":"            service_constants.L3_ROUTER_NAT)"},{"line_number":260,"context_line":"        tenant_id \u003d router[\u0027tenant_id\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_b027d41d","line":257,"in_reply_to":"3a961159_f41b131b","updated":"2015-01-20 07:02:49.000000000","message":"Ok, will do","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"035ccb55ac0ffd153daeaff06d9f401cd94a2638","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                context, [router_id], agent.host)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def _add_router_ha_port(self, context, agent, router):"},{"line_number":257,"context_line":"        \"\"\"Add a HA port to a router on a given agent.\"\"\""},{"line_number":258,"context_line":"        plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":259,"context_line":"            service_constants.L3_ROUTER_NAT)"},{"line_number":260,"context_line":"        tenant_id \u003d router[\u0027tenant_id\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_d04b8084","line":257,"in_reply_to":"3a961159_f41b131b","updated":"2015-01-20 07:00:25.000000000","message":"Thanks for the support Maru. I think this code should actually be in l3_agent_scheduler.py - since this class is a Mixin, putting the static function here basically forces a coupling of the L3Scheduler and L3AgentSchedulerDbMixin. This doesn\u0027t make a lot of sense to me (granted I\u0027m not familiar with this code very much), but I\u0027d rather have the static in L3Scheduler instead (and then if there\u0027s ever a new mixin class he could just use the scheduler, which isn\u0027t likely to change any time soon IMO).\n\nAlso (as Yoni pointed to me just now) - the original code is originally written in the scheduler and should remain there. I would agree.","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"72ce19860741acd660a761d2f80f80c980385d44","unresolved":false,"context_lines":[{"line_number":243,"context_line":"            if self.check_agent_router_scheduling_needed(context, agent,"},{"line_number":244,"context_line":"                                                         router):"},{"line_number":245,"context_line":"                if router.get(\u0027ha\u0027):"},{"line_number":246,"context_line":"                    plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":247,"context_line":"                        service_constants.L3_ROUTER_NAT)"},{"line_number":248,"context_line":"                    plugin.router_scheduler.prepare_router_ha_port("},{"line_number":249,"context_line":"                        plugin, context, router[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":18,"id":"1a930d6b_06c16280","line":246,"updated":"2015-01-21 10:16:06.000000000","message":"Is there a reason why you can\u0027t use self.router_scheduler like in L232?","commit_id":"9b0b97e680a07f2663c5eec27077665995c0f9f0"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"b4a06b8f8a0e4711edd73a5a7da6c22aea148235","unresolved":false,"context_lines":[{"line_number":243,"context_line":"            if self.check_agent_router_scheduling_needed(context, agent,"},{"line_number":244,"context_line":"                                                         router):"},{"line_number":245,"context_line":"                if router.get(\u0027ha\u0027):"},{"line_number":246,"context_line":"                    plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":247,"context_line":"                        service_constants.L3_ROUTER_NAT)"},{"line_number":248,"context_line":"                    plugin.router_scheduler.prepare_router_ha_port("},{"line_number":249,"context_line":"                        plugin, context, router[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":18,"id":"1a930d6b_6ca685c3","line":246,"in_reply_to":"1a930d6b_06c16280","updated":"2015-01-21 12:01:31.000000000","message":"I need the plugin anyway to send it to the \u0027prepare_router_ha_port\u0027 function.\nBut i guess for the sake of consistency i should change it to \u0027self.router_scheduler\u0027.","commit_id":"9b0b97e680a07f2663c5eec27077665995c0f9f0"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fc1fb21cf3a94158a6e30e268268884d22fe64ff","unresolved":false,"context_lines":[{"line_number":262,"context_line":""},{"line_number":263,"context_line":"        After removal, the router will be non-hosted until there is update"},{"line_number":264,"context_line":"        which leads to re-schedule or be added to another agent manually."},{"line_number":265,"context_line":"        \"\"\""},{"line_number":266,"context_line":"        agent \u003d self._get_agent(context, agent_id)"},{"line_number":267,"context_line":"        self._unbind_router(context, router_id, agent_id)"},{"line_number":268,"context_line":"        l3_notifier \u003d self.agent_notifiers.get(constants.AGENT_TYPE_L3)"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a930d6b_c9e8467f","line":265,"updated":"2015-01-21 13:28:50.000000000","message":"You need to remove any remaining HA resources here.","commit_id":"18e82f8070fa8420bc8a7c9f746cd85ad1124627"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"6e4a3493e8a1e52f29e8935512833cab6dacefa4","unresolved":false,"context_lines":[{"line_number":262,"context_line":""},{"line_number":263,"context_line":"        After removal, the router will be non-hosted until there is update"},{"line_number":264,"context_line":"        which leads to re-schedule or be added to another agent manually."},{"line_number":265,"context_line":"        \"\"\""},{"line_number":266,"context_line":"        agent \u003d self._get_agent(context, agent_id)"},{"line_number":267,"context_line":"        self._unbind_router(context, router_id, agent_id)"},{"line_number":268,"context_line":"        l3_notifier \u003d self.agent_notifiers.get(constants.AGENT_TYPE_L3)"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a930d6b_1cffea35","line":265,"in_reply_to":"1a930d6b_9c52fa11","updated":"2015-01-21 13:52:30.000000000","message":"I\u0027ll check it out, thanks","commit_id":"18e82f8070fa8420bc8a7c9f746cd85ad1124627"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"9eddd76c52c2c9e5a4a89873f1a2ef4d5a32229a","unresolved":false,"context_lines":[{"line_number":262,"context_line":""},{"line_number":263,"context_line":"        After removal, the router will be non-hosted until there is update"},{"line_number":264,"context_line":"        which leads to re-schedule or be added to another agent manually."},{"line_number":265,"context_line":"        \"\"\""},{"line_number":266,"context_line":"        agent \u003d self._get_agent(context, agent_id)"},{"line_number":267,"context_line":"        self._unbind_router(context, router_id, agent_id)"},{"line_number":268,"context_line":"        l3_notifier \u003d self.agent_notifiers.get(constants.AGENT_TYPE_L3)"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a930d6b_9c52fa11","line":265,"in_reply_to":"1a930d6b_c9e8467f","updated":"2015-01-21 13:33:09.000000000","message":"Please see neutron.db.l3_hamode_db.L3_HA_NAT_db_mixin._delete_ha_interfaces\n\nMaybe add a host optional parameter so that you can delete HA interfaces from a specific host. Add a unit test on that change and call it a day.","commit_id":"18e82f8070fa8420bc8a7c9f746cd85ad1124627"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"94f748d045e39a313b7ce94778f4f275a52c2786","unresolved":false,"context_lines":[{"line_number":181,"context_line":"                return False"},{"line_number":182,"context_line":"        if router.get(\u0027distributed\u0027):"},{"line_number":183,"context_line":"            return False"},{"line_number":184,"context_line":"        if router.get(\u0027ha\u0027):"},{"line_number":185,"context_line":"            return self.is_ha_router_agent_scheduling_valid(len(bindings))"},{"line_number":186,"context_line":"        # legacy router case: router is already bound to some agent"},{"line_number":187,"context_line":"        raise l3agentscheduler.RouterHostedByL3Agent("}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_da4734ba","line":184,"updated":"2015-02-26 19:32:38.000000000","message":"no action requested:  Yuck!  This might very well be what you have to do.  I\u0027m just commenting that I very much dislike this \"if distributed do this, if ha do that\" stuff.  I just spent a lot of time getting rid of a lot of this stuff in the L3 agent.  I know that the db code is a whole different animal though.  I wonder if some refactoring is in order.","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"300795ef8e2f6fc213524c0d7ef62d3a75da0750","unresolved":false,"context_lines":[{"line_number":181,"context_line":"                return False"},{"line_number":182,"context_line":"        if router.get(\u0027distributed\u0027):"},{"line_number":183,"context_line":"            return False"},{"line_number":184,"context_line":"        if router.get(\u0027ha\u0027):"},{"line_number":185,"context_line":"            return self.is_ha_router_agent_scheduling_valid(len(bindings))"},{"line_number":186,"context_line":"        # legacy router case: router is already bound to some agent"},{"line_number":187,"context_line":"        raise l3agentscheduler.RouterHostedByL3Agent("}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_68b471f2","line":184,"in_reply_to":"ba7be1f8_da4734ba","updated":"2015-03-01 07:58:00.000000000","message":"Yuck indeed.","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"94f748d045e39a313b7ce94778f4f275a52c2786","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        if router.get(\u0027distributed\u0027):"},{"line_number":183,"context_line":"            return False"},{"line_number":184,"context_line":"        if router.get(\u0027ha\u0027):"},{"line_number":185,"context_line":"            return self.is_ha_router_agent_scheduling_valid(len(bindings))"},{"line_number":186,"context_line":"        # legacy router case: router is already bound to some agent"},{"line_number":187,"context_line":"        raise l3agentscheduler.RouterHostedByL3Agent("},{"line_number":188,"context_line":"            router_id\u003drouter_id,"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_ff44ea47","line":185,"updated":"2015-02-26 19:32:38.000000000","message":"I don\u0027t really get how a boolean value from \"scheduling_valid\" translates directly to \"scheduling_needed\".  I\u0027m not sure \"scheduling_valid\" is a good name for this method.  Why not just name this \"is_ha_router_agent_scheduling_needed\".","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"300795ef8e2f6fc213524c0d7ef62d3a75da0750","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        if router.get(\u0027distributed\u0027):"},{"line_number":183,"context_line":"            return False"},{"line_number":184,"context_line":"        if router.get(\u0027ha\u0027):"},{"line_number":185,"context_line":"            return self.is_ha_router_agent_scheduling_valid(len(bindings))"},{"line_number":186,"context_line":"        # legacy router case: router is already bound to some agent"},{"line_number":187,"context_line":"        raise l3agentscheduler.RouterHostedByL3Agent("},{"line_number":188,"context_line":"            router_id\u003drouter_id,"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_a8cd8988","line":185,"in_reply_to":"ba7be1f8_ff44ea47","updated":"2015-03-01 07:58:00.000000000","message":"Sounds good, i\u0027ll change the function\u0027s name.","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"94f748d045e39a313b7ce94778f4f275a52c2786","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        \"\"\""},{"line_number":199,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":200,"context_line":"        return (max_agents \u003d\u003d UNLIMITED_AGENTS_PER_ROUTER"},{"line_number":201,"context_line":"                or num_scheduled_agents \u003c max_agents)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"},{"line_number":204,"context_line":"        \"\"\"Create router to agent binding.\"\"\""}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_9a413cab","line":201,"updated":"2015-02-26 19:32:38.000000000","message":"So, if I want to schedule an HA router manually to a new agent but I\u0027m already at the max agents, I guess I need to remove it from another agent first.  I guess that could be okay.\n\nAnother thing to consider is to have max_agents apply only to automatic scheduling.  If manual scheduling is requested, then just go ahead and allow it assuming the operator knows better.","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":10870,"name":"Livnat Peer","email":"lpeer@redhat.com","username":"lpeer"},"change_message_id":"0733fb91788a53f02966286ff461478dc66e20d6","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        \"\"\""},{"line_number":199,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":200,"context_line":"        return (max_agents \u003d\u003d UNLIMITED_AGENTS_PER_ROUTER"},{"line_number":201,"context_line":"                or num_scheduled_agents \u003c max_agents)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"},{"line_number":204,"context_line":"        \"\"\"Create router to agent binding.\"\"\""}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_ae56d603","line":201,"in_reply_to":"9a80dd14_2fc2ed84","updated":"2015-03-10 08:00:30.000000000","message":"@Carl\nI see the upside of your approach and it\u0027s a viable point.\nThe downside of this approach is that the operator would be able to manually schedule an agent that in case of a failure won\u0027t get automatically reschedule (in case it\u0027s above the max threshold).\nThis is a non consistent behaviour with the failure of an agent which is bellow the max threshold.\n\nGenerally I don\u0027t think there is right/wrong approach to this, I see users asking for both approaches and the code would end up having a configurable policy.\n\nI suggest we\u0027ll start with one approach and add support to the different policies if operators would ask for it.\n\nLivnat","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"aa22561237d16951915178451c6d14dd8e9f83f7","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        \"\"\""},{"line_number":199,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":200,"context_line":"        return (max_agents \u003d\u003d UNLIMITED_AGENTS_PER_ROUTER"},{"line_number":201,"context_line":"                or num_scheduled_agents \u003c max_agents)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"},{"line_number":204,"context_line":"        \"\"\"Create router to agent binding.\"\"\""}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_3d2e9e8c","line":201,"in_reply_to":"9a80dd14_2fc2ed84","updated":"2015-03-10 05:58:53.000000000","message":"Ok, so i\u0027ll look into removing the enforcement of the max_agents when manually scheduling.","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"f9e10e2648c6710682b4f79e657ce81755573549","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        \"\"\""},{"line_number":199,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":200,"context_line":"        return (max_agents \u003d\u003d UNLIMITED_AGENTS_PER_ROUTER"},{"line_number":201,"context_line":"                or num_scheduled_agents \u003c max_agents)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"},{"line_number":204,"context_line":"        \"\"\"Create router to agent binding.\"\"\""}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_0f4352af","line":201,"in_reply_to":"9a80dd14_ae56d603","updated":"2015-03-10 12:37:04.000000000","message":"@Livnat, we don\u0027t do scheduling at all on failover. That is, if the max is set to 3, and the admin manually scheduled that router to a fourth agent, then if the master dies (Regardless of who it is), you\u0027ll get a failover via the data plane, and the router will still be scheduled on all 4 agents. The assumption is that the faulty agent will come back up, and it will enter the backup state and be a part of the cluster again.","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"d710b26330710a3cc1946720978872b5b02e9d8d","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        \"\"\""},{"line_number":199,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":200,"context_line":"        return (max_agents \u003d\u003d UNLIMITED_AGENTS_PER_ROUTER"},{"line_number":201,"context_line":"                or num_scheduled_agents \u003c max_agents)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"},{"line_number":204,"context_line":"        \"\"\"Create router to agent binding.\"\"\""}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_2fc2ed84","line":201,"in_reply_to":"ba7be1f8_48bdedd6","updated":"2015-03-10 01:19:14.000000000","message":"@Yoni.  I\u0027m not suggesting anything with the first paragraph.  I was just thinking out loud going through what an admin will have to do to schedule manually to a new agent.\n\nI still think I\u0027d like for max_agents to affect only manual scheduling.  The documentation should be changed to reflect this.  I just don\u0027t think that max_agents is something that should be enforced.  With my operator hat on, I think I\u0027d like max_agents to be just configuration for the automatic scheduler.  I don\u0027t really want it to be a hard ceiling that is going to cause me inconvenience when I want to manually schedule.","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"5c194320b46f124ce3a3dd4a8b476073799b795c","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        \"\"\""},{"line_number":199,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":200,"context_line":"        return (max_agents \u003d\u003d UNLIMITED_AGENTS_PER_ROUTER"},{"line_number":201,"context_line":"                or num_scheduled_agents \u003c max_agents)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"},{"line_number":204,"context_line":"        \"\"\"Create router to agent binding.\"\"\""}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_ce75b7fb","line":201,"in_reply_to":"ba7be1f8_9a413cab","updated":"2015-02-26 20:09:55.000000000","message":"To clarify:  I\u0027d like your thoughts on the second paragraph in my previous comment.  What do you think about the max agents only applying to automatic scheduling?","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"75caa062d122f5609c3cef24d96a2e09478d5d01","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        \"\"\""},{"line_number":199,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":200,"context_line":"        return (max_agents \u003d\u003d UNLIMITED_AGENTS_PER_ROUTER"},{"line_number":201,"context_line":"                or num_scheduled_agents \u003c max_agents)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"},{"line_number":204,"context_line":"        \"\"\"Create router to agent binding.\"\"\""}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_8e249f0f","line":201,"in_reply_to":"ba7be1f8_9a413cab","updated":"2015-02-26 20:09:47.000000000","message":"You raise a good point Carl, maybe we should just let the admin choose here and not enforce a max (Like we don\u0027t enforce a min, mind you). I\u0027d like to get more opinions on this though.","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"300795ef8e2f6fc213524c0d7ef62d3a75da0750","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        \"\"\""},{"line_number":199,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":200,"context_line":"        return (max_agents \u003d\u003d UNLIMITED_AGENTS_PER_ROUTER"},{"line_number":201,"context_line":"                or num_scheduled_agents \u003c max_agents)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def create_router_to_agent_binding(self, context, agent, router):"},{"line_number":204,"context_line":"        \"\"\"Create router to agent binding.\"\"\""}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_48bdedd6","line":201,"in_reply_to":"ba7be1f8_ce75b7fb","updated":"2015-03-01 07:58:00.000000000","message":"Just to be clear on the first one Carl, you suggest we apply some kind of LRU(i.e.) logic to remove the router from one of the hosting agent and then host the router on the new agent ?\n\nRegarding the second comment on enforcing the max_agents value. I personally think this really makes things inconsistent and even confusing at times. When a parameter is exposed to the user (in this case the \u0027l3_agent.ini\u0027) and then not enforced it in some exceptions - it seems not to behave as expected.\n\nThat\u0027s my opinion anyway.","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"c8b3e7e3a8a1509e120cdce4334eb00bc08aceb6","unresolved":false,"context_lines":[{"line_number":37,"context_line":"from neutron.plugins.common import constants as service_constants"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":40,"context_line":"UNLIMITED_AGENTS_PER_ROUTER \u003d 0"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"L3_AGENTS_SCHEDULER_OPTS \u003d ["},{"line_number":43,"context_line":"    cfg.StrOpt(\u0027router_scheduler_driver\u0027,"}],"source_content_type":"text/x-python","patch_set":28,"id":"9a80dd14_687c5621","line":40,"updated":"2015-03-12 12:31:30.000000000","message":"unused here","commit_id":"f81b4f8993646f2c42ac4d4730daece347ec6e33"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"cf388d25ecfc6b6af3d66694a5f03bb548de786a","unresolved":false,"context_lines":[{"line_number":37,"context_line":"from neutron.plugins.common import constants as service_constants"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":40,"context_line":"UNLIMITED_AGENTS_PER_ROUTER \u003d 0"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"L3_AGENTS_SCHEDULER_OPTS \u003d ["},{"line_number":43,"context_line":"    cfg.StrOpt(\u0027router_scheduler_driver\u0027,"}],"source_content_type":"text/x-python","patch_set":28,"id":"9a80dd14_cb7eb3e3","line":40,"in_reply_to":"9a80dd14_687c5621","updated":"2015-03-16 12:23:46.000000000","message":"I\u0027ve relocated to the module that uses it - \u0027l3_hamode_db\u0027","commit_id":"f81b4f8993646f2c42ac4d4730daece347ec6e33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c57c91b9e446bb44f45251dbbef595ff8fd5ea17","unresolved":false,"context_lines":[{"line_number":205,"context_line":"            router \u003d self.get_router(context, router_id)"},{"line_number":206,"context_line":"            agent \u003d self._get_agent(context, agent_id)"},{"line_number":207,"context_line":"            self.validate_agent_router_combination(context, agent, router)"},{"line_number":208,"context_line":"            if self.check_agent_router_scheduling_needed(context, agent,"},{"line_number":209,"context_line":"                                                         router):"},{"line_number":210,"context_line":"                if router.get(\u0027ha\u0027):"},{"line_number":211,"context_line":"                    plugin \u003d manager.NeutronManager.get_service_plugins().get("}],"source_content_type":"text/x-python","patch_set":28,"id":"9a80dd14_5edd886f","line":208,"updated":"2015-03-12 13:54:22.000000000","message":"To remove the conditional logic, could we have check_agent_router_scheduling_needed() only see if already bound, and if not, then in this method call router.handle_rescheduling() and each router type can take appropriate action (dvr\u003dnothing, ha\u003ddo the create_ha_port)? Like...\n\n    if self.check_agent_router_scheduling_needed(context, agent, router):\n        router.handle_rescheduling(context, agent)\n\nDvr:\n    def handle_rescheduling(self, context, agent):\n        pass\n\nHA:\n    def handle_rescheduling(self, context, agent):\n        plugin \u003d manager.NeutronManager.get_service_plugins()...\n        ...\n        self.create_router_to_agent_binding(context, agent, self)\n        l3_notifier \u003d self.agent_notifiers.get(...)\n        if l3_notifier:\n            ...\n\nLegacy:\n    def handle_rescheduling(self, context, agent_id):\n        raise l3gentschedule.RouterHostedByL3Agent(...)\n\nIf not a good idea, the code can be refactored to return, if no scheduling needed and then can reduce indentation for rest. Also, looks like don\u0027t need HA test, as if legacy it will raise, if DVR it will do nothing, when not already bound.","commit_id":"f81b4f8993646f2c42ac4d4730daece347ec6e33"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"cf388d25ecfc6b6af3d66694a5f03bb548de786a","unresolved":false,"context_lines":[{"line_number":205,"context_line":"            router \u003d self.get_router(context, router_id)"},{"line_number":206,"context_line":"            agent \u003d self._get_agent(context, agent_id)"},{"line_number":207,"context_line":"            self.validate_agent_router_combination(context, agent, router)"},{"line_number":208,"context_line":"            if self.check_agent_router_scheduling_needed(context, agent,"},{"line_number":209,"context_line":"                                                         router):"},{"line_number":210,"context_line":"                if router.get(\u0027ha\u0027):"},{"line_number":211,"context_line":"                    plugin \u003d manager.NeutronManager.get_service_plugins().get("}],"source_content_type":"text/x-python","patch_set":28,"id":"9a80dd14_ae109659","line":208,"in_reply_to":"9a80dd14_5edd886f","updated":"2015-03-16 12:23:46.000000000","message":"Conceptually this is a good idea, however, this suggestion seems to assume that we have a class representing each router type, which we don\u0027t AFAIK.\n\nTo implement such a change would require a big change in the way the agent is built.\n\nEither way it\u0027s a bit out of scope for this change.","commit_id":"f81b4f8993646f2c42ac4d4730daece347ec6e33"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"ec056bf404bbfabc6cb10652959a46b419e0c7b1","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            router \u003d self.get_router(context, router_id)"},{"line_number":205,"context_line":"            agent \u003d self._get_agent(context, agent_id)"},{"line_number":206,"context_line":"            self.validate_agent_router_combination(context, agent, router)"},{"line_number":207,"context_line":"            if self.check_agent_router_scheduling_needed(context, agent,"},{"line_number":208,"context_line":"                                                         router):"},{"line_number":209,"context_line":"                if router.get(\u0027ha\u0027):"},{"line_number":210,"context_line":"                    plugin \u003d manager.NeutronManager.get_service_plugins().get("}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_3c7697a4","line":207,"updated":"2015-03-16 14:13:30.000000000","message":"Could change condition and remove indentation...\n\n    if not self.check_agent_router_scheduling_needed(...):\n        return\n    if router.get(\u0027ha\u0027):\n        ...\n\nOn PS28, there is dvr_router.py, legacy_router.py, and ha_router.py for each type, and a method could be added to each and used here, instead of having conditional test on router type, like on L209.","commit_id":"cc0d743aaf6239050ceb6154cdbefa47789d5727"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"faac82d00d68b57ac4688fcc859f641c524a8911","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            router \u003d self.get_router(context, router_id)"},{"line_number":205,"context_line":"            agent \u003d self._get_agent(context, agent_id)"},{"line_number":206,"context_line":"            self.validate_agent_router_combination(context, agent, router)"},{"line_number":207,"context_line":"            if self.check_agent_router_scheduling_needed(context, agent,"},{"line_number":208,"context_line":"                                                         router):"},{"line_number":209,"context_line":"                if router.get(\u0027ha\u0027):"},{"line_number":210,"context_line":"                    plugin \u003d manager.NeutronManager.get_service_plugins().get("}],"source_content_type":"text/x-python","patch_set":29,"id":"da9b358b_52e9b419","line":207,"in_reply_to":"9a80dd14_3c7697a4","updated":"2015-03-31 05:50:30.000000000","message":"Done for the indentation","commit_id":"cc0d743aaf6239050ceb6154cdbefa47789d5727"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"1b48c2fdf25bc135a1a4e092faf699cb7acdcca7","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            router \u003d self.get_router(context, router_id)"},{"line_number":205,"context_line":"            agent \u003d self._get_agent(context, agent_id)"},{"line_number":206,"context_line":"            self.validate_agent_router_combination(context, agent, router)"},{"line_number":207,"context_line":"            if self.check_agent_router_scheduling_needed(context, agent,"},{"line_number":208,"context_line":"                                                         router):"},{"line_number":209,"context_line":"                if router.get(\u0027ha\u0027):"},{"line_number":210,"context_line":"                    plugin \u003d manager.NeutronManager.get_service_plugins().get("}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_5c634bb0","line":207,"in_reply_to":"9a80dd14_3c7697a4","updated":"2015-03-16 14:15:27.000000000","message":"Paul are you suggesting to instantiate and use L3 agent router types in DB code?","commit_id":"cc0d743aaf6239050ceb6154cdbefa47789d5727"}],"neutron/db/l3_hamode_db.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"166da611b059e9cf53aea82b6e12cfbd3d05c4bc","unresolved":false,"context_lines":[{"line_number":324,"context_line":"                                                  l3_port_check\u003dFalse)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def _delete_ha_interfaces(self, context, router_id, host\u003dNone):"},{"line_number":327,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":328,"context_line":"        device_filter \u003d {\u0027device_id\u0027: [router_id],"},{"line_number":329,"context_line":"                         \u0027device_owner\u0027:"},{"line_number":330,"context_line":"                         [constants.DEVICE_OWNER_ROUTER_HA_INTF]}"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_c15fd8e3","line":327,"updated":"2015-02-03 16:46:38.000000000","message":"Can\u0027t you just add the host filter to device_filters in case host is not None, and get rid of filter_router_ha_interfaces_by_host?\n\nHA ports are not \u0027distributed\u0027 or \u0027multii bound\u0027 so the host value on the actual port should match the host value for the agent/host you\u0027re interested in.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"0e9f7407fe6b472e3561bd34a31278355ba4434a","unresolved":false,"context_lines":[{"line_number":324,"context_line":"                                                  l3_port_check\u003dFalse)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def _delete_ha_interfaces(self, context, router_id, host\u003dNone):"},{"line_number":327,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":328,"context_line":"        device_filter \u003d {\u0027device_id\u0027: [router_id],"},{"line_number":329,"context_line":"                         \u0027device_owner\u0027:"},{"line_number":330,"context_line":"                         [constants.DEVICE_OWNER_ROUTER_HA_INTF]}"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_5c9ca16a","line":327,"in_reply_to":"da86d52c_16591d8e","updated":"2015-02-10 20:56:39.000000000","message":"The \u0027port\u0027 API object has a host attribute (You can verify this by calling neutron port-show \u003cid\u003e on one of your devstack VMs). It is populated by Nova for VM ports, and it\u0027s not populated at all for HA router ports, so we can\u0027t really use it here, unless we want to populate it after we bind an HA port to a router during the scheduling process (Which is indeed a possibility). Internally, the binding is kept in a separate table, and each plugin, including ML2, implements a filter hook that allows you to filter the Port model on a column (host) that\u0027s persisted in the bindings table, and not the port table. This is done using a generic filtering and lookup hook mechanism that plugins writers may use.\n\nWith all of that being said, please take a look at:\n    get_ha_router_port_bindings\n\nThis entire function can be simplified to:\n    port_ids \u003d (binding.port_id for binding in self.get_ha_router_port_bindings(context, [router_id], host))\n    for port_id in port_ids:\n        delete the sucker","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"558f55f81105cf7335dbea2b63e428a578ea76c2","unresolved":false,"context_lines":[{"line_number":324,"context_line":"                                                  l3_port_check\u003dFalse)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def _delete_ha_interfaces(self, context, router_id, host\u003dNone):"},{"line_number":327,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":328,"context_line":"        device_filter \u003d {\u0027device_id\u0027: [router_id],"},{"line_number":329,"context_line":"                         \u0027device_owner\u0027:"},{"line_number":330,"context_line":"                         [constants.DEVICE_OWNER_ROUTER_HA_INTF]}"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_cdc17430","line":327,"in_reply_to":"da86d52c_5c9ca16a","updated":"2015-02-22 11:47:13.000000000","message":"Ok, so i used your snippet to replace my code (also remove now-unused methods like \u0027filter_router_ha_interfaces_by_host\u0027.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"d0b87dae7003ea18fe2b4159dcd05b0591015b57","unresolved":false,"context_lines":[{"line_number":324,"context_line":"                                                  l3_port_check\u003dFalse)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def _delete_ha_interfaces(self, context, router_id, host\u003dNone):"},{"line_number":327,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":328,"context_line":"        device_filter \u003d {\u0027device_id\u0027: [router_id],"},{"line_number":329,"context_line":"                         \u0027device_owner\u0027:"},{"line_number":330,"context_line":"                         [constants.DEVICE_OWNER_ROUTER_HA_INTF]}"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_16591d8e","line":327,"in_reply_to":"da86d52c_c15fd8e3","updated":"2015-02-04 07:54:09.000000000","message":"The \u0027get_ports\u0027 function that uses the filters applies the filter on the Port class, which as far as i saw, has no \u0027host\u0027 column.\n\nIt must be joined with the Agent table to understand which agent houses this port and thus knowing on which host the port is located.\n\nMaybe i didn\u0027t fully understand your point though.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"cb941812a91dc54e62dee64eb394ba2c9bda2ffc","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                for port_id in port_ids:"},{"line_number":324,"context_line":"                    self._core_plugin.delete_port(admin_ctx, port_id,"},{"line_number":325,"context_line":"                                                  l3_port_check\u003dFalse)"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"    def _delete_ha_interfaces(self, context, router_id, host\u003dNone):"},{"line_number":328,"context_line":"        port_ids \u003d (binding.port_id for binding"},{"line_number":329,"context_line":"                    in self.get_ha_router_port_bindings(context,"}],"source_content_type":"text/x-python","patch_set":25,"id":"ba7be1f8_f39ea253","line":326,"updated":"2015-02-22 16:21:29.000000000","message":"Looks like there\u0027s some regression here when host\u003dNone, found by the update_router unit test.","commit_id":"66dc7de240a6945f4c4a2fbd0033f60b1da0b784"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"4bdf5b88c990e97a7f3ca8f5275c437d347ed28a","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                for port_id in port_ids:"},{"line_number":324,"context_line":"                    self._core_plugin.delete_port(admin_ctx, port_id,"},{"line_number":325,"context_line":"                                                  l3_port_check\u003dFalse)"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"    def _delete_ha_interfaces(self, context, router_id, host\u003dNone):"},{"line_number":328,"context_line":"        port_ids \u003d (binding.port_id for binding"},{"line_number":329,"context_line":"                    in self.get_ha_router_port_bindings(context,"}],"source_content_type":"text/x-python","patch_set":25,"id":"ba7be1f8_50a9197a","line":326,"in_reply_to":"ba7be1f8_f39ea253","updated":"2015-02-23 08:39:17.000000000","message":"I\u0027ll look into it","commit_id":"66dc7de240a6945f4c4a2fbd0033f60b1da0b784"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"cb941812a91dc54e62dee64eb394ba2c9bda2ffc","unresolved":false,"context_lines":[{"line_number":328,"context_line":"        port_ids \u003d (binding.port_id for binding"},{"line_number":329,"context_line":"                    in self.get_ha_router_port_bindings(context,"},{"line_number":330,"context_line":"                                                        [router_id], host))"},{"line_number":331,"context_line":"        for port_id in port_ids:"},{"line_number":332,"context_line":"            self._core_plugin.delete_port(context, port_id)"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":25,"id":"ba7be1f8_53904e43","line":331,"updated":"2015-02-22 16:21:29.000000000","message":"Hmm, isn\u0027t l3_port_check\u003dFalse needed here?","commit_id":"66dc7de240a6945f4c4a2fbd0033f60b1da0b784"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"4bdf5b88c990e97a7f3ca8f5275c437d347ed28a","unresolved":false,"context_lines":[{"line_number":328,"context_line":"        port_ids \u003d (binding.port_id for binding"},{"line_number":329,"context_line":"                    in self.get_ha_router_port_bindings(context,"},{"line_number":330,"context_line":"                                                        [router_id], host))"},{"line_number":331,"context_line":"        for port_id in port_ids:"},{"line_number":332,"context_line":"            self._core_plugin.delete_port(context, port_id)"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":25,"id":"ba7be1f8_cda3b64d","line":331,"in_reply_to":"ba7be1f8_53904e43","updated":"2015-02-23 08:39:17.000000000","message":"Seems like it.","commit_id":"66dc7de240a6945f4c4a2fbd0033f60b1da0b784"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"cb941812a91dc54e62dee64eb394ba2c9bda2ffc","unresolved":false,"context_lines":[{"line_number":330,"context_line":"                                                        [router_id], host))"},{"line_number":331,"context_line":"        for port_id in port_ids:"},{"line_number":332,"context_line":"            self._core_plugin.delete_port(context, port_id)"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"    @staticmethod"},{"line_number":335,"context_line":"    def filter_router_ha_interfaces_by_host(context, router_id,"},{"line_number":336,"context_line":"                                            host, ports):"}],"source_content_type":"text/x-python","patch_set":25,"id":"ba7be1f8_1377b63b","line":333,"updated":"2015-02-22 16:21:29.000000000","message":"*Cough*","commit_id":"66dc7de240a6945f4c4a2fbd0033f60b1da0b784"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"4bdf5b88c990e97a7f3ca8f5275c437d347ed28a","unresolved":false,"context_lines":[{"line_number":330,"context_line":"                                                        [router_id], host))"},{"line_number":331,"context_line":"        for port_id in port_ids:"},{"line_number":332,"context_line":"            self._core_plugin.delete_port(context, port_id)"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"    @staticmethod"},{"line_number":335,"context_line":"    def filter_router_ha_interfaces_by_host(context, router_id,"},{"line_number":336,"context_line":"                                            host, ports):"}],"source_content_type":"text/x-python","patch_set":25,"id":"ba7be1f8_ed023a3d","line":333,"in_reply_to":"ba7be1f8_1377b63b","updated":"2015-02-23 08:39:17.000000000","message":"By coughing i assume i forgot something....","commit_id":"66dc7de240a6945f4c4a2fbd0033f60b1da0b784"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"982bd85187dccd5f6f3f2fbfd029beda32ece8a4","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        port_ids \u003d (binding.port_id for binding"},{"line_number":330,"context_line":"                    in self.get_ha_router_port_bindings(admin_ctx,"},{"line_number":331,"context_line":"                                                        [router_id], host))"},{"line_number":332,"context_line":"        for port_id in port_ids:"},{"line_number":333,"context_line":"            self._core_plugin.delete_port(admin_ctx, port_id,"},{"line_number":334,"context_line":"                                          l3_port_check\u003dTrue)"},{"line_number":335,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_5c39c4a2","line":332,"updated":"2015-02-25 15:07:44.000000000","message":"l3_port_check should be False here.\n\nIt looks like you found a bug...\n\nhttps://github.com/openstack/neutron/blob/master/neutron/db/l3_db.py#L937\n\nML2 runs that code during port deletion. If it\u0027s a router owned port and it has an IP then the operation is blocked (If l3_port_check\u003dTrue). So, for example, a user can\u0027t neutron port-delete a router port, he has to use router-interface-delete. I think HA ports should be consistent with that... They just have a different device owner which isn\u0027t included in this list:\n\nhttps://github.com/openstack/neutron/blob/master/neutron/db/l3_db.py#L110\n\nSo for now just change it to False (So it\u0027s future proofed, and retains the current behavior) and I\u0027ll investigate more into this and possibly report a bug.","commit_id":"07d1b42a8742b9f58d3fe4cbf2f7c939ace77a0f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"94f748d045e39a313b7ce94778f4f275a52c2786","unresolved":false,"context_lines":[{"line_number":324,"context_line":"                    self._core_plugin.delete_port(admin_ctx, port_id,"},{"line_number":325,"context_line":"                                                  l3_port_check\u003dFalse)"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"    def _delete_ha_interfaces(self, context, router_id, host\u003dNone):"},{"line_number":328,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":329,"context_line":"        port_ids \u003d (binding.port_id for binding"},{"line_number":330,"context_line":"                    in self.get_ha_router_port_bindings(admin_ctx,"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_88f6578f","line":327,"updated":"2015-02-26 19:32:38.000000000","message":"Optional:  Consider creating a new method call _delete_ha_interfaces_on_host.  This might just be my personal preference but I very much dislike optional arguments that change the behavior of a method.\n\nThe two methods could share much of the implementation but I like the clarity of having two methods, each with a clearly define function.","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"300795ef8e2f6fc213524c0d7ef62d3a75da0750","unresolved":false,"context_lines":[{"line_number":324,"context_line":"                    self._core_plugin.delete_port(admin_ctx, port_id,"},{"line_number":325,"context_line":"                                                  l3_port_check\u003dFalse)"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"    def _delete_ha_interfaces(self, context, router_id, host\u003dNone):"},{"line_number":328,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":329,"context_line":"        port_ids \u003d (binding.port_id for binding"},{"line_number":330,"context_line":"                    in self.get_ha_router_port_bindings(admin_ctx,"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_28a199a9","line":327,"in_reply_to":"ba7be1f8_88f6578f","updated":"2015-03-01 07:58:00.000000000","message":"Ok, i\u0027ll split this into 2 functions.","commit_id":"3c02fd747f2f5c5f6bf093908ff4079fca8e4ce0"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"c8b3e7e3a8a1509e120cdce4334eb00bc08aceb6","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"VR_ID_RANGE \u003d set(range(1, 255))"},{"line_number":34,"context_line":"MAX_ALLOCATION_TRIES \u003d 10"},{"line_number":35,"context_line":"UNLIMITED_AGENTS_PER_ROUTER \u003d 0"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"9a80dd14_88c50a3f","side":"PARENT","line":35,"updated":"2015-03-12 12:31:30.000000000","message":"No need to move this anymore..","commit_id":"194afde3a64b70a934ec94f40550137ceacffbe2"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"cf388d25ecfc6b6af3d66694a5f03bb548de786a","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"VR_ID_RANGE \u003d set(range(1, 255))"},{"line_number":34,"context_line":"MAX_ALLOCATION_TRIES \u003d 10"},{"line_number":35,"context_line":"UNLIMITED_AGENTS_PER_ROUTER \u003d 0"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"9a80dd14_6b75c7f8","side":"PARENT","line":35,"in_reply_to":"9a80dd14_88c50a3f","updated":"2015-03-16 12:23:46.000000000","message":"Done","commit_id":"194afde3a64b70a934ec94f40550137ceacffbe2"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"2370c2e155ea9f6ae5bb4ad48b2efb76375584c4","unresolved":false,"context_lines":[{"line_number":323,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":324,"context_line":"                for port_id in port_ids:"},{"line_number":325,"context_line":"                    self._core_plugin.delete_port(admin_ctx, port_id,"},{"line_number":326,"context_line":"                                                  l3_port_check\u003dFalse)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def _delete_ha_interfaces(self, context, router_id):"},{"line_number":329,"context_line":"        admin_ctx \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_dc501b60","line":326,"updated":"2015-03-16 14:24:26.000000000","message":"It should be easy to remove code duplication between these two methods.\n\nA third, private method would accept host as an optional parameter and would be implemented just like _delete_ha_interfaces_on_host (get_ha_router_port_bindings already accepts host optionally). Then the existing two methods would call that one. Also, should the existing two methods be made \u0027public\u0027?","commit_id":"cc0d743aaf6239050ceb6154cdbefa47789d5727"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"faac82d00d68b57ac4688fcc859f641c524a8911","unresolved":false,"context_lines":[{"line_number":323,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":324,"context_line":"                for port_id in port_ids:"},{"line_number":325,"context_line":"                    self._core_plugin.delete_port(admin_ctx, port_id,"},{"line_number":326,"context_line":"                                                  l3_port_check\u003dFalse)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def _delete_ha_interfaces(self, context, router_id):"},{"line_number":329,"context_line":"        admin_ctx \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":29,"id":"da9b358b_6e04c87d","line":326,"in_reply_to":"9a80dd14_dc501b60","updated":"2015-03-31 05:50:30.000000000","message":"No can do.\n\nget_agent_port_bindings doesn\u0027t find anything in case router was deleted since the bindings table is cleared by on delete cascade.","commit_id":"cc0d743aaf6239050ceb6154cdbefa47789d5727"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"2e2b79ae309c0b69c13e519cd29d1d7a940d33e6","unresolved":false,"context_lines":[{"line_number":323,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":324,"context_line":"                for port_id in port_ids:"},{"line_number":325,"context_line":"                    self._core_plugin.delete_port(admin_ctx, port_id,"},{"line_number":326,"context_line":"                                                  l3_port_check\u003dFalse)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def _delete_ha_interfaces(self, context, router_id):"},{"line_number":329,"context_line":"        admin_ctx \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":29,"id":"da9b358b_76cb4854","line":326,"in_reply_to":"da9b358b_6e04c87d","updated":"2015-03-31 17:36:10.000000000","message":"What about the other way then, changing _delete_ha_interfaces to filter on host according to the binding:host parameter of the ports?","commit_id":"cc0d743aaf6239050ceb6154cdbefa47789d5727"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"97cfaff884584dd97ed90140aeac6587af6a1968","unresolved":false,"context_lines":[{"line_number":339,"context_line":"    def _delete_ha_interfaces_on_host(self, context, router_id, host):"},{"line_number":340,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":341,"context_line":"        port_ids \u003d (binding.port_id for binding"},{"line_number":342,"context_line":"                    in self.get_ha_router_port_bindings(admin_ctx,"},{"line_number":343,"context_line":"                                                        [router_id], host))"},{"line_number":344,"context_line":"        for port_id in port_ids:"},{"line_number":345,"context_line":"            self._core_plugin.delete_port(admin_ctx, port_id,"}],"source_content_type":"text/x-python","patch_set":33,"id":"7a016987_841c7e78","line":342,"updated":"2015-05-26 18:18:21.000000000","message":"This method call uses a query under the hood.  Instead of calling query.all() and then iterating the result to delete them, I\u0027d much rather just call query.delete().  I realize that it might take a little bit of refactoring to get there but let\u0027s do it.","commit_id":"b1c53f8dc2f1e4a40a4ecaad7926aaeac447632a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e201eace47ae75237eb77a8b5c9f15844ccfe922","unresolved":false,"context_lines":[{"line_number":339,"context_line":"    def _delete_ha_interfaces_on_host(self, context, router_id, host):"},{"line_number":340,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":341,"context_line":"        port_ids \u003d (binding.port_id for binding"},{"line_number":342,"context_line":"                    in self.get_ha_router_port_bindings(admin_ctx,"},{"line_number":343,"context_line":"                                                        [router_id], host))"},{"line_number":344,"context_line":"        for port_id in port_ids:"},{"line_number":345,"context_line":"            self._core_plugin.delete_port(admin_ctx, port_id,"}],"source_content_type":"text/x-python","patch_set":33,"id":"fa32b979_9e1b5c1c","line":342,"updated":"2015-06-22 19:38:42.000000000","message":"that will result in skipping the core plugin for a port deletion which sort of violates who is in charge of the object. I think this is probably the appropriate way to do it.","commit_id":"b1c53f8dc2f1e4a40a4ecaad7926aaeac447632a"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"5b337c4171e6217331cef54aca92663a99c292ea","unresolved":false,"context_lines":[{"line_number":339,"context_line":"    def _delete_ha_interfaces_on_host(self, context, router_id, host):"},{"line_number":340,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":341,"context_line":"        port_ids \u003d (binding.port_id for binding"},{"line_number":342,"context_line":"                    in self.get_ha_router_port_bindings(admin_ctx,"},{"line_number":343,"context_line":"                                                        [router_id], host))"},{"line_number":344,"context_line":"        for port_id in port_ids:"},{"line_number":345,"context_line":"            self._core_plugin.delete_port(admin_ctx, port_id,"}],"source_content_type":"text/x-python","patch_set":33,"id":"fa32b979_269cc55c","line":342,"in_reply_to":"fa32b979_9e1b5c1c","updated":"2015-06-26 10:46:47.000000000","message":"+1 to call plugin to delete.","commit_id":"b1c53f8dc2f1e4a40a4ecaad7926aaeac447632a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"97cfaff884584dd97ed90140aeac6587af6a1968","unresolved":false,"context_lines":[{"line_number":443,"context_line":""},{"line_number":444,"context_line":"        query \u003d query.filter("},{"line_number":445,"context_line":"            L3HARouterAgentPortBinding.router_id.in_(router_ids))"},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"        return query.all()"},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"    def get_l3_bindings_hosting_router_with_ha_states("}],"source_content_type":"text/x-python","patch_set":33,"id":"7a016987_c402760b","line":446,"updated":"2015-05-26 18:18:21.000000000","message":"We can refactor this method to create a shared method which sets up the query and returns it without call .all() or .delete() or anything.","commit_id":"b1c53f8dc2f1e4a40a4ecaad7926aaeac447632a"}],"neutron/scheduler/l3_agent_scheduler.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"aad6ebb3bb7883b7632a7dd41b7370a3e6a8da59","unresolved":false,"context_lines":[{"line_number":200,"context_line":"            if router.get(\u0027ha\u0027):"},{"line_number":201,"context_line":"                if not self.router_has_binding(context, router[\u0027id\u0027],"},{"line_number":202,"context_line":"                                               l3_agent.id):"},{"line_number":203,"context_line":"                    L3Scheduler.prepare_router_ha_port(plugin, context,"},{"line_number":204,"context_line":"                                                       router[\u0027id\u0027],"},{"line_number":205,"context_line":"                                                       router[\u0027tenant_id\u0027],"},{"line_number":206,"context_line":"                                                       l3_agent[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":16,"id":"3a961159_0b4a2b5b","line":203,"updated":"2015-01-20 16:09:35.000000000","message":"This call and the one on line 317 shouldn\u0027t have to change - only the implementation of create_ha_router_binding() need be updated to use prepare_router_ha_port()","commit_id":"e2fed9b3452664fa70c0f6517b441cd2d2eba05e"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"406087e84449ee7860667d536e19d871851f32ba","unresolved":false,"context_lines":[{"line_number":200,"context_line":"            if router.get(\u0027ha\u0027):"},{"line_number":201,"context_line":"                if not self.router_has_binding(context, router[\u0027id\u0027],"},{"line_number":202,"context_line":"                                               l3_agent.id):"},{"line_number":203,"context_line":"                    L3Scheduler.prepare_router_ha_port(plugin, context,"},{"line_number":204,"context_line":"                                                       router[\u0027id\u0027],"},{"line_number":205,"context_line":"                                                       router[\u0027tenant_id\u0027],"},{"line_number":206,"context_line":"                                                       l3_agent[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_8d173851","line":203,"in_reply_to":"3a961159_0b4a2b5b","updated":"2015-01-21 05:16:36.000000000","message":"Done","commit_id":"e2fed9b3452664fa70c0f6517b441cd2d2eba05e"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"166da611b059e9cf53aea82b6e12cfbd3d05c4bc","unresolved":false,"context_lines":[{"line_number":287,"context_line":"            return False"},{"line_number":288,"context_line":"        return True"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    @staticmethod"},{"line_number":291,"context_line":"    def prepare_router_ha_port(plugin, context, router_id,"},{"line_number":292,"context_line":"                               tenant_id, agent_id):"},{"line_number":293,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_84040ec1","line":290,"updated":"2015-02-03 16:46:38.000000000","message":"I don\u0027t think the current naming scheme differentiates the two methods. Maybe:\n\n1) create_ha_port\n\n2) create_ha_port_and_bind\n\n?\n\nAlso I *think* the first method already exists (Or should) in l3_ha_db? I don\u0027t see any scheduler specific logic here? I think that maybe (If this works) l3_ha_db should have a method that creates a port, and here create_ha_router_binding will use that method, then call lines 296 and 303.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"0e9f7407fe6b472e3561bd34a31278355ba4434a","unresolved":false,"context_lines":[{"line_number":287,"context_line":"            return False"},{"line_number":288,"context_line":"        return True"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    @staticmethod"},{"line_number":291,"context_line":"    def prepare_router_ha_port(plugin, context, router_id,"},{"line_number":292,"context_line":"                               tenant_id, agent_id):"},{"line_number":293,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_9cc8d923","line":290,"in_reply_to":"da86d52c_56b2b594","updated":"2015-02-10 20:56:39.000000000","message":"Looking at this again, I think that the naming is problematic, but the contents of the two methods is fine, as it suits the caller needs.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"d0b87dae7003ea18fe2b4159dcd05b0591015b57","unresolved":false,"context_lines":[{"line_number":287,"context_line":"            return False"},{"line_number":288,"context_line":"        return True"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    @staticmethod"},{"line_number":291,"context_line":"    def prepare_router_ha_port(plugin, context, router_id,"},{"line_number":292,"context_line":"                               tenant_id, agent_id):"},{"line_number":293,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_56b2b594","line":290,"in_reply_to":"da86d52c_84040ec1","updated":"2015-02-04 07:54:09.000000000","message":"(1) This name i think it was Maru\u0027s suggestion for naming this method \u0027prepare...port\u0027 (PS 14).\n(2) I can change it, sounds sensible.\n\nRegarding the 2nd comment, i did\u0027nt find any method in \u0027l3_hamode_db\u0027 (i assume you refer to it) that does this specific logic (though there might be).\n\nIf it\u0027s only a positional thing i can move it there for the sake of order.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"558f55f81105cf7335dbea2b63e428a578ea76c2","unresolved":false,"context_lines":[{"line_number":287,"context_line":"            return False"},{"line_number":288,"context_line":"        return True"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    @staticmethod"},{"line_number":291,"context_line":"    def prepare_router_ha_port(plugin, context, router_id,"},{"line_number":292,"context_line":"                               tenant_id, agent_id):"},{"line_number":293,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_2d369003","line":290,"in_reply_to":"da86d52c_9cc8d923","updated":"2015-02-22 11:47:13.000000000","message":"I renamed the methods.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"166da611b059e9cf53aea82b6e12cfbd3d05c4bc","unresolved":false,"context_lines":[{"line_number":292,"context_line":"                               tenant_id, agent_id):"},{"line_number":293,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"},{"line_number":294,"context_line":"        port_binding \u003d plugin.add_ha_port(context.elevated(), router_id,"},{"line_number":295,"context_line":"                                          ha_network.network.id, tenant_id)"},{"line_number":296,"context_line":"        port_binding.l3_agent_id \u003d agent_id"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"    def create_ha_router_binding(self, plugin, context, router_id, tenant_id,"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_84f24ed0","line":295,"updated":"2015-02-03 16:46:38.000000000","message":"Should this line move to the method below?","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"0e9f7407fe6b472e3561bd34a31278355ba4434a","unresolved":false,"context_lines":[{"line_number":292,"context_line":"                               tenant_id, agent_id):"},{"line_number":293,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"},{"line_number":294,"context_line":"        port_binding \u003d plugin.add_ha_port(context.elevated(), router_id,"},{"line_number":295,"context_line":"                                          ha_network.network.id, tenant_id)"},{"line_number":296,"context_line":"        port_binding.l3_agent_id \u003d agent_id"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"    def create_ha_router_binding(self, plugin, context, router_id, tenant_id,"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_fcd395d2","line":295,"in_reply_to":"da86d52c_76da59e9","updated":"2015-02-10 20:56:39.000000000","message":"Yes, forget about it.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"d0b87dae7003ea18fe2b4159dcd05b0591015b57","unresolved":false,"context_lines":[{"line_number":292,"context_line":"                               tenant_id, agent_id):"},{"line_number":293,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"},{"line_number":294,"context_line":"        port_binding \u003d plugin.add_ha_port(context.elevated(), router_id,"},{"line_number":295,"context_line":"                                          ha_network.network.id, tenant_id)"},{"line_number":296,"context_line":"        port_binding.l3_agent_id \u003d agent_id"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"    def create_ha_router_binding(self, plugin, context, router_id, tenant_id,"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_76da59e9","line":295,"in_reply_to":"da86d52c_84f24ed0","updated":"2015-02-04 07:54:09.000000000","message":"Actually this logic was grouped together and i just consolidated it into a method. \n\nThe method below does the actual DB binding, this assignment only updates the object\u0027s reference before being persisted on the DB (which is \u0027create_ha_router_binding\u0027 responsibility)\n\nMake sense ?","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"0a6d748787341e5b35c41df374bdcdb9d6c97020","unresolved":false,"context_lines":[{"line_number":300,"context_line":"    def create_ha_port_and_bind(self, plugin, context, router_id,"},{"line_number":301,"context_line":"                                tenant_id, agent):"},{"line_number":302,"context_line":"        \"\"\"Creates and binds a new HA port for this agent.\"\"\""},{"line_number":303,"context_line":"        L3Scheduler.create_ha_port(plugin, context, router_id,"},{"line_number":304,"context_line":"                                   tenant_id, agent[\u0027id\u0027])"},{"line_number":305,"context_line":"        self.bind_router(context, router_id, agent)"},{"line_number":306,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"da9b358b_5635edf4","line":303,"updated":"2015-03-31 09:12:37.000000000","message":"just use \u0027self\u0027 here instead of L3Scheduler. When reading this it\u0027s not immediately obvious that you are referencing the method on the same class","commit_id":"0da75f1d85c9ea551f9844f620a58be2059d2ffb"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"73ac1b070ad2a91bd3a4656273020fdb1f2feed9","unresolved":false,"context_lines":[{"line_number":291,"context_line":"        return True"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    @staticmethod"},{"line_number":294,"context_line":"    def create_ha_port(plugin, context, router_id,"},{"line_number":295,"context_line":"                       tenant_id, agent_id):"},{"line_number":296,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"},{"line_number":297,"context_line":"        port_binding \u003d plugin.add_ha_port(context.elevated(), router_id,"}],"source_content_type":"text/x-python","patch_set":33,"id":"fa32b979_8d9db468","line":294,"updated":"2015-06-26 09:19:48.000000000","message":"This method should not be called at all. The number of ha port should be created at the creation of router and fixed, we should not add or delete the ha port.","commit_id":"b1c53f8dc2f1e4a40a4ecaad7926aaeac447632a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"f82ed5667e7224abd22018dca39c05eb93a6710e","unresolved":false,"context_lines":[{"line_number":291,"context_line":"        return True"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    @staticmethod"},{"line_number":294,"context_line":"    def create_ha_port(plugin, context, router_id,"},{"line_number":295,"context_line":"                       tenant_id, agent_id):"},{"line_number":296,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"},{"line_number":297,"context_line":"        port_binding \u003d plugin.add_ha_port(context.elevated(), router_id,"}],"source_content_type":"text/x-python","patch_set":33,"id":"fa32b979_514390af","line":294,"in_reply_to":"fa32b979_8d9db468","updated":"2015-06-28 16:57:08.000000000","message":"I\u0027m confused by this comment. We do need a new HA port for the new router-agent binding. You seem to have inlined the method in create_ha_port_and_bind, so you didn\u0027t change anything?","commit_id":"b1c53f8dc2f1e4a40a4ecaad7926aaeac447632a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e201eace47ae75237eb77a8b5c9f15844ccfe922","unresolved":false,"context_lines":[{"line_number":301,"context_line":"    def create_ha_port_and_bind(self, plugin, context, router_id,"},{"line_number":302,"context_line":"                                tenant_id, agent):"},{"line_number":303,"context_line":"        \"\"\"Creates and binds a new HA port for this agent.\"\"\""},{"line_number":304,"context_line":"        L3Scheduler.create_ha_port(plugin, context, router_id,"},{"line_number":305,"context_line":"                                   tenant_id, agent[\u0027id\u0027])"},{"line_number":306,"context_line":"        self.bind_router(context, router_id, agent)"},{"line_number":307,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"fa32b979_7e20d849","line":304,"updated":"2015-06-22 19:38:42.000000000","message":"just use \u0027self\u0027 here instead of L3Scheduler","commit_id":"b1c53f8dc2f1e4a40a4ecaad7926aaeac447632a"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"73ac1b070ad2a91bd3a4656273020fdb1f2feed9","unresolved":false,"context_lines":[{"line_number":301,"context_line":"    def create_ha_port_and_bind(self, plugin, context, router_id,"},{"line_number":302,"context_line":"                                tenant_id, agent):"},{"line_number":303,"context_line":"        \"\"\"Creates and binds a new HA port for this agent.\"\"\""},{"line_number":304,"context_line":"        L3Scheduler.create_ha_port(plugin, context, router_id,"},{"line_number":305,"context_line":"                                   tenant_id, agent[\u0027id\u0027])"},{"line_number":306,"context_line":"        self.bind_router(context, router_id, agent)"},{"line_number":307,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"fa32b979_8deff4e8","line":304,"in_reply_to":"fa32b979_7e20d849","updated":"2015-06-26 09:19:48.000000000","message":"I think the static method should be called by Class name.","commit_id":"b1c53f8dc2f1e4a40a4ecaad7926aaeac447632a"}],"neutron/tests/unit/db/test_l3_ha_db.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"e50edfc8f1eb70b5eb45ec82282c4d2bd7753dd2","unresolved":false,"context_lines":[{"line_number":350,"context_line":"        with mock.patch.object(L3_HA_NAT_db_mixin, \u0027add_ha_port\u0027) as add_port:"},{"line_number":351,"context_line":"            self.plugin._add_router_ha_port(self.admin_ctx, agent, router,"},{"line_number":352,"context_line":"                                            self.plugin)"},{"line_number":353,"context_line":"            self.assertTrue(True, add_port.called)"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"    def test_create_ha_network_binding_failure_rolls_back_network(self):"},{"line_number":356,"context_line":"        networks_before \u003d self.core_plugin.get_networks(self.admin_ctx)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_cb28f599","line":353,"updated":"2015-01-13 18:36:29.000000000","message":"self.assertTrue(add_port.called)","commit_id":"0f4097b5854a578abe71d315126fc4fca4031c67"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"beb6c10285ab99c43ce87736f89197b332b6e80a","unresolved":false,"context_lines":[{"line_number":350,"context_line":"        with mock.patch.object(L3_HA_NAT_db_mixin, \u0027add_ha_port\u0027) as add_port:"},{"line_number":351,"context_line":"            self.plugin._add_router_ha_port(self.admin_ctx, agent, router,"},{"line_number":352,"context_line":"                                            self.plugin)"},{"line_number":353,"context_line":"            self.assertTrue(add_port.called)"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"    def test_create_ha_network_binding_failure_rolls_back_network(self):"},{"line_number":356,"context_line":"        networks_before \u003d self.core_plugin.get_networks(self.admin_ctx)"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a961159_1de4cda6","line":353,"updated":"2015-01-14 23:38:00.000000000","message":"I guess there\u0027s no point in actually validating the creation of the ha port, but it probably does make sense to ensure that the l3_agent_id is set correctly.","commit_id":"6f01ab855fbbe9dd358e889fa952b01c4764aef9"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"166da611b059e9cf53aea82b6e12cfbd3d05c4bc","unresolved":false,"context_lines":[{"line_number":353,"context_line":""},{"line_number":354,"context_line":"        self.assertEqual(ports_before, ports_after)"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"    def test_add_router_ha_port(self):"},{"line_number":357,"context_line":"        with self.admin_ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":358,"context_line":"            agent \u003d self.plugin.get_agents_db(self.admin_ctx)[0]"},{"line_number":359,"context_line":"            router \u003d self._create_router()"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_a8be81fd","line":356,"updated":"2015-02-03 16:46:38.000000000","message":"There\u0027s no need to begin a session here.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"d0b87dae7003ea18fe2b4159dcd05b0591015b57","unresolved":false,"context_lines":[{"line_number":353,"context_line":""},{"line_number":354,"context_line":"        self.assertEqual(ports_before, ports_after)"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"    def test_add_router_ha_port(self):"},{"line_number":357,"context_line":"        with self.admin_ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":358,"context_line":"            agent \u003d self.plugin.get_agents_db(self.admin_ctx)[0]"},{"line_number":359,"context_line":"            router \u003d self._create_router()"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_715d0347","line":356,"in_reply_to":"da86d52c_a8be81fd","updated":"2015-02-04 07:54:09.000000000","message":"Done","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"166da611b059e9cf53aea82b6e12cfbd3d05c4bc","unresolved":false,"context_lines":[{"line_number":356,"context_line":"    def test_add_router_ha_port(self):"},{"line_number":357,"context_line":"        with self.admin_ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":358,"context_line":"            agent \u003d self.plugin.get_agents_db(self.admin_ctx)[0]"},{"line_number":359,"context_line":"            router \u003d self._create_router()"},{"line_number":360,"context_line":"            l3_agent_scheduler.L3Scheduler.prepare_router_ha_port("},{"line_number":361,"context_line":"                self.plugin, self.admin_ctx, router[\u0027id\u0027],"},{"line_number":362,"context_line":"                router[\u0027tenant_id\u0027], agent[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_c869f58c","line":359,"updated":"2015-02-03 16:46:38.000000000","message":"The unit that you\u0027re testing actually belongs to the scheduler. Is there a reason to test it here?","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"d0b87dae7003ea18fe2b4159dcd05b0591015b57","unresolved":false,"context_lines":[{"line_number":356,"context_line":"    def test_add_router_ha_port(self):"},{"line_number":357,"context_line":"        with self.admin_ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":358,"context_line":"            agent \u003d self.plugin.get_agents_db(self.admin_ctx)[0]"},{"line_number":359,"context_line":"            router \u003d self._create_router()"},{"line_number":360,"context_line":"            l3_agent_scheduler.L3Scheduler.prepare_router_ha_port("},{"line_number":361,"context_line":"                self.plugin, self.admin_ctx, router[\u0027id\u0027],"},{"line_number":362,"context_line":"                router[\u0027tenant_id\u0027], agent[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_0c0e6ae5","line":359,"in_reply_to":"da86d52c_c869f58c","updated":"2015-02-04 07:54:09.000000000","message":"Done, moving it to \u0027test_l3_schedulers.py\u0027","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"0a6d748787341e5b35c41df374bdcdb9d6c97020","unresolved":false,"context_lines":[{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def test_verify_configuration_max_l3_agents_unlimited(self):"},{"line_number":168,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027,"},{"line_number":169,"context_line":"                              (l3_hamode_db.UNLIMITED_AGENTS_PER_ROUTER))"},{"line_number":170,"context_line":"        self.plugin._check_num_agents_per_router()"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def test_ha_router_create(self):"}],"source_content_type":"text/x-python","patch_set":30,"id":"da9b358b_363ca9e1","line":169,"updated":"2015-03-31 09:12:37.000000000","message":"What did these new parens accomplish?","commit_id":"0da75f1d85c9ea551f9844f620a58be2059d2ffb"}],"neutron/tests/unit/db/test_l3_hamode_db.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"09598d7800ac76369c3685da9201cd011a399bb6","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def test_verify_configuration_max_l3_agents_unlimited(self):"},{"line_number":135,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027,"},{"line_number":136,"context_line":"                              (l3_hamode_db.UNLIMITED_AGENTS_PER_ROUTER))"},{"line_number":137,"context_line":"        self.plugin._check_num_agents_per_router()"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def test_get_ha_router_port_bindings(self):"}],"source_content_type":"text/x-python","patch_set":36,"id":"ba3cc151_76979b90","line":136,"updated":"2015-06-30 19:32:28.000000000","message":"Unrelated change.","commit_id":"e34a948f15f6af7081c5842d0a87600aefff55f2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"ea32a4c53bb52ff10ec66760fe48b962f660d125","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def test_verify_configuration_max_l3_agents_unlimited(self):"},{"line_number":135,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027,"},{"line_number":136,"context_line":"                              (l3_hamode_db.UNLIMITED_AGENTS_PER_ROUTER))"},{"line_number":137,"context_line":"        self.plugin._check_num_agents_per_router()"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def test_get_ha_router_port_bindings(self):"}],"source_content_type":"text/x-python","patch_set":36,"id":"ba3cc151_6646df7c","line":136,"in_reply_to":"ba3cc151_76979b90","updated":"2015-07-08 10:12:39.000000000","message":"Done","commit_id":"e34a948f15f6af7081c5842d0a87600aefff55f2"}],"neutron/tests/unit/scheduler/test_l3_agent_scheduler.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"f0d767bf03e25b3b2bdc14c82b7d6ac650d9aff9","unresolved":false,"context_lines":[{"line_number":252,"context_line":"    def _test__bind_routers_ha(self, has_binding):"},{"line_number":253,"context_line":"        routers \u003d [{\u0027id\u0027: \u0027foo_router\u0027, \u0027ha\u0027: True, \u0027tenant_id\u0027: \u002742\u0027}]"},{"line_number":254,"context_line":"        agent \u003d agents_db.Agent(id\u003d\u0027foo_agent\u0027)"},{"line_number":255,"context_line":"        with contextlib.nested("},{"line_number":256,"context_line":"            mock.patch.object(self.scheduler, \u0027_router_has_binding\u0027,"},{"line_number":257,"context_line":"                              return_value\u003dhas_binding),"},{"line_number":258,"context_line":"            mock.patch.object(self.scheduler, \u0027create_ha_port_and_bind\u0027)) as ("}],"source_content_type":"text/x-python","patch_set":34,"id":"fa32b979_45ae9599","line":255,"updated":"2015-06-26 14:20:33.000000000","message":"This needs to be reverted back to use a with clause (non-nested), like in the original (with the obvious renaming).","commit_id":"a84402262a225fa0346b9b3d6666301e13537ab9"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"b285fd7557a872a101ed09e7051c9f3e7ce15693","unresolved":false,"context_lines":[{"line_number":252,"context_line":"    def _test__bind_routers_ha(self, has_binding):"},{"line_number":253,"context_line":"        routers \u003d [{\u0027id\u0027: \u0027foo_router\u0027, \u0027ha\u0027: True, \u0027tenant_id\u0027: \u002742\u0027}]"},{"line_number":254,"context_line":"        agent \u003d agents_db.Agent(id\u003d\u0027foo_agent\u0027)"},{"line_number":255,"context_line":"        with contextlib.nested("},{"line_number":256,"context_line":"            mock.patch.object(self.scheduler, \u0027_router_has_binding\u0027,"},{"line_number":257,"context_line":"                              return_value\u003dhas_binding),"},{"line_number":258,"context_line":"            mock.patch.object(self.scheduler, \u0027create_ha_port_and_bind\u0027)) as ("}],"source_content_type":"text/x-python","patch_set":34,"id":"fa32b979_716c9436","line":255,"in_reply_to":"fa32b979_45ae9599","updated":"2015-06-28 16:58:32.000000000","message":"True, we\u0027ve stopped using contextlib.nested throughout the code base.","commit_id":"a84402262a225fa0346b9b3d6666301e13537ab9"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"64fd4d2dfdd2e075565c84f9a92c09e13606307a","unresolved":false,"context_lines":[{"line_number":252,"context_line":"    def _test__bind_routers_ha(self, has_binding):"},{"line_number":253,"context_line":"        routers \u003d [{\u0027id\u0027: \u0027foo_router\u0027, \u0027ha\u0027: True, \u0027tenant_id\u0027: \u002742\u0027}]"},{"line_number":254,"context_line":"        agent \u003d agents_db.Agent(id\u003d\u0027foo_agent\u0027)"},{"line_number":255,"context_line":"        with contextlib.nested("},{"line_number":256,"context_line":"            mock.patch.object(self.scheduler, \u0027_router_has_binding\u0027,"},{"line_number":257,"context_line":"                              return_value\u003dhas_binding),"},{"line_number":258,"context_line":"            mock.patch.object(self.scheduler, \u0027create_ha_port_and_bind\u0027)) as ("}],"source_content_type":"text/x-python","patch_set":34,"id":"ba3cc151_e687da10","line":255,"in_reply_to":"fa32b979_716c9436","updated":"2015-06-29 01:18:15.000000000","message":"Done","commit_id":"a84402262a225fa0346b9b3d6666301e13537ab9"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"09598d7800ac76369c3685da9201cd011a399bb6","unresolved":false,"context_lines":[{"line_number":775,"context_line":"        self.plugin.router_scheduler \u003d importutils.import_object("},{"line_number":776,"context_line":"            \u0027neutron.scheduler.l3_agent_scheduler.ChanceScheduler\u0027"},{"line_number":777,"context_line":"        )"},{"line_number":778,"context_line":"        self.router_scheduler \u003d importutils.import_object("},{"line_number":779,"context_line":"            \u0027neutron.scheduler.l3_agent_scheduler.ChanceScheduler\u0027"},{"line_number":780,"context_line":"        )"},{"line_number":781,"context_line":"        self._register_l3_agents()"}],"source_content_type":"text/x-python","patch_set":36,"id":"ba3cc151_56e37733","line":778,"updated":"2015-06-30 19:32:28.000000000","message":"This is unused?","commit_id":"e34a948f15f6af7081c5842d0a87600aefff55f2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"ea32a4c53bb52ff10ec66760fe48b962f660d125","unresolved":false,"context_lines":[{"line_number":775,"context_line":"        self.plugin.router_scheduler \u003d importutils.import_object("},{"line_number":776,"context_line":"            \u0027neutron.scheduler.l3_agent_scheduler.ChanceScheduler\u0027"},{"line_number":777,"context_line":"        )"},{"line_number":778,"context_line":"        self.router_scheduler \u003d importutils.import_object("},{"line_number":779,"context_line":"            \u0027neutron.scheduler.l3_agent_scheduler.ChanceScheduler\u0027"},{"line_number":780,"context_line":"        )"},{"line_number":781,"context_line":"        self._register_l3_agents()"}],"source_content_type":"text/x-python","patch_set":36,"id":"ba3cc151_a63707fe","line":778,"in_reply_to":"ba3cc151_56e37733","updated":"2015-07-08 10:12:39.000000000","message":"Done","commit_id":"e34a948f15f6af7081c5842d0a87600aefff55f2"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"09598d7800ac76369c3685da9201cd011a399bb6","unresolved":false,"context_lines":[{"line_number":1546,"context_line":"        self.assertEqual({\u0027agents\u0027: []},"},{"line_number":1547,"context_line":"                         self.plugin._get_agents_dict_for_router([]))"},{"line_number":1548,"context_line":""},{"line_number":1549,"context_line":"    def test_manual_schedule_ha_router_on_agent(self):"},{"line_number":1550,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1551,"context_line":"        router, agents \u003d self._setup_ha_router()"},{"line_number":1552,"context_line":"        self.assertEqual(2, len(agents))"}],"source_content_type":"text/x-python","patch_set":36,"id":"ba3cc151_16308f9d","line":1549,"updated":"2015-06-30 19:32:28.000000000","message":"Missing coverage for going over the max if it is defined.","commit_id":"e34a948f15f6af7081c5842d0a87600aefff55f2"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"09598d7800ac76369c3685da9201cd011a399bb6","unresolved":false,"context_lines":[{"line_number":1566,"context_line":"        agents \u003d self._get_agents_scheduled_for_router(router)"},{"line_number":1567,"context_line":"        self.assertFalse(agent in agents)"},{"line_number":1568,"context_line":""},{"line_number":1569,"context_line":"    def test_delete_ha_interfaces_from_agent(self):"},{"line_number":1570,"context_line":"        router, agents \u003d self._setup_ha_router()"},{"line_number":1571,"context_line":"        agent \u003d agents.pop()"},{"line_number":1572,"context_line":""}],"source_content_type":"text/x-python","patch_set":36,"id":"ba3cc151_d6b787f3","line":1569,"updated":"2015-06-30 19:32:28.000000000","message":"This test is too high level... It\u0027s better to test delete_ha_interfaces_from_agent in test_l3_hamode_db and not using scheduler code.","commit_id":"e34a948f15f6af7081c5842d0a87600aefff55f2"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"09598d7800ac76369c3685da9201cd011a399bb6","unresolved":false,"context_lines":[{"line_number":1581,"context_line":"        self.assertNotIn(agent.id, results)"},{"line_number":1582,"context_line":""},{"line_number":1583,"context_line":"    def _get_agents_scheduled_for_router(self, router):"},{"line_number":1584,"context_line":"        agents \u003d self.plugin.get_l3_agents_hosting_routers("},{"line_number":1585,"context_line":"            self.adminContext, [router[\u0027id\u0027]],"},{"line_number":1586,"context_line":"            admin_state_up\u003dTrue)"},{"line_number":1587,"context_line":"        return agents"}],"source_content_type":"text/x-python","patch_set":36,"id":"ba3cc151_56685787","line":1584,"updated":"2015-06-30 19:32:28.000000000","message":"Nit: No need for the temp var.","commit_id":"e34a948f15f6af7081c5842d0a87600aefff55f2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"ea32a4c53bb52ff10ec66760fe48b962f660d125","unresolved":false,"context_lines":[{"line_number":1581,"context_line":"        self.assertNotIn(agent.id, results)"},{"line_number":1582,"context_line":""},{"line_number":1583,"context_line":"    def _get_agents_scheduled_for_router(self, router):"},{"line_number":1584,"context_line":"        agents \u003d self.plugin.get_l3_agents_hosting_routers("},{"line_number":1585,"context_line":"            self.adminContext, [router[\u0027id\u0027]],"},{"line_number":1586,"context_line":"            admin_state_up\u003dTrue)"},{"line_number":1587,"context_line":"        return agents"}],"source_content_type":"text/x-python","patch_set":36,"id":"ba3cc151_c6556b1e","line":1584,"in_reply_to":"ba3cc151_56685787","updated":"2015-07-08 10:12:39.000000000","message":"Done","commit_id":"e34a948f15f6af7081c5842d0a87600aefff55f2"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"f1a9126f833ced22e2b7c968c53a91a49ca2ec75","unresolved":false,"context_lines":[{"line_number":1439,"context_line":"        router \u003d {\u0027name\u0027: \u0027router1\u0027, \u0027admin_state_up\u0027: True}"},{"line_number":1440,"context_line":"        if ha is not None:"},{"line_number":1441,"context_line":"            router[\u0027ha\u0027] \u003d ha"},{"line_number":1442,"context_line":"        #"},{"line_number":1443,"context_line":"        return self.plugin.create_router(self.adminContext,"},{"line_number":1444,"context_line":"                                         {\u0027router\u0027: router})"},{"line_number":1445,"context_line":""}],"source_content_type":"text/x-python","patch_set":38,"id":"9a41bdd9_3daa86d5","line":1442,"updated":"2015-07-13 04:04:28.000000000","message":"Please remove the \u0027#\u0027","commit_id":"8c377876dbd67afbb5815363f7b58bbac4268c91"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"d5a75b238e7fe7e5e8c9363f75449abf666fdbef","unresolved":false,"context_lines":[{"line_number":1439,"context_line":"        router \u003d {\u0027name\u0027: \u0027router1\u0027, \u0027admin_state_up\u0027: True}"},{"line_number":1440,"context_line":"        if ha is not None:"},{"line_number":1441,"context_line":"            router[\u0027ha\u0027] \u003d ha"},{"line_number":1442,"context_line":"        #"},{"line_number":1443,"context_line":"        return self.plugin.create_router(self.adminContext,"},{"line_number":1444,"context_line":"                                         {\u0027router\u0027: router})"},{"line_number":1445,"context_line":""}],"source_content_type":"text/x-python","patch_set":38,"id":"9a41bdd9_d31d8bbe","line":1442,"in_reply_to":"9a41bdd9_3daa86d5","updated":"2015-07-13 06:17:48.000000000","message":"Done","commit_id":"8c377876dbd67afbb5815363f7b58bbac4268c91"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"f1a9126f833ced22e2b7c968c53a91a49ca2ec75","unresolved":false,"context_lines":[{"line_number":1549,"context_line":"        router, agents \u003d self._setup_ha_router()"},{"line_number":1550,"context_line":"        self.assertEqual(2, len(agents))"},{"line_number":1551,"context_line":"        agent \u003d helpers.register_l3_agent(host\u003d\u0027myhost_3\u0027)"},{"line_number":1552,"context_line":"        # We allow to exceed max by manual scheduling"},{"line_number":1553,"context_line":"        self.plugin.add_router_to_l3_agent("},{"line_number":1554,"context_line":"            self.adminContext, agent.id, router[\u0027id\u0027])"},{"line_number":1555,"context_line":"        agents \u003d self._get_agents_scheduled_for_router(router)"}],"source_content_type":"text/x-python","patch_set":38,"id":"9a41bdd9_5dd0aa53","line":1552,"updated":"2015-07-13 04:04:28.000000000","message":"nit: s/max by/max l3 agents via","commit_id":"8c377876dbd67afbb5815363f7b58bbac4268c91"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"d5a75b238e7fe7e5e8c9363f75449abf666fdbef","unresolved":false,"context_lines":[{"line_number":1549,"context_line":"        router, agents \u003d self._setup_ha_router()"},{"line_number":1550,"context_line":"        self.assertEqual(2, len(agents))"},{"line_number":1551,"context_line":"        agent \u003d helpers.register_l3_agent(host\u003d\u0027myhost_3\u0027)"},{"line_number":1552,"context_line":"        # We allow to exceed max by manual scheduling"},{"line_number":1553,"context_line":"        self.plugin.add_router_to_l3_agent("},{"line_number":1554,"context_line":"            self.adminContext, agent.id, router[\u0027id\u0027])"},{"line_number":1555,"context_line":"        agents \u003d self._get_agents_scheduled_for_router(router)"}],"source_content_type":"text/x-python","patch_set":38,"id":"9a41bdd9_b32007f9","line":1552,"in_reply_to":"9a41bdd9_5dd0aa53","updated":"2015-07-13 06:17:48.000000000","message":"Done","commit_id":"8c377876dbd67afbb5815363f7b58bbac4268c91"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"f1a9126f833ced22e2b7c968c53a91a49ca2ec75","unresolved":false,"context_lines":[{"line_number":1552,"context_line":"        # We allow to exceed max by manual scheduling"},{"line_number":1553,"context_line":"        self.plugin.add_router_to_l3_agent("},{"line_number":1554,"context_line":"            self.adminContext, agent.id, router[\u0027id\u0027])"},{"line_number":1555,"context_line":"        agents \u003d self._get_agents_scheduled_for_router(router)"},{"line_number":1556,"context_line":"        self.assertIn(agent.id, [_agent.id for _agent in agents])"},{"line_number":1557,"context_line":""},{"line_number":1558,"context_line":"    def test_manual_remove_ha_router_from_agent(self):"}],"source_content_type":"text/x-python","patch_set":38,"id":"9a41bdd9_dd96fa93","line":1555,"updated":"2015-07-13 04:04:28.000000000","message":"Pls include the following validation here.\nself.assertEqual(3, len(agents))","commit_id":"8c377876dbd67afbb5815363f7b58bbac4268c91"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"d5a75b238e7fe7e5e8c9363f75449abf666fdbef","unresolved":false,"context_lines":[{"line_number":1552,"context_line":"        # We allow to exceed max by manual scheduling"},{"line_number":1553,"context_line":"        self.plugin.add_router_to_l3_agent("},{"line_number":1554,"context_line":"            self.adminContext, agent.id, router[\u0027id\u0027])"},{"line_number":1555,"context_line":"        agents \u003d self._get_agents_scheduled_for_router(router)"},{"line_number":1556,"context_line":"        self.assertIn(agent.id, [_agent.id for _agent in agents])"},{"line_number":1557,"context_line":""},{"line_number":1558,"context_line":"    def test_manual_remove_ha_router_from_agent(self):"}],"source_content_type":"text/x-python","patch_set":38,"id":"9a41bdd9_f3268f15","line":1555,"in_reply_to":"9a41bdd9_dd96fa93","updated":"2015-07-13 06:17:48.000000000","message":"Done","commit_id":"8c377876dbd67afbb5815363f7b58bbac4268c91"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"f1a9126f833ced22e2b7c968c53a91a49ca2ec75","unresolved":false,"context_lines":[{"line_number":1566,"context_line":"        self.assertEqual(1, len(agents))"},{"line_number":1567,"context_line":"        self.assertNotIn(agent.id, [_agent.id for _agent in agents])"},{"line_number":1568,"context_line":""},{"line_number":1569,"context_line":"    def test_manual_remove_ha_router_from_agent_tozero(self):"},{"line_number":1570,"context_line":"        router, agents \u003d self._setup_ha_router()"},{"line_number":1571,"context_line":"        self.assertEqual(2, len(agents))"},{"line_number":1572,"context_line":"        agent \u003d agents.pop()"}],"source_content_type":"text/x-python","patch_set":38,"id":"9a41bdd9_fdc17e81","line":1569,"updated":"2015-07-13 04:04:28.000000000","message":"nit: s/agent_tozero/all_agents","commit_id":"8c377876dbd67afbb5815363f7b58bbac4268c91"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"d5a75b238e7fe7e5e8c9363f75449abf666fdbef","unresolved":false,"context_lines":[{"line_number":1566,"context_line":"        self.assertEqual(1, len(agents))"},{"line_number":1567,"context_line":"        self.assertNotIn(agent.id, [_agent.id for _agent in agents])"},{"line_number":1568,"context_line":""},{"line_number":1569,"context_line":"    def test_manual_remove_ha_router_from_agent_tozero(self):"},{"line_number":1570,"context_line":"        router, agents \u003d self._setup_ha_router()"},{"line_number":1571,"context_line":"        self.assertEqual(2, len(agents))"},{"line_number":1572,"context_line":"        agent \u003d agents.pop()"}],"source_content_type":"text/x-python","patch_set":38,"id":"9a41bdd9_53117bab","line":1569,"in_reply_to":"9a41bdd9_fdc17e81","updated":"2015-07-13 06:17:48.000000000","message":"Done","commit_id":"8c377876dbd67afbb5815363f7b58bbac4268c91"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"f1a9126f833ced22e2b7c968c53a91a49ca2ec75","unresolved":false,"context_lines":[{"line_number":1598,"context_line":"        self.assertNotIn(agent.id, results)"},{"line_number":1599,"context_line":""},{"line_number":1600,"context_line":"    def test_add_ha_interface_to_l3_agent(self):"},{"line_number":1601,"context_line":""},{"line_number":1602,"context_line":"        agent \u003d self.plugin.get_agents_db(self.adminContext)[0]"},{"line_number":1603,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1604,"context_line":"        self.plugin.add_router_to_l3_agent(self.adminContext, agent.id,"}],"source_content_type":"text/x-python","patch_set":38,"id":"9a41bdd9_9df152d0","line":1601,"updated":"2015-07-13 04:04:28.000000000","message":"nit: empty line can be removed.","commit_id":"8c377876dbd67afbb5815363f7b58bbac4268c91"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"d5a75b238e7fe7e5e8c9363f75449abf666fdbef","unresolved":false,"context_lines":[{"line_number":1598,"context_line":"        self.assertNotIn(agent.id, results)"},{"line_number":1599,"context_line":""},{"line_number":1600,"context_line":"    def test_add_ha_interface_to_l3_agent(self):"},{"line_number":1601,"context_line":""},{"line_number":1602,"context_line":"        agent \u003d self.plugin.get_agents_db(self.adminContext)[0]"},{"line_number":1603,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1604,"context_line":"        self.plugin.add_router_to_l3_agent(self.adminContext, agent.id,"}],"source_content_type":"text/x-python","patch_set":38,"id":"9a41bdd9_330cf793","line":1601,"in_reply_to":"9a41bdd9_9df152d0","updated":"2015-07-13 06:17:48.000000000","message":"Done","commit_id":"8c377876dbd67afbb5815363f7b58bbac4268c91"}],"neutron/tests/unit/test_l3_schedulers.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4216ecba569acd13149c93680e9bc44b4968267e","unresolved":false,"context_lines":[{"line_number":1229,"context_line":"            self.plugin.reschedule_routers_from_down_agents()"},{"line_number":1230,"context_line":"            self.assertFalse(reschedule.called)"},{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":""},{"line_number":1233,"context_line":"class L3AgentManualScheduleDbMixinTestCase(L3HATestCaseMixin):"},{"line_number":1234,"context_line":""},{"line_number":1235,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_41b9a0ca","line":1232,"updated":"2014-12-25 11:28:36.000000000","message":"You can, and should fold your two tests into the previous test case. Normally a test case tests a class, or a certain configuration. Here, L3AgentSchedulerDbMixin is the class you\u0027re targeting, which is being tested in the test case above. \u0027L3AgentManualScheduleDbMixin\u0027 doesn\u0027t actually exist anywhere, it can be a bit misleading. The test above should not be affected.","commit_id":"ad095b9c73f4c0927cea92f8fcce535afc07deae"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4216ecba569acd13149c93680e9bc44b4968267e","unresolved":false,"context_lines":[{"line_number":1235,"context_line":"    def setUp(self):"},{"line_number":1236,"context_line":"        super(L3AgentManualScheduleDbMixinTestCase, self).setUp()"},{"line_number":1237,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 2)"},{"line_number":1238,"context_line":""},{"line_number":1239,"context_line":"    def _register_l3_agents(self, plugin\u003dNone):"},{"line_number":1240,"context_line":"        super(L3AgentManualScheduleDbMixinTestCase,"},{"line_number":1241,"context_line":"              self)._register_l3_agents(plugin\u003dplugin)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_a186c4b8","line":1238,"updated":"2014-12-25 11:28:36.000000000","message":"You don\u0027t actually need this third agent for all of the tests in this class, I\u0027d just remove it. Please see the comment in line 1269.","commit_id":"ad095b9c73f4c0927cea92f8fcce535afc07deae"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4216ecba569acd13149c93680e9bc44b4968267e","unresolved":false,"context_lines":[{"line_number":1246,"context_line":"    def test_manual_remove_ha_router_from_agent(self):"},{"line_number":1247,"context_line":"        self.router \u003d self._create_ha_router()"},{"line_number":1248,"context_line":"        # Schedule router and make sure it was scheduled"},{"line_number":1249,"context_line":"        self.plugin.schedule_router(self.adminContext, self.router[\u0027id\u0027])"},{"line_number":1250,"context_line":"        agents \u003d self.plugin.get_l3_agents_hosting_routers("},{"line_number":1251,"context_line":"            self.adminContext, [self.router[\u0027id\u0027]],"},{"line_number":1252,"context_line":"            admin_state_up\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_417c40ec","line":1249,"updated":"2014-12-25 11:28:36.000000000","message":"You can extract these lines to a helper that gets the agents a router is scheduled on, asserts the expected amount (A parameter) and returns the agents. You can then use it here, 1260 and 1270.","commit_id":"ad095b9c73f4c0927cea92f8fcce535afc07deae"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4216ecba569acd13149c93680e9bc44b4968267e","unresolved":false,"context_lines":[{"line_number":1262,"context_line":"            admin_state_up\u003dTrue)"},{"line_number":1263,"context_line":"        self.assertEqual(1, len(agents))"},{"line_number":1264,"context_line":"        self.assertFalse(agent in agents)"},{"line_number":1265,"context_line":""},{"line_number":1266,"context_line":"    def test_manual_schedule_ha_router_on_agent(self):"},{"line_number":1267,"context_line":"        self.router \u003d self._create_ha_router()"},{"line_number":1268,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_c1f2f09a","line":1265,"updated":"2014-12-25 11:28:36.000000000","message":"nit: I would probably locate this test first.","commit_id":"ad095b9c73f4c0927cea92f8fcce535afc07deae"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4216ecba569acd13149c93680e9bc44b4968267e","unresolved":false,"context_lines":[{"line_number":1266,"context_line":"    def test_manual_schedule_ha_router_on_agent(self):"},{"line_number":1267,"context_line":"        self.router \u003d self._create_ha_router()"},{"line_number":1268,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1269,"context_line":""},{"line_number":1270,"context_line":"        # Schedule router and make sure it was scheduled"},{"line_number":1271,"context_line":"        self.plugin.schedule_router(self.adminContext, self.router[\u0027id\u0027])"},{"line_number":1272,"context_line":"        agents \u003d self.plugin.get_l3_agents_hosting_routers("}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_81b9c87b","line":1269,"updated":"2014-12-25 11:28:36.000000000","message":"I would probably simplify this test so that it creates a router, schedules it, registers a third agent, then asserts check_agent_router_scheduling_needed(third_agent).","commit_id":"ad095b9c73f4c0927cea92f8fcce535afc07deae"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"0cb87e8aa10d8d3b500f7928ccd2de49f2e94706","unresolved":false,"context_lines":[{"line_number":1217,"context_line":""},{"line_number":1218,"context_line":"class L3AgentSchedulerDbMixinTestCase(L3HATestCaseMixin):"},{"line_number":1219,"context_line":""},{"line_number":1220,"context_line":"    def test_reschedule_ha_routers_from_down_agents(self):"},{"line_number":1221,"context_line":"        self.router \u003d self._create_ha_router()"},{"line_number":1222,"context_line":"        self.plugin.schedule_router(self.adminContext, self.router[\u0027id\u0027])"},{"line_number":1223,"context_line":"        self._verify_amount_of_router_scheduled_agents(2)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_e9a7d24e","line":1220,"updated":"2014-12-25 14:25:37.000000000","message":"You really don\u0027t want test classes to hold state if you don\u0027t need to. _verify_amount_of_router_scheduled_agents should accept a router argument.","commit_id":"0bab69fdd59560f61ca4cf50e31b7c3d37590bb8"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"52f60d61191a66d22c248e5dfb99d15aec8d51cf","unresolved":false,"context_lines":[{"line_number":1217,"context_line":""},{"line_number":1218,"context_line":"class L3AgentSchedulerDbMixinTestCase(L3HATestCaseMixin):"},{"line_number":1219,"context_line":""},{"line_number":1220,"context_line":"    def test_reschedule_ha_routers_from_down_agents(self):"},{"line_number":1221,"context_line":"        self.router \u003d self._create_ha_router()"},{"line_number":1222,"context_line":"        self.plugin.schedule_router(self.adminContext, self.router[\u0027id\u0027])"},{"line_number":1223,"context_line":"        self._verify_amount_of_router_scheduled_agents(2)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_94156f9d","line":1220,"in_reply_to":"3a961159_e9a7d24e","updated":"2014-12-28 06:10:12.000000000","message":"Done","commit_id":"0bab69fdd59560f61ca4cf50e31b7c3d37590bb8"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"0cb87e8aa10d8d3b500f7928ccd2de49f2e94706","unresolved":false,"context_lines":[{"line_number":1253,"context_line":"        schedule \u003d self.plugin.check_ha_router_agent_scheduling_valid("},{"line_number":1254,"context_line":"            [\u0027agent1\u0027, \u0027agent2\u0027])"},{"line_number":1255,"context_line":"        self.assertTrue(schedule)"},{"line_number":1256,"context_line":""},{"line_number":1257,"context_line":"    def test_check_agent_ha_router_scheduling_is_max(self):"},{"line_number":1258,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1259,"context_line":"        schedule \u003d self.plugin.check_ha_router_agent_scheduling_valid("}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_a9222ab8","line":1256,"updated":"2014-12-25 14:25:37.000000000","message":"Missing unit test for when max is 0.","commit_id":"0bab69fdd59560f61ca4cf50e31b7c3d37590bb8"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"52f60d61191a66d22c248e5dfb99d15aec8d51cf","unresolved":false,"context_lines":[{"line_number":1253,"context_line":"        schedule \u003d self.plugin.check_ha_router_agent_scheduling_valid("},{"line_number":1254,"context_line":"            [\u0027agent1\u0027, \u0027agent2\u0027])"},{"line_number":1255,"context_line":"        self.assertTrue(schedule)"},{"line_number":1256,"context_line":""},{"line_number":1257,"context_line":"    def test_check_agent_ha_router_scheduling_is_max(self):"},{"line_number":1258,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1259,"context_line":"        schedule \u003d self.plugin.check_ha_router_agent_scheduling_valid("}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_b40a6b77","line":1256,"in_reply_to":"3a961159_9d85a409","updated":"2014-12-28 06:10:12.000000000","message":"Done","commit_id":"0bab69fdd59560f61ca4cf50e31b7c3d37590bb8"},{"author":{"_account_id":14039,"name":"watanabe isao","email":"watanabe.isao.openstack@gmail.com","username":"watanabe.isao"},"change_message_id":"e8bc9c59a6cfd688aeb3bceadfa5bc8c76f13630","unresolved":false,"context_lines":[{"line_number":1253,"context_line":"        schedule \u003d self.plugin.check_ha_router_agent_scheduling_valid("},{"line_number":1254,"context_line":"            [\u0027agent1\u0027, \u0027agent2\u0027])"},{"line_number":1255,"context_line":"        self.assertTrue(schedule)"},{"line_number":1256,"context_line":""},{"line_number":1257,"context_line":"    def test_check_agent_ha_router_scheduling_is_max(self):"},{"line_number":1258,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1259,"context_line":"        schedule \u003d self.plugin.check_ha_router_agent_scheduling_valid("}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_9d85a409","line":1256,"in_reply_to":"3a961159_a9222ab8","updated":"2014-12-26 00:30:58.000000000","message":"+1 to Assaf Muller","commit_id":"0bab69fdd59560f61ca4cf50e31b7c3d37590bb8"},{"author":{"_account_id":14039,"name":"watanabe isao","email":"watanabe.isao.openstack@gmail.com","username":"watanabe.isao"},"change_message_id":"e8bc9c59a6cfd688aeb3bceadfa5bc8c76f13630","unresolved":false,"context_lines":[{"line_number":1269,"context_line":""},{"line_number":1270,"context_line":"    def _register_additional_l3_agent(self):"},{"line_number":1271,"context_line":"        self.agent3 \u003d self._register_l3_agent(THIRD_L3_AGENT, self.plugin)"},{"line_number":1272,"context_line":"        self.agent_id3 \u003d self.agent3.id"},{"line_number":1273,"context_line":""},{"line_number":1274,"context_line":""},{"line_number":1275,"context_line":"class L3HAChanceSchedulerTestCase(L3HATestCaseMixin):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_dd9d6c59","line":1272,"updated":"2014-12-26 00:30:58.000000000","message":"Just a suggest. self.agent_id3\u003d\u003d\u003eself.agent3_id","commit_id":"0bab69fdd59560f61ca4cf50e31b7c3d37590bb8"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"52f60d61191a66d22c248e5dfb99d15aec8d51cf","unresolved":false,"context_lines":[{"line_number":1269,"context_line":""},{"line_number":1270,"context_line":"    def _register_additional_l3_agent(self):"},{"line_number":1271,"context_line":"        self.agent3 \u003d self._register_l3_agent(THIRD_L3_AGENT, self.plugin)"},{"line_number":1272,"context_line":"        self.agent_id3 \u003d self.agent3.id"},{"line_number":1273,"context_line":""},{"line_number":1274,"context_line":""},{"line_number":1275,"context_line":"class L3HAChanceSchedulerTestCase(L3HATestCaseMixin):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_14217ffc","line":1272,"in_reply_to":"3a961159_dd9d6c59","updated":"2014-12-28 06:10:12.000000000","message":"Done","commit_id":"0bab69fdd59560f61ca4cf50e31b7c3d37590bb8"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6da369fc4f309e78c6ca81c61f031a0114f55b57","unresolved":false,"context_lines":[{"line_number":1241,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1242,"context_line":"        self.plugin.schedule_router(self.adminContext, router[\u0027id\u0027])"},{"line_number":1243,"context_line":"        agents \u003d self._verify_amount_of_router_scheduled_agents(router, 2)"},{"line_number":1244,"context_line":"        agent \u003d agents[0]"},{"line_number":1245,"context_line":"        # Remove router from agent and make sure it is removed"},{"line_number":1246,"context_line":"        self.plugin.remove_router_from_l3_agent("},{"line_number":1247,"context_line":"            self.adminContext, agent.id, router[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_c572dcaf","line":1244,"updated":"2014-12-29 11:19:12.000000000","message":"(not a must) since you don\u0027t use the value of \u0027agents\u0027 in this context, why not do \u0027agent \u003d agents.pop()\u0027? This will eliminate the agents[0] (which, while a minor change, can still make the code look a bit better).","commit_id":"92da08355c2e2eeffe5264b0d6dfa6d0f891e954"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"f8cb4a32d7be96a775a66818a3627d1543b788b2","unresolved":false,"context_lines":[{"line_number":1241,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1242,"context_line":"        self.plugin.schedule_router(self.adminContext, router[\u0027id\u0027])"},{"line_number":1243,"context_line":"        agents \u003d self._verify_amount_of_router_scheduled_agents(router, 2)"},{"line_number":1244,"context_line":"        agent \u003d agents[0]"},{"line_number":1245,"context_line":"        # Remove router from agent and make sure it is removed"},{"line_number":1246,"context_line":"        self.plugin.remove_router_from_l3_agent("},{"line_number":1247,"context_line":"            self.adminContext, agent.id, router[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_8591b4f3","line":1244,"in_reply_to":"3a961159_c572dcaf","updated":"2014-12-29 12:23:15.000000000","message":"Done","commit_id":"92da08355c2e2eeffe5264b0d6dfa6d0f891e954"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6da369fc4f309e78c6ca81c61f031a0114f55b57","unresolved":false,"context_lines":[{"line_number":1248,"context_line":"        agents \u003d self._verify_amount_of_router_scheduled_agents(router, 1)"},{"line_number":1249,"context_line":"        self.assertFalse(agent in agents)"},{"line_number":1250,"context_line":""},{"line_number":1251,"context_line":"    def test_check_agent_ha_router_scheduling_not_max(self):"},{"line_number":1252,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1253,"context_line":"        schedule \u003d self.plugin.check_ha_router_agent_scheduling_valid("},{"line_number":1254,"context_line":"            [\u0027agent1\u0027, \u0027agent2\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_e5027808","line":1251,"updated":"2014-12-29 11:19:12.000000000","message":"The next 3 functions are very much the same - the number of agents change, the assertTrue might change to assertFalse, and \u0027max_l3_agents_per_network\u0027 value changes. These functions can probably be refactored to not be so code-duplicating.","commit_id":"92da08355c2e2eeffe5264b0d6dfa6d0f891e954"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"f8cb4a32d7be96a775a66818a3627d1543b788b2","unresolved":false,"context_lines":[{"line_number":1248,"context_line":"        agents \u003d self._verify_amount_of_router_scheduled_agents(router, 1)"},{"line_number":1249,"context_line":"        self.assertFalse(agent in agents)"},{"line_number":1250,"context_line":""},{"line_number":1251,"context_line":"    def test_check_agent_ha_router_scheduling_not_max(self):"},{"line_number":1252,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1253,"context_line":"        schedule \u003d self.plugin.check_ha_router_agent_scheduling_valid("},{"line_number":1254,"context_line":"            [\u0027agent1\u0027, \u0027agent2\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_57185f1e","line":1251,"in_reply_to":"3a961159_e5027808","updated":"2014-12-29 12:23:15.000000000","message":"Done","commit_id":"92da08355c2e2eeffe5264b0d6dfa6d0f891e954"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"454a1fa75fd65553894e5cd3d1a281015640a9a4","unresolved":false,"context_lines":[{"line_number":1251,"context_line":"    def test_check_agent_ha_router_scheduling_not_max(self):"},{"line_number":1252,"context_line":"        self._check_agent_ha_router_scheduling(3, 2, True)"},{"line_number":1253,"context_line":""},{"line_number":1254,"context_line":"    def test_check_agent_ha_router_scheduling_is_max(self):"},{"line_number":1255,"context_line":"        self._check_agent_ha_router_scheduling(3, 3, False)"},{"line_number":1256,"context_line":""},{"line_number":1257,"context_line":"    def test_check_agent_ha_router_scheduling_is_unlimited(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_57abff74","line":1254,"updated":"2014-12-29 12:36:29.000000000","message":"Please pass the argument names here (3, 3, False) doesn\u0027t mean much to me. max_l3_agents\u003d3, number_of_agents\u003d3, assert_type\u003dFalse is more readable.\n\nSome might suggest to split out _check_agent_ha_router_scheduling and use scenarios here, like in:\nhttps://review.openstack.org/#/c/140833/4/neutron/tests/unit/db/test_agent_db.py\n\nYour call.","commit_id":"cf8caca4a13788d5a3a83d6b85b9482cf7f47053"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"810ffa04f0e831fab145be3cee1a840b53a7dde6","unresolved":false,"context_lines":[{"line_number":1251,"context_line":"    def test_check_agent_ha_router_scheduling_not_max(self):"},{"line_number":1252,"context_line":"        self._check_agent_ha_router_scheduling(3, 2, True)"},{"line_number":1253,"context_line":""},{"line_number":1254,"context_line":"    def test_check_agent_ha_router_scheduling_is_max(self):"},{"line_number":1255,"context_line":"        self._check_agent_ha_router_scheduling(3, 3, False)"},{"line_number":1256,"context_line":""},{"line_number":1257,"context_line":"    def test_check_agent_ha_router_scheduling_is_unlimited(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_3ad81a7f","line":1254,"in_reply_to":"3a961159_57abff74","updated":"2014-12-29 13:14:48.000000000","message":"Done, with the simple approach of named arguments","commit_id":"cf8caca4a13788d5a3a83d6b85b9482cf7f47053"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"454a1fa75fd65553894e5cd3d1a281015640a9a4","unresolved":false,"context_lines":[{"line_number":1258,"context_line":"        self._check_agent_ha_router_scheduling(0, 2, True)"},{"line_number":1259,"context_line":""},{"line_number":1260,"context_line":"    def _check_agent_ha_router_scheduling(self, max_l3_agents\u003d0,"},{"line_number":1261,"context_line":"                                          number_of_agents\u003d2,"},{"line_number":1262,"context_line":"                                          assert_type\u003dTrue):"},{"line_number":1263,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, max_l3_agents)"},{"line_number":1264,"context_line":"        valid \u003d self.plugin.check_ha_router_agent_scheduling_valid("}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_f7014b6b","line":1261,"updated":"2014-12-29 12:36:29.000000000","message":"Please rename assert_type to \u0027expected\u0027, and in line 1266 just check: self.assertEqual(expected, valid)","commit_id":"cf8caca4a13788d5a3a83d6b85b9482cf7f47053"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"810ffa04f0e831fab145be3cee1a840b53a7dde6","unresolved":false,"context_lines":[{"line_number":1258,"context_line":"        self._check_agent_ha_router_scheduling(0, 2, True)"},{"line_number":1259,"context_line":""},{"line_number":1260,"context_line":"    def _check_agent_ha_router_scheduling(self, max_l3_agents\u003d0,"},{"line_number":1261,"context_line":"                                          number_of_agents\u003d2,"},{"line_number":1262,"context_line":"                                          assert_type\u003dTrue):"},{"line_number":1263,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, max_l3_agents)"},{"line_number":1264,"context_line":"        valid \u003d self.plugin.check_ha_router_agent_scheduling_valid("}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_5ae5e636","line":1261,"in_reply_to":"3a961159_f7014b6b","updated":"2014-12-29 13:14:48.000000000","message":"Done","commit_id":"cf8caca4a13788d5a3a83d6b85b9482cf7f47053"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"454a1fa75fd65553894e5cd3d1a281015640a9a4","unresolved":false,"context_lines":[{"line_number":1261,"context_line":"                                          number_of_agents\u003d2,"},{"line_number":1262,"context_line":"                                          assert_type\u003dTrue):"},{"line_number":1263,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, max_l3_agents)"},{"line_number":1264,"context_line":"        valid \u003d self.plugin.check_ha_router_agent_scheduling_valid("},{"line_number":1265,"context_line":"            [agent_id for agent_id in xrange(number_of_agents)])"},{"line_number":1266,"context_line":"        self.assertTrue(valid) if assert_type else self.assertFalse(valid)"},{"line_number":1267,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_9729e7f4","line":1264,"updated":"2014-12-29 12:36:29.000000000","message":"xrange is not Python 3 compatible. You can use the six library here, or just use regular range.","commit_id":"cf8caca4a13788d5a3a83d6b85b9482cf7f47053"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"810ffa04f0e831fab145be3cee1a840b53a7dde6","unresolved":false,"context_lines":[{"line_number":1261,"context_line":"                                          number_of_agents\u003d2,"},{"line_number":1262,"context_line":"                                          assert_type\u003dTrue):"},{"line_number":1263,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, max_l3_agents)"},{"line_number":1264,"context_line":"        valid \u003d self.plugin.check_ha_router_agent_scheduling_valid("},{"line_number":1265,"context_line":"            [agent_id for agent_id in xrange(number_of_agents)])"},{"line_number":1266,"context_line":"        self.assertTrue(valid) if assert_type else self.assertFalse(valid)"},{"line_number":1267,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_bad32a5e","line":1264,"in_reply_to":"3a961159_9729e7f4","updated":"2014-12-29 13:14:48.000000000","message":"Done, with range()","commit_id":"cf8caca4a13788d5a3a83d6b85b9482cf7f47053"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"54fb127ba1b23d0b72c7ef07d864bf617173e2c2","unresolved":false,"context_lines":[{"line_number":1237,"context_line":"            self.adminContext, self.agent3, router)"},{"line_number":1238,"context_line":"        self.assertTrue(schedule_valid)"},{"line_number":1239,"context_line":""},{"line_number":1240,"context_line":"    def test_manual_remove_ha_router_from_agent(self):"},{"line_number":1241,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1242,"context_line":"        self.plugin.schedule_router(self.adminContext, router[\u0027id\u0027])"},{"line_number":1243,"context_line":"        agents \u003d self._verify_amount_of_router_scheduled_agents(router, 2)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_0504b6c4","line":1240,"updated":"2014-12-31 20:29:11.000000000","message":"I don\u0027t understand why this test is suggested by your code changes.  Would you please explain your reasoning?","commit_id":"95397bde1737eff7b7313d792be551fb6049a8b6"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"c10b4c3e405b43b4c959c38491fec0e2b61bb2ad","unresolved":false,"context_lines":[{"line_number":1237,"context_line":"            self.adminContext, self.agent3, router)"},{"line_number":1238,"context_line":"        self.assertTrue(schedule_valid)"},{"line_number":1239,"context_line":""},{"line_number":1240,"context_line":"    def test_manual_remove_ha_router_from_agent(self):"},{"line_number":1241,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1242,"context_line":"        self.plugin.schedule_router(self.adminContext, router[\u0027id\u0027])"},{"line_number":1243,"context_line":"        agents \u003d self._verify_amount_of_router_scheduled_agents(router, 2)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_30be4e65","line":1240,"in_reply_to":"3a961159_0504b6c4","updated":"2015-01-01 05:27:34.000000000","message":"My code relates to adding a router on an agent rather then removing one. I just didn\u0027t find a test for un-scheduling an agent and so i decided to add one. It\u0027s more of a \u0027good will\u0027 addition rather then a necessity.","commit_id":"95397bde1737eff7b7313d792be551fb6049a8b6"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"54fb127ba1b23d0b72c7ef07d864bf617173e2c2","unresolved":false,"context_lines":[{"line_number":1271,"context_line":"            number_of_agents)"},{"line_number":1272,"context_line":"        self.assertEqual(expected, valid)"},{"line_number":1273,"context_line":""},{"line_number":1274,"context_line":"    def _verify_amount_of_router_scheduled_agents(self, router,"},{"line_number":1275,"context_line":"                                                  expected_amount):"},{"line_number":1276,"context_line":"        agents \u003d self.plugin.get_l3_agents_hosting_routers("},{"line_number":1277,"context_line":"            self.adminContext, [router[\u0027id\u0027]],"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_8594268d","line":1274,"updated":"2014-12-31 20:29:11.000000000","message":"I think you\u0027re trying to do too much in this function.  Having a helper that makes it easier to retrieve the agents from a router makes sense, but asserting the quantity should be done in the tests directly.","commit_id":"95397bde1737eff7b7313d792be551fb6049a8b6"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"c10b4c3e405b43b4c959c38491fec0e2b61bb2ad","unresolved":false,"context_lines":[{"line_number":1271,"context_line":"            number_of_agents)"},{"line_number":1272,"context_line":"        self.assertEqual(expected, valid)"},{"line_number":1273,"context_line":""},{"line_number":1274,"context_line":"    def _verify_amount_of_router_scheduled_agents(self, router,"},{"line_number":1275,"context_line":"                                                  expected_amount):"},{"line_number":1276,"context_line":"        agents \u003d self.plugin.get_l3_agents_hosting_routers("},{"line_number":1277,"context_line":"            self.adminContext, [router[\u0027id\u0027]],"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_d0a8aa22","line":1274,"in_reply_to":"3a961159_8594268d","updated":"2015-01-01 05:27:34.000000000","message":"Done","commit_id":"95397bde1737eff7b7313d792be551fb6049a8b6"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d85ba4b3ca802b2defb9e127e26ffce8948a74b1","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"# the below code is required for the following reason"},{"line_number":50,"context_line":"# (as documented in testscenarios)"},{"line_number":51,"context_line":"\"\"\"Multiply tests depending on their \u0027scenarios\u0027 attribute."},{"line_number":52,"context_line":"   This can be assigned to \u0027load_tests\u0027 in any test module to make this"},{"line_number":53,"context_line":"   automatically work across tests in the module."},{"line_number":54,"context_line":"\"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_61bc00b6","line":51,"updated":"2015-01-08 14:48:57.000000000","message":"Multiply -\u003e Multiple?","commit_id":"bf98cb8aee056d3cd7a15b8766a4b1625c3db323"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"49dbf580b06f8ac65d606789e062ef0df98ecefa","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"# the below code is required for the following reason"},{"line_number":50,"context_line":"# (as documented in testscenarios)"},{"line_number":51,"context_line":"\"\"\"Multiply tests depending on their \u0027scenarios\u0027 attribute."},{"line_number":52,"context_line":"   This can be assigned to \u0027load_tests\u0027 in any test module to make this"},{"line_number":53,"context_line":"   automatically work across tests in the module."},{"line_number":54,"context_line":"\"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_c5066b1c","line":51,"in_reply_to":"3a961159_61bc00b6","updated":"2015-01-11 09:01:01.000000000","message":"Done","commit_id":"bf98cb8aee056d3cd7a15b8766a4b1625c3db323"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"30e8a327b2b16dde54e9ff0cce04df0ee0a53ffe","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"# the below code is required for the following reason"},{"line_number":50,"context_line":"# (as documented in testscenarios)"},{"line_number":51,"context_line":"\"\"\"Multiple tests depending on their \u0027scenarios\u0027 attribute."},{"line_number":52,"context_line":"   This can be assigned to \u0027load_tests\u0027 in any test module to make this"},{"line_number":53,"context_line":"   automatically work across tests in the module."},{"line_number":54,"context_line":"\"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_0c507e09","line":51,"updated":"2015-01-12 19:46:35.000000000","message":"Please revert this unrelated non-functional change, and know that you can safely ignore reviewer commentary asking you to perform such a change.","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"0abb1866925c35f3452b9f994fc5a8ddbc78423d","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"# the below code is required for the following reason"},{"line_number":50,"context_line":"# (as documented in testscenarios)"},{"line_number":51,"context_line":"\"\"\"Multiple tests depending on their \u0027scenarios\u0027 attribute."},{"line_number":52,"context_line":"   This can be assigned to \u0027load_tests\u0027 in any test module to make this"},{"line_number":53,"context_line":"   automatically work across tests in the module."},{"line_number":54,"context_line":"\"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_592f97a7","line":51,"in_reply_to":"3a961159_0c507e09","updated":"2015-01-13 05:35:27.000000000","message":"Done","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"30e8a327b2b16dde54e9ff0cce04df0ee0a53ffe","unresolved":false,"context_lines":[{"line_number":1205,"context_line":"            self.plugin.reschedule_routers_from_down_agents()"},{"line_number":1206,"context_line":"            self.assertFalse(reschedule.called)"},{"line_number":1207,"context_line":""},{"line_number":1208,"context_line":"    def test_manual_schedule_ha_router_on_agent(self):"},{"line_number":1209,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1210,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1211,"context_line":"        self.plugin.schedule_router(self.adminContext, router[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_2c0d3ae9","line":1208,"updated":"2015-01-12 19:46:35.000000000","message":"(No action required) It should be possible to target your change to check_agent_router_scheduling_needed directly, such that all these supporting function calls are not needed.  If and when that is not possible, a refactor for testability is usually suggested.","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"0abb1866925c35f3452b9f994fc5a8ddbc78423d","unresolved":false,"context_lines":[{"line_number":1205,"context_line":"            self.plugin.reschedule_routers_from_down_agents()"},{"line_number":1206,"context_line":"            self.assertFalse(reschedule.called)"},{"line_number":1207,"context_line":""},{"line_number":1208,"context_line":"    def test_manual_schedule_ha_router_on_agent(self):"},{"line_number":1209,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1210,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1211,"context_line":"        self.plugin.schedule_router(self.adminContext, router[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_f9d3e3d0","line":1208,"in_reply_to":"3a961159_2c0d3ae9","updated":"2015-01-13 05:35:27.000000000","message":"I thought it won\u0027t hurt to do a more \"functional\" test.\nIt might not be suited at this location though.","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"30e8a327b2b16dde54e9ff0cce04df0ee0a53ffe","unresolved":false,"context_lines":[{"line_number":1229,"context_line":"        agents \u003d self._get_num_of_agents_scheduled_for_router(router)"},{"line_number":1230,"context_line":"        self.assertFalse(agent in agents)"},{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"    def test_check_agent_ha_router_scheduling_not_max(self):"},{"line_number":1233,"context_line":"        self._check_agent_ha_router_scheduling(max_l3_agents\u003d3,"},{"line_number":1234,"context_line":"                                               number_of_agents\u003d2,"},{"line_number":1235,"context_line":"                                               expected\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_8cd70e4f","line":1232,"updated":"2015-01-12 19:46:35.000000000","message":"(No action required) If you\u0027re interested in finding ways to do this kind of parameter-driven testing more effectively, consider looking into testscenarios (the reason for the \u0027load_tests\u0027 declaration in this module).","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"0abb1866925c35f3452b9f994fc5a8ddbc78423d","unresolved":false,"context_lines":[{"line_number":1229,"context_line":"        agents \u003d self._get_num_of_agents_scheduled_for_router(router)"},{"line_number":1230,"context_line":"        self.assertFalse(agent in agents)"},{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"    def test_check_agent_ha_router_scheduling_not_max(self):"},{"line_number":1233,"context_line":"        self._check_agent_ha_router_scheduling(max_l3_agents\u003d3,"},{"line_number":1234,"context_line":"                                               number_of_agents\u003d2,"},{"line_number":1235,"context_line":"                                               expected\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_f94cc3cb","line":1232,"in_reply_to":"3a961159_8cd70e4f","updated":"2015-01-13 05:35:27.000000000","message":"I\u0027ll look into it - thanks","commit_id":"284214393cb74528c09e3c40bc4470b346abb914"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"d2e49155cb490fe320c198cf2fde964afe8c474a","unresolved":false,"context_lines":[{"line_number":1229,"context_line":"        self.assertTrue(schedule_valid)"},{"line_number":1230,"context_line":""},{"line_number":1231,"context_line":"    def test_manual_remove_ha_router_from_agent(self):"},{"line_number":1232,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1233,"context_line":"        self.plugin.schedule_router(self.adminContext, router[\u0027id\u0027])"},{"line_number":1234,"context_line":"        agents \u003d self._get_num_of_agents_scheduled_for_router(router)"},{"line_number":1235,"context_line":"        self.assertEqual(2, len(agents))"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_81d2a8cf","line":1232,"updated":"2015-01-19 13:46:40.000000000","message":"L1232-L1235 are code duplication of L1221-L1224... Can we merge them together to a _setup_ha_router() function (which will probably return a (router, agents) tuple), or is it not worth it at all?","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"53aa6e9622a31319ca3133ba17aa85577affb461","unresolved":false,"context_lines":[{"line_number":1229,"context_line":"        self.assertTrue(schedule_valid)"},{"line_number":1230,"context_line":""},{"line_number":1231,"context_line":"    def test_manual_remove_ha_router_from_agent(self):"},{"line_number":1232,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1233,"context_line":"        self.plugin.schedule_router(self.adminContext, router[\u0027id\u0027])"},{"line_number":1234,"context_line":"        agents \u003d self._get_num_of_agents_scheduled_for_router(router)"},{"line_number":1235,"context_line":"        self.assertEqual(2, len(agents))"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_caff5265","line":1232,"in_reply_to":"3a961159_81d2a8cf","updated":"2015-01-20 07:02:49.000000000","message":"Actually there are 3 duplications of this (1210-1213).\nI\u0027ll merge it down into a method.\n\nalso, i\u0027m inclined to leave the assertTrue(...) out of that method - the responsibility for assertions should be in test logic.","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"d2e49155cb490fe320c198cf2fde964afe8c474a","unresolved":false,"context_lines":[{"line_number":1263,"context_line":"            number_of_agents)"},{"line_number":1264,"context_line":"        self.assertEqual(expected, valid)"},{"line_number":1265,"context_line":""},{"line_number":1266,"context_line":"    def _get_num_of_agents_scheduled_for_router(self, router):"},{"line_number":1267,"context_line":"        agents \u003d self.plugin.get_l3_agents_hosting_routers("},{"line_number":1268,"context_line":"            self.adminContext, [router[\u0027id\u0027]],"},{"line_number":1269,"context_line":"            admin_state_up\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_e1f7ec58","line":1266,"updated":"2015-01-19 13:46:40.000000000","message":"nit: function name hints that it returns an int, but it returns a list of... rename to _get_agents_scheduled_for_router?","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"53aa6e9622a31319ca3133ba17aa85577affb461","unresolved":false,"context_lines":[{"line_number":1263,"context_line":"            number_of_agents)"},{"line_number":1264,"context_line":"        self.assertEqual(expected, valid)"},{"line_number":1265,"context_line":""},{"line_number":1266,"context_line":"    def _get_num_of_agents_scheduled_for_router(self, router):"},{"line_number":1267,"context_line":"        agents \u003d self.plugin.get_l3_agents_hosting_routers("},{"line_number":1268,"context_line":"            self.adminContext, [router[\u0027id\u0027]],"},{"line_number":1269,"context_line":"            admin_state_up\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_aa7e8619","line":1266,"in_reply_to":"3a961159_e1f7ec58","updated":"2015-01-20 07:02:49.000000000","message":"You\u0027re right, this is because it used to return their number, will update.","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"d2e49155cb490fe320c198cf2fde964afe8c474a","unresolved":false,"context_lines":[{"line_number":1270,"context_line":"        return agents"},{"line_number":1271,"context_line":""},{"line_number":1272,"context_line":"    def _register_additional_l3_agent(self):"},{"line_number":1273,"context_line":"        self.agent3 \u003d self._register_l3_agent(\u0027host_3\u0027, \u0027ha\u0027,"},{"line_number":1274,"context_line":"                                              self.plugin)"},{"line_number":1275,"context_line":""},{"line_number":1276,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_01f5d850","line":1273,"updated":"2015-01-19 13:46:40.000000000","message":"Why is this specifically self.agent3? Why not 2 or 4? I think the agent should be returned to the caller who is should be responsible for the naming scheme.","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"53aa6e9622a31319ca3133ba17aa85577affb461","unresolved":false,"context_lines":[{"line_number":1270,"context_line":"        return agents"},{"line_number":1271,"context_line":""},{"line_number":1272,"context_line":"    def _register_additional_l3_agent(self):"},{"line_number":1273,"context_line":"        self.agent3 \u003d self._register_l3_agent(\u0027host_3\u0027, \u0027ha\u0027,"},{"line_number":1274,"context_line":"                                              self.plugin)"},{"line_number":1275,"context_line":""},{"line_number":1276,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_8a61ca3a","line":1273,"in_reply_to":"3a961159_01f5d850","updated":"2015-01-20 07:02:49.000000000","message":"Done, the caller will pass the agent\u0027s info and the method will return a non-member agent object.","commit_id":"e759e60a2a87b818c086ff52f1aca31cbb24aed2"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"aad6ebb3bb7883b7632a7dd41b7370a3e6a8da59","unresolved":false,"context_lines":[{"line_number":221,"context_line":"        with contextlib.nested("},{"line_number":222,"context_line":"            mock.patch.object(self.scheduler, \u0027router_has_binding\u0027,"},{"line_number":223,"context_line":"                              return_value\u003dhas_binding),"},{"line_number":224,"context_line":"            mock.patch(\u0027neutron.scheduler.l3_agent_scheduler.\u0027"},{"line_number":225,"context_line":"                       \u0027L3Scheduler.prepare_router_ha_port\u0027),"},{"line_number":226,"context_line":"            mock.patch.object(self.scheduler, \u0027bind_router\u0027)) as ("},{"line_number":227,"context_line":"                mock_has_binding, mock_prepare, mock_bind_router):"}],"source_content_type":"text/x-python","patch_set":16,"id":"3a961159_6b700fa5","line":224,"updated":"2015-01-20 16:09:35.000000000","message":"Implementing my suggestion to keep create_ha_router_binding will avoid this unnecessary test change.","commit_id":"e2fed9b3452664fa70c0f6517b441cd2d2eba05e"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"406087e84449ee7860667d536e19d871851f32ba","unresolved":false,"context_lines":[{"line_number":221,"context_line":"        with contextlib.nested("},{"line_number":222,"context_line":"            mock.patch.object(self.scheduler, \u0027router_has_binding\u0027,"},{"line_number":223,"context_line":"                              return_value\u003dhas_binding),"},{"line_number":224,"context_line":"            mock.patch(\u0027neutron.scheduler.l3_agent_scheduler.\u0027"},{"line_number":225,"context_line":"                       \u0027L3Scheduler.prepare_router_ha_port\u0027),"},{"line_number":226,"context_line":"            mock.patch.object(self.scheduler, \u0027bind_router\u0027)) as ("},{"line_number":227,"context_line":"                mock_has_binding, mock_prepare, mock_bind_router):"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_ad24f4c6","line":224,"in_reply_to":"3a961159_6b700fa5","updated":"2015-01-21 05:16:36.000000000","message":"Done","commit_id":"e2fed9b3452664fa70c0f6517b441cd2d2eba05e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"aad6ebb3bb7883b7632a7dd41b7370a3e6a8da59","unresolved":false,"context_lines":[{"line_number":1217,"context_line":"        return router, agents"},{"line_number":1218,"context_line":""},{"line_number":1219,"context_line":"    def test_reschedule_ha_routers_from_down_agents(self):"},{"line_number":1220,"context_line":"        _, agents \u003d self._setup_ha_router()"},{"line_number":1221,"context_line":"        self.assertEqual(2, len(agents))"},{"line_number":1222,"context_line":"        self._set_l3_agent_dead(self.agent_id1)"},{"line_number":1223,"context_line":"        with mock.patch.object(self.plugin, \u0027reschedule_router\u0027) as reschedule:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3a961159_d6ea86d7","line":1220,"updated":"2015-01-20 16:09:35.000000000","message":"Avoid using \u0027_\u0027 as a throw-away variable.  It\u0027s the default alias for gettext and is also a shortcut to \u0027last statement value\u0027 in the python repl (this includes pdb).  Another way of achieving the same result would be: \n\nagents \u003d self._setup_ha_router()[1]","commit_id":"e2fed9b3452664fa70c0f6517b441cd2d2eba05e"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"406087e84449ee7860667d536e19d871851f32ba","unresolved":false,"context_lines":[{"line_number":1217,"context_line":"        return router, agents"},{"line_number":1218,"context_line":""},{"line_number":1219,"context_line":"    def test_reschedule_ha_routers_from_down_agents(self):"},{"line_number":1220,"context_line":"        _, agents \u003d self._setup_ha_router()"},{"line_number":1221,"context_line":"        self.assertEqual(2, len(agents))"},{"line_number":1222,"context_line":"        self._set_l3_agent_dead(self.agent_id1)"},{"line_number":1223,"context_line":"        with mock.patch.object(self.plugin, \u0027reschedule_router\u0027) as reschedule:"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_ed2efca4","line":1220,"in_reply_to":"3a961159_d6ea86d7","updated":"2015-01-21 05:16:36.000000000","message":"Ok, didn\u0027t know that. thanks !","commit_id":"e2fed9b3452664fa70c0f6517b441cd2d2eba05e"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fc1fb21cf3a94158a6e30e268268884d22fe64ff","unresolved":false,"context_lines":[{"line_number":1227,"context_line":"    def test_manual_schedule_ha_router_on_agent(self):"},{"line_number":1228,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1229,"context_line":"        router, agents \u003d self._setup_ha_router()"},{"line_number":1230,"context_line":"        self.assertEqual(2, len(agents))"},{"line_number":1231,"context_line":"        agent \u003d self._register_additional_l3_agent(\u0027host_3\u0027)"},{"line_number":1232,"context_line":"        # Check scheduling is possible on newly registered agent"},{"line_number":1233,"context_line":"        schedule_valid \u003d self.plugin.check_agent_router_scheduling_needed("}],"source_content_type":"text/x-python","patch_set":19,"id":"1a930d6b_894abe81","line":1230,"updated":"2015-01-21 13:28:50.000000000","message":"I don\u0027t see how this helper encapsulates or simplifies anything.\n\nagent \u003d self._register_l3_agent(name\u003d\u0027host_3\u0027, mode\u003d\u0027ha\u0027, self.plugin)\n\nWould be just as readable. There\u0027s also only one usage of that helper.","commit_id":"18e82f8070fa8420bc8a7c9f746cd85ad1124627"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"6e4a3493e8a1e52f29e8935512833cab6dacefa4","unresolved":false,"context_lines":[{"line_number":1227,"context_line":"    def test_manual_schedule_ha_router_on_agent(self):"},{"line_number":1228,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1229,"context_line":"        router, agents \u003d self._setup_ha_router()"},{"line_number":1230,"context_line":"        self.assertEqual(2, len(agents))"},{"line_number":1231,"context_line":"        agent \u003d self._register_additional_l3_agent(\u0027host_3\u0027)"},{"line_number":1232,"context_line":"        # Check scheduling is possible on newly registered agent"},{"line_number":1233,"context_line":"        schedule_valid \u003d self.plugin.check_agent_router_scheduling_needed("}],"source_content_type":"text/x-python","patch_set":19,"id":"1a930d6b_5c73324d","line":1230,"in_reply_to":"1a930d6b_894abe81","updated":"2015-01-21 13:52:30.000000000","message":"I guess you\u0027re right - I\u0027ll use it directly.","commit_id":"18e82f8070fa8420bc8a7c9f746cd85ad1124627"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"166da611b059e9cf53aea82b6e12cfbd3d05c4bc","unresolved":false,"context_lines":[{"line_number":317,"context_line":"    def _test_add_router_to_l3_agent(self,"},{"line_number":318,"context_line":"                                     distributed\u003dFalse,"},{"line_number":319,"context_line":"                                     already_scheduled\u003dFalse,"},{"line_number":320,"context_line":"                                     external_gw\u003dNone,"},{"line_number":321,"context_line":"                                     ha\u003dFalse):"},{"line_number":322,"context_line":"        agent_id \u003d self.agent_id1"},{"line_number":323,"context_line":"        agent \u003d self.agent1"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_84632edb","line":320,"updated":"2015-02-03 16:46:38.000000000","message":"I don\u0027t think we need these changes if we add coverage  in dedicated tests.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"558f55f81105cf7335dbea2b63e428a578ea76c2","unresolved":false,"context_lines":[{"line_number":317,"context_line":"    def _test_add_router_to_l3_agent(self,"},{"line_number":318,"context_line":"                                     distributed\u003dFalse,"},{"line_number":319,"context_line":"                                     already_scheduled\u003dFalse,"},{"line_number":320,"context_line":"                                     external_gw\u003dNone,"},{"line_number":321,"context_line":"                                     ha\u003dFalse):"},{"line_number":322,"context_line":"        agent_id \u003d self.agent_id1"},{"line_number":323,"context_line":"        agent \u003d self.agent1"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba7be1f8_308cb07f","line":320,"in_reply_to":"da86d52c_5c7e61b0","updated":"2015-02-22 11:47:13.000000000","message":"As we spoke, i reverted this function and added a dedicated test for HA router scheduling using \u0027add_router_to_l3_agent\u0027 function.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"d0b87dae7003ea18fe2b4159dcd05b0591015b57","unresolved":false,"context_lines":[{"line_number":317,"context_line":"    def _test_add_router_to_l3_agent(self,"},{"line_number":318,"context_line":"                                     distributed\u003dFalse,"},{"line_number":319,"context_line":"                                     already_scheduled\u003dFalse,"},{"line_number":320,"context_line":"                                     external_gw\u003dNone,"},{"line_number":321,"context_line":"                                     ha\u003dFalse):"},{"line_number":322,"context_line":"        agent_id \u003d self.agent_id1"},{"line_number":323,"context_line":"        agent \u003d self.agent1"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_eca8368f","line":320,"in_reply_to":"da86d52c_84632edb","updated":"2015-02-04 07:54:09.000000000","message":"I don\u0027t fully understand your suggestion, please specify a bit.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"0e9f7407fe6b472e3561bd34a31278355ba4434a","unresolved":false,"context_lines":[{"line_number":317,"context_line":"    def _test_add_router_to_l3_agent(self,"},{"line_number":318,"context_line":"                                     distributed\u003dFalse,"},{"line_number":319,"context_line":"                                     already_scheduled\u003dFalse,"},{"line_number":320,"context_line":"                                     external_gw\u003dNone,"},{"line_number":321,"context_line":"                                     ha\u003dFalse):"},{"line_number":322,"context_line":"        agent_id \u003d self.agent_id1"},{"line_number":323,"context_line":"        agent \u003d self.agent1"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_5c7e61b0","line":320,"in_reply_to":"da86d52c_eca8368f","updated":"2015-02-10 20:56:39.000000000","message":"This is a mock heavy test. Please see my comment in line 1229.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"166da611b059e9cf53aea82b6e12cfbd3d05c4bc","unresolved":false,"context_lines":[{"line_number":1212,"context_line":""},{"line_number":1213,"context_line":""},{"line_number":1214,"context_line":"class L3AgentSchedulerDbMixinTestCase(L3HATestCaseMixin):"},{"line_number":1215,"context_line":""},{"line_number":1216,"context_line":"    def _setup_ha_router(self):"},{"line_number":1217,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1218,"context_line":"        self.plugin.schedule_router(self.adminContext, router[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_a8f20198","line":1215,"updated":"2015-02-03 16:46:38.000000000","message":"Maybe create_and_schedule?","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"d0b87dae7003ea18fe2b4159dcd05b0591015b57","unresolved":false,"context_lines":[{"line_number":1212,"context_line":""},{"line_number":1213,"context_line":""},{"line_number":1214,"context_line":"class L3AgentSchedulerDbMixinTestCase(L3HATestCaseMixin):"},{"line_number":1215,"context_line":""},{"line_number":1216,"context_line":"    def _setup_ha_router(self):"},{"line_number":1217,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1218,"context_line":"        self.plugin.schedule_router(self.adminContext, router[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_4c222253","line":1215,"in_reply_to":"da86d52c_a8f20198","updated":"2015-02-04 07:54:09.000000000","message":"It was john\u0027s suggestion - see PS 14","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"166da611b059e9cf53aea82b6e12cfbd3d05c4bc","unresolved":false,"context_lines":[{"line_number":1216,"context_line":"    def _setup_ha_router(self):"},{"line_number":1217,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1218,"context_line":"        self.plugin.schedule_router(self.adminContext, router[\u0027id\u0027])"},{"line_number":1219,"context_line":"        agents \u003d self._get_agents_scheduled_for_router(router)"},{"line_number":1220,"context_line":"        return router, agents"},{"line_number":1221,"context_line":""},{"line_number":1222,"context_line":"    def test_reschedule_ha_routers_from_down_agents(self):"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_21ec34c7","line":1219,"updated":"2015-02-03 16:46:38.000000000","message":"I think it\u0027s a cleaner interface to return only one value (The router) and for the tests to call _get_agents_scheduled_for_router but I won\u0027t stress this.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"d0b87dae7003ea18fe2b4159dcd05b0591015b57","unresolved":false,"context_lines":[{"line_number":1216,"context_line":"    def _setup_ha_router(self):"},{"line_number":1217,"context_line":"        router \u003d self._create_ha_router()"},{"line_number":1218,"context_line":"        self.plugin.schedule_router(self.adminContext, router[\u0027id\u0027])"},{"line_number":1219,"context_line":"        agents \u003d self._get_agents_scheduled_for_router(router)"},{"line_number":1220,"context_line":"        return router, agents"},{"line_number":1221,"context_line":""},{"line_number":1222,"context_line":"    def test_reschedule_ha_routers_from_down_agents(self):"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_ac155ee6","line":1219,"in_reply_to":"da86d52c_21ec34c7","updated":"2015-02-04 07:54:09.000000000","message":"It was john\u0027s suggestion - see PS 14","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"166da611b059e9cf53aea82b6e12cfbd3d05c4bc","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        with mock.patch.object(self.plugin, \u0027reschedule_router\u0027) as reschedule:"},{"line_number":1227,"context_line":"            self.plugin.reschedule_routers_from_down_agents()"},{"line_number":1228,"context_line":"            self.assertFalse(reschedule.called)"},{"line_number":1229,"context_line":""},{"line_number":1230,"context_line":"    def test_manual_schedule_ha_router_on_agent(self):"},{"line_number":1231,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1232,"context_line":"        router, agents \u003d self._setup_ha_router()"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_81e6c0b2","line":1229,"updated":"2015-02-03 16:46:38.000000000","message":"I think we\u0027re better off with dedicated coverage for add_router_to_l3_agent, and removing L3AgentHaSchedulerTestCase. Is there a reason to keep it?","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":14024,"name":"Yoni Shafrir","email":"yshafrir@redhat.com","username":"yoni"},"change_message_id":"d0b87dae7003ea18fe2b4159dcd05b0591015b57","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        with mock.patch.object(self.plugin, \u0027reschedule_router\u0027) as reschedule:"},{"line_number":1227,"context_line":"            self.plugin.reschedule_routers_from_down_agents()"},{"line_number":1228,"context_line":"            self.assertFalse(reschedule.called)"},{"line_number":1229,"context_line":""},{"line_number":1230,"context_line":"    def test_manual_schedule_ha_router_on_agent(self):"},{"line_number":1231,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1232,"context_line":"        router, agents \u003d self._setup_ha_router()"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_aced5eb9","line":1229,"in_reply_to":"da86d52c_81e6c0b2","updated":"2015-02-04 07:54:09.000000000","message":"I\u0027m not entirely on your wave length.\n\n- What do you mean by dedicated coverage, testing the \u0027add_router_to_l3_agent\u0027 method explicitly ? there is an existing test in \u0027L3AgentHaSchedulerTestCase\u0027 you want to add more ?\n\n- If it\u0027s problematic it\u0027s all alone then i\u0027ll move it to another existing test class.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"0e9f7407fe6b472e3561bd34a31278355ba4434a","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        with mock.patch.object(self.plugin, \u0027reschedule_router\u0027) as reschedule:"},{"line_number":1227,"context_line":"            self.plugin.reschedule_routers_from_down_agents()"},{"line_number":1228,"context_line":"            self.assertFalse(reschedule.called)"},{"line_number":1229,"context_line":""},{"line_number":1230,"context_line":"    def test_manual_schedule_ha_router_on_agent(self):"},{"line_number":1231,"context_line":"        cfg.CONF.set_override(\u0027max_l3_agents_per_router\u0027, 3)"},{"line_number":1232,"context_line":"        router, agents \u003d self._setup_ha_router()"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_3cae0d2f","line":1229,"in_reply_to":"da86d52c_aced5eb9","updated":"2015-02-10 20:56:39.000000000","message":"I mean removing the test case, as it\u0027s a yucky yucky mock-based test, whereas testing add_router_to_l3_agent should be done without any mocks, in the style of the tests below.","commit_id":"28ad238f6713c9b11b7fa97a0a3f9734e61a7576"}]}
