)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add a new scheduler for the l3 HA"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch is a part of the blueprint l3-high-availability"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"This patch updates all schedulers in order to support"},{"line_number":12,"context_line":"the scheduling of HA Routers."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"1abeadc6_afd2c459","line":9,"updated":"2014-08-20 20:27:14.000000000","message":"nit:  Could this go someone in the footer with a \u0027partially implements l3-high-availability.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add a new scheduler for the l3 HA"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch is a part of the blueprint l3-high-availability"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"This patch updates all schedulers in order to support"},{"line_number":12,"context_line":"the scheduling of HA Routers."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"1abeadc6_46b517cf","line":9,"in_reply_to":"1abeadc6_afd2c459","updated":"2014-08-25 16:53:02.000000000","message":"Done","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch is a part of the blueprint l3-high-availability"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"This patch updates all schedulers in order to support"},{"line_number":12,"context_line":"the scheduling of HA Routers."},{"line_number":13,"context_line":"It also refactors and add test units in order to"},{"line_number":14,"context_line":"test the auto scheduling part."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"1abeadc6_6fbc2c07","line":11,"updated":"2014-08-20 20:27:14.000000000","message":"pico-nit:  These four lines could be formatted more cleanly as a paragraph without line breaks at sentences.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch is a part of the blueprint l3-high-availability"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"This patch updates all schedulers in order to support"},{"line_number":12,"context_line":"the scheduling of HA Routers."},{"line_number":13,"context_line":"It also refactors and add test units in order to"},{"line_number":14,"context_line":"test the auto scheduling part."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"1abeadc6_66ba13c2","line":11,"in_reply_to":"1abeadc6_6fbc2c07","updated":"2014-08-25 16:53:02.000000000","message":"Done","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"}],"etc/neutron.conf":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9e9802b662d3a629194094dc5dd3df554c40c568","unresolved":false,"context_lines":[{"line_number":233,"context_line":"# network_scheduler_driver \u003d neutron.scheduler.dhcp_agent_scheduler.ChanceScheduler"},{"line_number":234,"context_line":"# Driver to use for scheduling router to a default L3 agent"},{"line_number":235,"context_line":"# neutron.scheduler.l3_agent_scheduler.ChanceScheduler, to use L3 agent with HA"},{"line_number":236,"context_line":"# mode the following scheduler has to be used : neutron.scheduler.l3_agent_scheduler.HARouterScheduler"},{"line_number":237,"context_line":"# router_scheduler_driver \u003d neutron.scheduler.l3_agent_scheduler.ChanceScheduler"},{"line_number":238,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"},{"line_number":239,"context_line":"# loadbalancer_pool_scheduler_driver \u003d neutron.services.loadbalancer.agent_scheduler.ChanceScheduler"}],"source_content_type":"text/plain","patch_set":18,"id":"AAAAWH%2F%2F3Ug%3D","line":236,"updated":"2014-03-13 10:14:56.000000000","message":"nit: I\u0027m seing the \"er\" cutted out at the end of the line, could we split\nthis line in two comments?","commit_id":"8c6f498c0b5a4e23ed58225c9a0900d7f3d3f170"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0e82aae1264e500995364fc1aaeaa74ddf7f69bf","unresolved":false,"context_lines":[{"line_number":233,"context_line":"# network_scheduler_driver \u003d neutron.scheduler.dhcp_agent_scheduler.ChanceScheduler"},{"line_number":234,"context_line":"# Driver to use for scheduling router to a default L3 agent"},{"line_number":235,"context_line":"# neutron.scheduler.l3_agent_scheduler.ChanceScheduler, to use L3 agent with HA"},{"line_number":236,"context_line":"# mode the following scheduler has to be used : neutron.scheduler.l3_agent_scheduler.HARouterScheduler"},{"line_number":237,"context_line":"# router_scheduler_driver \u003d neutron.scheduler.l3_agent_scheduler.ChanceScheduler"},{"line_number":238,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"},{"line_number":239,"context_line":"# loadbalancer_pool_scheduler_driver \u003d neutron.services.loadbalancer.agent_scheduler.ChanceScheduler"}],"source_content_type":"text/plain","patch_set":18,"id":"AAAAWH%2F%2Fisg%3D","line":236,"in_reply_to":"AAAAWH%2F%2F2RQ%3D","updated":"2014-03-17 07:39:30.000000000","message":"Yes, it\u0027s excess of lines \u003e79, we don\u0027t have rule checkers for that at config\n\nfiles but I believe it\u0027s good if we stick at that. (And yes, the chancescheduler\n\nline has the same problem, but doesn\u0027t belong to this patch.).\n\nI\u0027m removing the -1 as it\u0027s a nit, sorry Sylvain","commit_id":"8c6f498c0b5a4e23ed58225c9a0900d7f3d3f170"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"8071f69af3689ddb5cc8007ec6185ebfe9046b82","unresolved":false,"context_lines":[{"line_number":233,"context_line":"# network_scheduler_driver \u003d neutron.scheduler.dhcp_agent_scheduler.ChanceScheduler"},{"line_number":234,"context_line":"# Driver to use for scheduling router to a default L3 agent"},{"line_number":235,"context_line":"# neutron.scheduler.l3_agent_scheduler.ChanceScheduler, to use L3 agent with HA"},{"line_number":236,"context_line":"# mode the following scheduler has to be used : neutron.scheduler.l3_agent_scheduler.HARouterScheduler"},{"line_number":237,"context_line":"# router_scheduler_driver \u003d neutron.scheduler.l3_agent_scheduler.ChanceScheduler"},{"line_number":238,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"},{"line_number":239,"context_line":"# loadbalancer_pool_scheduler_driver \u003d neutron.services.loadbalancer.agent_scheduler.ChanceScheduler"}],"source_content_type":"text/plain","patch_set":18,"id":"AAAAWH%2F%2F2RQ%3D","line":236,"in_reply_to":"AAAAWH%2F%2F3Ug%3D","updated":"2014-03-13 11:57:37.000000000","message":"This is just the gerrit display, you can see that there are some other lines like this one in this file.","commit_id":"8c6f498c0b5a4e23ed58225c9a0900d7f3d3f170"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"fc5f569e94a114e5582b0f5bcf87a840f7ab6449","unresolved":false,"context_lines":[{"line_number":233,"context_line":"# network_scheduler_driver \u003d neutron.scheduler.dhcp_agent_scheduler.ChanceScheduler"},{"line_number":234,"context_line":"# Driver to use for scheduling router to a default L3 agent"},{"line_number":235,"context_line":"# neutron.scheduler.l3_agent_scheduler.ChanceScheduler, to use L3 agent with HA"},{"line_number":236,"context_line":"# mode the following scheduler has to be used : neutron.scheduler.l3_agent_scheduler.HARouterScheduler"},{"line_number":237,"context_line":"# router_scheduler_driver \u003d neutron.scheduler.l3_agent_scheduler.ChanceScheduler"},{"line_number":238,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"},{"line_number":239,"context_line":"# loadbalancer_pool_scheduler_driver \u003d neutron.services.loadbalancer.agent_scheduler.ChanceScheduler"}],"source_content_type":"text/plain","patch_set":19,"id":"7adec928_0202df3d","line":236,"updated":"2014-05-22 19:55:10.000000000","message":"IMO, LeastRouterScheduler is a special case of HARouterScheduler, they can merged and decide the  mode using \"l3_ha\" option\n  if l3_ha:\n    min_agents, max_agents \u003d CONF....\n  else:\n    min_agents \u003d max_agents \u003d 1\n\nIt will simplify configuration and reduce code/tests","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"5129da8e83b92b602fe12f5303a2417784d07c90","unresolved":false,"context_lines":[{"line_number":233,"context_line":"# network_scheduler_driver \u003d neutron.scheduler.dhcp_agent_scheduler.ChanceScheduler"},{"line_number":234,"context_line":"# Driver to use for scheduling router to a default L3 agent"},{"line_number":235,"context_line":"# neutron.scheduler.l3_agent_scheduler.ChanceScheduler, to use L3 agent with HA"},{"line_number":236,"context_line":"# mode the following scheduler has to be used : neutron.scheduler.l3_agent_scheduler.HARouterScheduler"},{"line_number":237,"context_line":"# router_scheduler_driver \u003d neutron.scheduler.l3_agent_scheduler.ChanceScheduler"},{"line_number":238,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"},{"line_number":239,"context_line":"# loadbalancer_pool_scheduler_driver \u003d neutron.services.loadbalancer.agent_scheduler.ChanceScheduler"}],"source_content_type":"text/plain","patch_set":19,"id":"AAAAXH%2F%2FdBA%3D","line":236,"updated":"2014-04-21 16:49:14.000000000","message":"This comment isn\u0027t limited to this patch, so It is OK we don\u0027t work in this patch. I\u0027m OK for this way for now.\n\nI think we should stop use this kind of configuration, because it exposes too much implementation details.\n\nIMO, something like this is more intuitive for users\nha_mode\u003dtrue","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ff8cc1dd6a9a759191bc7deaf8c7999bdabcf033","unresolved":false,"context_lines":[{"line_number":233,"context_line":"# network_scheduler_driver \u003d neutron.scheduler.dhcp_agent_scheduler.ChanceScheduler"},{"line_number":234,"context_line":"# Driver to use for scheduling router to a default L3 agent"},{"line_number":235,"context_line":"# neutron.scheduler.l3_agent_scheduler.ChanceScheduler, to use L3 agent with HA"},{"line_number":236,"context_line":"# mode the following scheduler has to be used : neutron.scheduler.l3_agent_scheduler.HARouterScheduler"},{"line_number":237,"context_line":"# router_scheduler_driver \u003d neutron.scheduler.l3_agent_scheduler.ChanceScheduler"},{"line_number":238,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"},{"line_number":239,"context_line":"# loadbalancer_pool_scheduler_driver \u003d neutron.services.loadbalancer.agent_scheduler.ChanceScheduler"}],"source_content_type":"text/plain","patch_set":19,"id":"baada198_3617caef","line":236,"in_reply_to":"7adec928_0202df3d","updated":"2014-07-13 15:04:05.000000000","message":"Personally I think this is ok for now and we\u0027ll revisit this later when we\u0027ll integrate with DVR. At that point you\u0027ll have the DVR scheduler, the VRRP scheduler, and if you want to support both \u0027ha\u0027 and \u0027distributed\u0027 routers you\u0027ll need a new, third scheduler. I think that at that point we\u0027ll replace this option altogether.","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"}],"neutron/db/l3_agentschedulers_db.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bb55d61f47514fbfcf2209dd2dc33962760ca52d","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import datetime"},{"line_number":17,"context_line":"import random"},{"line_number":18,"context_line":"import time"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_a5c5518f","line":15,"updated":"2014-09-03 21:44:17.000000000","message":"nit:  Try not to make changes outside the scope of the patch.  :)","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bb55d61f47514fbfcf2209dd2dc33962760ca52d","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            outerjoin(l3_attrs_db.RouterExtraAttributes,"},{"line_number":122,"context_line":"                      l3_attrs_db.RouterExtraAttributes.router_id \u003d\u003d"},{"line_number":123,"context_line":"                      RouterL3AgentBinding.router_id)."},{"line_number":124,"context_line":"            filter(sa.or_(l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.false(),"},{"line_number":125,"context_line":"                          l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        for binding in down_bindings:"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_2562413e","line":124,"updated":"2014-09-03 21:44:17.000000000","message":"nit:  Would !\u003d sql.true() cover it?\n\nOther queries in this patch filter on \u003d\u003d sql.true() to find ha routers.  It seems natural to simply invert it to exclude them.","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"6775ce422906ec320eceeec64255560df96dd4ca","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            outerjoin(l3_attrs_db.RouterExtraAttributes,"},{"line_number":122,"context_line":"                      l3_attrs_db.RouterExtraAttributes.router_id \u003d\u003d"},{"line_number":123,"context_line":"                      RouterL3AgentBinding.router_id)."},{"line_number":124,"context_line":"            filter(sa.or_(l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.false(),"},{"line_number":125,"context_line":"                          l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        for binding in down_bindings:"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_02c76813","line":124,"in_reply_to":"fa98f980_2562413e","updated":"2014-09-08 23:46:46.000000000","message":"Done","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3c5018d842b2feed290c4857d9cc3e78bd31d0a5","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                      l3_attrs_db.RouterExtraAttributes.router_id \u003d\u003d"},{"line_number":122,"context_line":"                      RouterL3AgentBinding.router_id)."},{"line_number":123,"context_line":"            filter(sa.or_(l3_attrs_db.RouterExtraAttributes.ha !\u003d sql.true(),"},{"line_number":124,"context_line":"                          l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        for binding in down_bindings:"},{"line_number":127,"context_line":"            LOG.warn(_LW(\"Rescheduling router %(router)s from agent %(agent)s \""}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_0df22d9a","line":124,"updated":"2014-09-09 12:05:29.000000000","message":"sql.null() !\u003d sql.true() so why need extra checking: \u0027\u003d\u003d sql.null()\u0027?","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a01c8eaf197bed1d467add4cdb4bb70f21aab7f2","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                      l3_attrs_db.RouterExtraAttributes.router_id \u003d\u003d"},{"line_number":122,"context_line":"                      RouterL3AgentBinding.router_id)."},{"line_number":123,"context_line":"            filter(sa.or_(l3_attrs_db.RouterExtraAttributes.ha !\u003d sql.true(),"},{"line_number":124,"context_line":"                          l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        for binding in down_bindings:"},{"line_number":127,"context_line":"            LOG.warn(_LW(\"Rescheduling router %(router)s from agent %(agent)s \""}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_bf0ce33c","line":124,"in_reply_to":"fa98f980_0df22d9a","updated":"2014-09-09 17:50:39.000000000","message":"If you remove the null it fails a unit test:\nneutron.tests.unit.openvswitch.test_agent_scheduler.OvsAgentSchedulerTestCaseXML.test_router_reschedule_from_dead_agent.\n\nWe\u0027re doing an outerjoin here so you can get some routers with no extra attributes record. If you only filter for non-true then you filter out all routers that don\u0027t have an extra attributes record, this includes legacy routers.\n\nI\u0027ll change !\u003d true back to false, makes more sense.","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"5e9f6f67310bd6a878ca5a7f09c81fa8e1e15535","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                      l3_attrs_db.RouterExtraAttributes.router_id \u003d\u003d"},{"line_number":122,"context_line":"                      RouterL3AgentBinding.router_id)."},{"line_number":123,"context_line":"            filter(sa.or_(l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.false(),"},{"line_number":124,"context_line":"                          l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        for binding in down_bindings:"},{"line_number":127,"context_line":"            LOG.warn(_LW(\"Rescheduling router %(router)s from agent %(agent)s \""}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_2c36f352","line":124,"updated":"2014-09-10 08:25:50.000000000","message":"I think checking sql.null() is not needed. In the depending patch, router_extra_attributes.ha is set to nullable\u003dFalse and the server_default is set to False. It means RouterExtraAttributes.ha is never Null.","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5087d914a148ea1b9a94800b2d6e1a50770d9816","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                      l3_attrs_db.RouterExtraAttributes.router_id \u003d\u003d"},{"line_number":122,"context_line":"                      RouterL3AgentBinding.router_id)."},{"line_number":123,"context_line":"            filter(sa.or_(l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.false(),"},{"line_number":124,"context_line":"                          l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        for binding in down_bindings:"},{"line_number":127,"context_line":"            LOG.warn(_LW(\"Rescheduling router %(router)s from agent %(agent)s \""}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_605e3a78","line":124,"in_reply_to":"fa98f980_2c36f352","updated":"2014-09-10 13:23:04.000000000","message":"Removing the null fails:\n\nneutron.tests.unit.openvswitch.test_agent_scheduler.OvsAgentSchedulerTestCase.test_router_reschedule_from_dead_agent\n\nThis is because the OVS monolithic plugin inherits from l3_gwmode_db.L3_NAT_db_mixin directly, so the DVR mixin isn\u0027t on its \u0027path\u0027. When a router is created it doesn\u0027t have the extra attributes row created for it. ML2 uses the l3 service plugin, but I think we do want to support other plugins that don\u0027t use it and inherit directly. This is why I performed an outer join and not an inner join - Doing an inner join would return an empty set because none of the routers have a row in the extra attributes table. So I did an outer join and this is (In plugins that don\u0027t use the L3 service plugin) why you will have have null records.","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"05e89d6c3c9194bb21be2ca2374222c65002f299","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            outerjoin(l3_attrs_db.RouterExtraAttributes,"},{"line_number":121,"context_line":"                      l3_attrs_db.RouterExtraAttributes.router_id \u003d\u003d"},{"line_number":122,"context_line":"                      RouterL3AgentBinding.router_id)."},{"line_number":123,"context_line":"            filter(sa.or_(l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.false(),"},{"line_number":124,"context_line":"                          l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        for binding in down_bindings:"}],"source_content_type":"text/x-python","patch_set":51,"id":"fa98f980_ef0f6486","line":123,"updated":"2014-09-11 03:34:17.000000000","message":"You did say this would change from PS47 but it was a nit.  I would prefer it the way I suggested though.","commit_id":"1a2e535162845686422b2cb362e770318a94f7f4"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fe426d19cae3f15224428de5387dbd8c4b8c6473","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            outerjoin(l3_attrs_db.RouterExtraAttributes,"},{"line_number":121,"context_line":"                      l3_attrs_db.RouterExtraAttributes.router_id \u003d\u003d"},{"line_number":122,"context_line":"                      RouterL3AgentBinding.router_id)."},{"line_number":123,"context_line":"            filter(sa.or_(l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.false(),"},{"line_number":124,"context_line":"                          l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.null())))"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        for binding in down_bindings:"}],"source_content_type":"text/x-python","patch_set":51,"id":"fa98f980_ab87f0b3","line":123,"in_reply_to":"fa98f980_ef0f6486","updated":"2014-09-11 19:11:55.000000000","message":"Changing from or(false, null) to \u0027not true\u0027 fails:\n\nneutron.tests.unit.openvswitch.test_agent_scheduler.OvsAgentSchedulerTestCase.test_router_reschedule_from_dead_agent\n\nIt looks like a real failure, but I don\u0027t understand why this is.","commit_id":"1a2e535162845686422b2cb362e770318a94f7f4"}],"neutron/db/l3_hascheduler_db.py":[{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"deb22269e71bdb01eed67b29bee7aba145083009","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        l3_attrs_db.RouterExtraAttributes.ha"},{"line_number":35,"context_line":"        query \u003d query.filter("},{"line_number":36,"context_line":"            l3_sch_db.RouterL3AgentBinding.l3_agent_id !\u003d agent_id,"},{"line_number":37,"context_line":"            l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.true())"},{"line_number":38,"context_line":"        return query.group_by(l3_db.Router.id)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def get_ordered_l3_agents_by_num_routers(self, context, agent_ids):"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_65d2fffe","line":37,"updated":"2014-08-13 06:45:21.000000000","message":"This filter doesn\u0027t seem to exclude non-HA routers.  Try adding \"print query.statement\" here, or try creating a non-HA router.","commit_id":"4d5f7221eca27616fda64803e03fd8eecc24c2a0"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5e8a5c00c97f5ff67e709935418cd2542b9bc974","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        l3_attrs_db.RouterExtraAttributes.ha"},{"line_number":35,"context_line":"        query \u003d query.filter("},{"line_number":36,"context_line":"            l3_sch_db.RouterL3AgentBinding.l3_agent_id !\u003d agent_id,"},{"line_number":37,"context_line":"            l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.true())"},{"line_number":38,"context_line":"        return query.group_by(l3_db.Router.id)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def get_ordered_l3_agents_by_num_routers(self, context, agent_ids):"}],"source_content_type":"text/x-python","patch_set":29,"id":"1abeadc6_a7c35289","line":37,"in_reply_to":"baada198_65d2fffe","updated":"2014-08-17 17:36:03.000000000","message":"You\u0027re right. It\u0027s also not returning the right numbers. Fix coming up with a test.","commit_id":"4d5f7221eca27616fda64803e03fd8eecc24c2a0"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (C) 2014 eNovance SAS \u003clicensing@enovance.com\u003e"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Author: Sylvain Afchain \u003csylvain.afchain@enovance.com\u003e"},{"line_number":4,"context_line":"#"},{"line_number":5,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":6,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_ef42fc66","line":3,"updated":"2014-08-20 20:27:14.000000000","message":"I think we\u0027ve stopped adding author lines in new files.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (C) 2014 eNovance SAS \u003clicensing@enovance.com\u003e"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Author: Sylvain Afchain \u003csylvain.afchain@enovance.com\u003e"},{"line_number":4,"context_line":"#"},{"line_number":5,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":6,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_c88771d6","line":3,"in_reply_to":"1abeadc6_ef42fc66","updated":"2014-08-25 16:53:02.000000000","message":"Done","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        query \u003d (context.session.query("},{"line_number":34,"context_line":"            l3_sch_db.RouterL3AgentBinding.router_id,"},{"line_number":35,"context_line":"            l3_db.Router.tenant_id,"},{"line_number":36,"context_line":"            func.count(l3_sch_db.RouterL3AgentBinding.router_id))."},{"line_number":37,"context_line":"            join(l3_attrs_db.RouterExtraAttributes,"},{"line_number":38,"context_line":"                 l3_sch_db.RouterL3AgentBinding.router_id \u003d\u003d"},{"line_number":39,"context_line":"                 l3_attrs_db.RouterExtraAttributes.router_id)."}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_828ebfce","line":36,"updated":"2014-08-20 20:27:14.000000000","message":"Shouldn\u0027t this be counting agent_id instead of router_id?  I don\u0027t think the answer is different in this case but it just looks a little surprising.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        query \u003d (context.session.query("},{"line_number":34,"context_line":"            l3_sch_db.RouterL3AgentBinding.router_id,"},{"line_number":35,"context_line":"            l3_db.Router.tenant_id,"},{"line_number":36,"context_line":"            func.count(l3_sch_db.RouterL3AgentBinding.router_id))."},{"line_number":37,"context_line":"            join(l3_attrs_db.RouterExtraAttributes,"},{"line_number":38,"context_line":"                 l3_sch_db.RouterL3AgentBinding.router_id \u003d\u003d"},{"line_number":39,"context_line":"                 l3_attrs_db.RouterExtraAttributes.router_id)."}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_0176a906","line":36,"in_reply_to":"1abeadc6_828ebfce","updated":"2014-08-25 16:53:02.000000000","message":"I see what you mean but it doesn\u0027t work properly when I change it to count agent_id (And group by it as well).","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            join(l3_attrs_db.RouterExtraAttributes,"},{"line_number":38,"context_line":"                 l3_sch_db.RouterL3AgentBinding.router_id \u003d\u003d"},{"line_number":39,"context_line":"                 l3_attrs_db.RouterExtraAttributes.router_id)."},{"line_number":40,"context_line":"            join(l3_db.Router)."},{"line_number":41,"context_line":"            filter(l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.true(),"},{"line_number":42,"context_line":"                   l3_sch_db.RouterL3AgentBinding.l3_agent_id !\u003d agent_id)."},{"line_number":43,"context_line":"            group_by(l3_sch_db.RouterL3AgentBinding.router_id))"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_c2f0b700","line":40,"updated":"2014-08-20 20:27:14.000000000","message":"What is the join condition here?  Did I miss it?  Is it implicit somehow?","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"aa5d8b8572ad13c10f6ce2682e196132475477dc","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            join(l3_attrs_db.RouterExtraAttributes,"},{"line_number":38,"context_line":"                 l3_sch_db.RouterL3AgentBinding.router_id \u003d\u003d"},{"line_number":39,"context_line":"                 l3_attrs_db.RouterExtraAttributes.router_id)."},{"line_number":40,"context_line":"            join(l3_db.Router)."},{"line_number":41,"context_line":"            filter(l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.true(),"},{"line_number":42,"context_line":"                   l3_sch_db.RouterL3AgentBinding.l3_agent_id !\u003d agent_id)."},{"line_number":43,"context_line":"            group_by(l3_sch_db.RouterL3AgentBinding.router_id))"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_e2a8538e","line":40,"in_reply_to":"1abeadc6_01f14995","updated":"2014-08-27 22:15:59.000000000","message":"thanks","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            join(l3_attrs_db.RouterExtraAttributes,"},{"line_number":38,"context_line":"                 l3_sch_db.RouterL3AgentBinding.router_id \u003d\u003d"},{"line_number":39,"context_line":"                 l3_attrs_db.RouterExtraAttributes.router_id)."},{"line_number":40,"context_line":"            join(l3_db.Router)."},{"line_number":41,"context_line":"            filter(l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.true(),"},{"line_number":42,"context_line":"                   l3_sch_db.RouterL3AgentBinding.l3_agent_id !\u003d agent_id)."},{"line_number":43,"context_line":"            group_by(l3_sch_db.RouterL3AgentBinding.router_id))"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_01f14995","line":40,"in_reply_to":"1abeadc6_c2f0b700","updated":"2014-08-25 16:53:02.000000000","message":"If you don\u0027t explicitly specify then the join is performed according to the primary keys of the tables.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                 l3_attrs_db.RouterExtraAttributes.router_id)."},{"line_number":40,"context_line":"            join(l3_db.Router)."},{"line_number":41,"context_line":"            filter(l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.true(),"},{"line_number":42,"context_line":"                   l3_sch_db.RouterL3AgentBinding.l3_agent_id !\u003d agent_id)."},{"line_number":43,"context_line":"            group_by(l3_sch_db.RouterL3AgentBinding.router_id))"},{"line_number":44,"context_line":"        return query"},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_2227abcb","line":42,"updated":"2014-08-20 20:27:14.000000000","message":"Would it make a performance difference if the filter came before the second join?","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                 l3_attrs_db.RouterExtraAttributes.router_id)."},{"line_number":40,"context_line":"            join(l3_db.Router)."},{"line_number":41,"context_line":"            filter(l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.true(),"},{"line_number":42,"context_line":"                   l3_sch_db.RouterL3AgentBinding.l3_agent_id !\u003d agent_id)."},{"line_number":43,"context_line":"            group_by(l3_sch_db.RouterL3AgentBinding.router_id))"},{"line_number":44,"context_line":"        return query"},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_e1f36d9d","line":42,"in_reply_to":"1abeadc6_2227abcb","updated":"2014-08-25 16:53:02.000000000","message":"I checked and you get the exact same SQL query if you move replace the order of the join and filter.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"aa5d8b8572ad13c10f6ce2682e196132475477dc","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                 l3_attrs_db.RouterExtraAttributes.router_id)."},{"line_number":40,"context_line":"            join(l3_db.Router)."},{"line_number":41,"context_line":"            filter(l3_attrs_db.RouterExtraAttributes.ha \u003d\u003d sql.true(),"},{"line_number":42,"context_line":"                   l3_sch_db.RouterL3AgentBinding.l3_agent_id !\u003d agent_id)."},{"line_number":43,"context_line":"            group_by(l3_sch_db.RouterL3AgentBinding.router_id))"},{"line_number":44,"context_line":"        return query"},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_82c23f51","line":42,"in_reply_to":"1abeadc6_e1f36d9d","updated":"2014-08-27 22:15:59.000000000","message":"thanks","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        state_weight_map \u003d {None: 1,"},{"line_number":63,"context_line":"                            \u0027standby\u0027: 2,"},{"line_number":64,"context_line":"                            \u0027active\u0027: 3}"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        agent_weights \u003d {}"},{"line_number":67,"context_line":"        for entry in res.all():"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_1511025d","line":64,"updated":"2014-08-20 20:27:14.000000000","message":"If a state other than None, standby, or active shows up later, this may be a problem if this map isn\u0027t updated.  Should we catch KeyError below and log a message or do you think this is nothing to worry about?  Or, is there a better, more maintainable, pattern that can be used here?","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        state_weight_map \u003d {None: 1,"},{"line_number":63,"context_line":"                            \u0027standby\u0027: 2,"},{"line_number":64,"context_line":"                            \u0027active\u0027: 3}"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        agent_weights \u003d {}"},{"line_number":67,"context_line":"        for entry in res.all():"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_a88235c6","line":64,"in_reply_to":"1abeadc6_1511025d","updated":"2014-08-25 16:53:02.000000000","message":"I added a test, removed the weight map entirely and simplified the query. The query was too complicated for my tastes for no real gain.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                            \u0027active\u0027: 3}"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        agent_weights \u003d {}"},{"line_number":67,"context_line":"        for entry in res.all():"},{"line_number":68,"context_line":"            agent, count, state \u003d entry"},{"line_number":69,"context_line":"            agent_weight \u003d agent_weights.get(agent.id)"},{"line_number":70,"context_line":"            if agent_weight:"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_45f831c3","line":67,"updated":"2014-08-20 20:27:14.000000000","message":"nit: for agent, count, state in res.all():\n\nNo need for the intermediate \"entry\".","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                            \u0027active\u0027: 3}"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        agent_weights \u003d {}"},{"line_number":67,"context_line":"        for entry in res.all():"},{"line_number":68,"context_line":"            agent, count, state \u003d entry"},{"line_number":69,"context_line":"            agent_weight \u003d agent_weights.get(agent.id)"},{"line_number":70,"context_line":"            if agent_weight:"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_884e5995","line":67,"in_reply_to":"1abeadc6_45f831c3","updated":"2014-08-25 16:53:02.000000000","message":"Done","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":68,"context_line":"            agent, count, state \u003d entry"},{"line_number":69,"context_line":"            agent_weight \u003d agent_weights.get(agent.id)"},{"line_number":70,"context_line":"            if agent_weight:"},{"line_number":71,"context_line":"                agent[1] +\u003d count * state_weight_map[state]"},{"line_number":72,"context_line":"            else:"},{"line_number":73,"context_line":"                agent_weights[agent.id] \u003d (agent,"},{"line_number":74,"context_line":"                                           count * state_weight_map[state])"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_750b162a","line":71,"updated":"2014-08-20 20:27:14.000000000","message":"Referencing agent[1] just doesn\u0027t look right here.  Remember \"agent\" came from the the query and is an Agent db object.  Should this be something like this:\n\n    if agent.id not in agent_weight:\n        agent_weights[agent.id] \u003d (agent, 0)\n\n    agent_weights[agent.id][1] +\u003d count * state_weight_map[state]","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":68,"context_line":"            agent, count, state \u003d entry"},{"line_number":69,"context_line":"            agent_weight \u003d agent_weights.get(agent.id)"},{"line_number":70,"context_line":"            if agent_weight:"},{"line_number":71,"context_line":"                agent[1] +\u003d count * state_weight_map[state]"},{"line_number":72,"context_line":"            else:"},{"line_number":73,"context_line":"                agent_weights[agent.id] \u003d (agent,"},{"line_number":74,"context_line":"                                           count * state_weight_map[state])"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_a843156b","line":71,"in_reply_to":"1abeadc6_750b162a","updated":"2014-08-25 16:53:02.000000000","message":"Done","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                agent[1] +\u003d count * state_weight_map[state]"},{"line_number":72,"context_line":"            else:"},{"line_number":73,"context_line":"                agent_weights[agent.id] \u003d (agent,"},{"line_number":74,"context_line":"                                           count * state_weight_map[state])"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        sorted_agent_weights \u003d sorted(agent_weights.values(),"},{"line_number":77,"context_line":"                                      key\u003dlambda x: x[1])"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_78e6ab16","line":74,"updated":"2014-08-20 20:27:14.000000000","message":"The second element of this tuple is never updated after initialized here.  That doesn\u0027t seem right to me.  See L71\u0027s note.  I think it is related.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                agent[1] +\u003d count * state_weight_map[state]"},{"line_number":72,"context_line":"            else:"},{"line_number":73,"context_line":"                agent_weights[agent.id] \u003d (agent,"},{"line_number":74,"context_line":"                                           count * state_weight_map[state])"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        sorted_agent_weights \u003d sorted(agent_weights.values(),"},{"line_number":77,"context_line":"                                      key\u003dlambda x: x[1])"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_c848518a","line":74,"in_reply_to":"1abeadc6_78e6ab16","updated":"2014-08-25 16:53:02.000000000","message":"Done","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        sorted_agent_weights \u003d sorted(agent_weights.values(),"},{"line_number":77,"context_line":"                                      key\u003dlambda x: x[1])"},{"line_number":78,"context_line":"        return [agent[0] for agent in sorted_agent_weights]"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_d8bc1fdf","line":78,"updated":"2014-08-20 20:27:14.000000000","message":"\"agent\" here shadows the \"agent\" of L68.  That may have been the cause for the problem I talk about on L71.  Overloaded names often cause confusion and bugs.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        sorted_agent_weights \u003d sorted(agent_weights.values(),"},{"line_number":77,"context_line":"                                      key\u003dlambda x: x[1])"},{"line_number":78,"context_line":"        return [agent[0] for agent in sorted_agent_weights]"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_e85c2d4f","line":78,"in_reply_to":"1abeadc6_d8bc1fdf","updated":"2014-08-25 16:53:02.000000000","message":"Done","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"77e646f640a5393a81fb7635289d4662ce23d76b","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    def get_ha_routers_l3_agents_count(self, context, agent_id):"},{"line_number":27,"context_line":"        \"\"\"For every HA router, on how many agents is it scheduled, excluding"},{"line_number":28,"context_line":"        agent_id?"},{"line_number":29,"context_line":"        \"\"\""},{"line_number":30,"context_line":"        query \u003d (context.session.query("},{"line_number":31,"context_line":"            l3_sch_db.RouterL3AgentBinding.router_id,"},{"line_number":32,"context_line":"            l3_db.Router.tenant_id,"}],"source_content_type":"text/x-python","patch_set":40,"id":"1abeadc6_7ee23c02","line":29,"updated":"2014-08-27 08:28:21.000000000","message":"This query is failing on Postgres but succeeding in sqlite:\n\ntenant_id has to be in the group_by clause or be used in the aggregate function.","commit_id":"080bf623e97a7bfd5517a3e37b6de759f04b04f4"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8ba43167394fa5482380d8b60090ed2e83a92622","unresolved":false,"context_lines":[{"line_number":24,"context_line":"class L3_HA_scheduler_db_mixin(l3_sch_db.L3AgentSchedulerDbMixin):"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def get_ha_routers_l3_agents_count(self, context, agent_id):"},{"line_number":27,"context_line":"        \"\"\"For every HA router, on how many agents is it scheduled, excluding"},{"line_number":28,"context_line":"        agent_id?"},{"line_number":29,"context_line":"        \"\"\""},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_1191bbf0","line":27,"updated":"2014-08-29 22:09:06.000000000","message":"is it -\u003e are","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"781e10488c41bf5611bcb9cd1845404bf432f401","unresolved":false,"context_lines":[{"line_number":24,"context_line":"class L3_HA_scheduler_db_mixin(l3_sch_db.L3AgentSchedulerDbMixin):"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def get_ha_routers_l3_agents_count(self, context, agent_id):"},{"line_number":27,"context_line":"        \"\"\"For every HA router, on how many agents is it scheduled, excluding"},{"line_number":28,"context_line":"        agent_id?"},{"line_number":29,"context_line":"        \"\"\""},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":44,"id":"fa98f980_25d092c8","line":27,"in_reply_to":"1abeadc6_1191bbf0","updated":"2014-09-03 17:21:24.000000000","message":"I changed the phrasing entirely, please check in the latest patchset.","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8ba43167394fa5482380d8b60090ed2e83a92622","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def get_ha_routers_l3_agents_count(self, context, agent_id):"},{"line_number":27,"context_line":"        \"\"\"For every HA router, on how many agents is it scheduled, excluding"},{"line_number":28,"context_line":"        agent_id?"},{"line_number":29,"context_line":"        \"\"\""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        # Postgres requires every column in the select to be present in"}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_71c10fe3","line":28,"updated":"2014-08-29 22:09:06.000000000","message":"agent_id -\u003e those scheduled on the specified agent?","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"781e10488c41bf5611bcb9cd1845404bf432f401","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def get_ha_routers_l3_agents_count(self, context, agent_id):"},{"line_number":27,"context_line":"        \"\"\"For every HA router, on how many agents is it scheduled, excluding"},{"line_number":28,"context_line":"        agent_id?"},{"line_number":29,"context_line":"        \"\"\""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        # Postgres requires every column in the select to be present in"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa98f980_45d596b7","line":28,"in_reply_to":"1abeadc6_71c10fe3","updated":"2014-09-03 17:21:24.000000000","message":"Done","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"781e10488c41bf5611bcb9cd1845404bf432f401","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            outerjoin(l3_sch_db.RouterL3AgentBinding)."},{"line_number":56,"context_line":"            group_by(agents_db.Agent.id)."},{"line_number":57,"context_line":"            filter(agents_db.Agent.id.in_(agent_ids)))"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        result \u003d sorted(query.all(), key\u003dlambda record: record[1])"},{"line_number":60,"context_line":"        return [record[0] for record in result]"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa98f980_85da1ee6","line":58,"updated":"2014-09-03 17:21:24.000000000","message":"Moved the sorting in the query, this bugged me.","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3c5018d842b2feed290c4857d9cc3e78bd31d0a5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":48,"id":"fa98f980_106c049c","updated":"2014-09-09 12:05:29.000000000","message":"nit: consider l3_ha_scheduler_db.py","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3c5018d842b2feed290c4857d9cc3e78bd31d0a5","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class L3_HA_scheduler_db_mixin(l3_sch_db.L3AgentSchedulerDbMixin):"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def get_ha_routers_l3_agents_count(self, context, agent_id):"},{"line_number":27,"context_line":"        \"\"\"Return a map between HA routers and how many agents every"},{"line_number":28,"context_line":"        router is scheduled to. The specified agent is not included in the"},{"line_number":29,"context_line":"        count."}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_305d8816","line":26,"updated":"2014-09-09 12:05:29.000000000","message":"nit: \u0027agent_id\u0027 is confusing since this agent should be exluded from the count","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a01c8eaf197bed1d467add4cdb4bb70f21aab7f2","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class L3_HA_scheduler_db_mixin(l3_sch_db.L3AgentSchedulerDbMixin):"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def get_ha_routers_l3_agents_count(self, context, agent_id):"},{"line_number":27,"context_line":"        \"\"\"Return a map between HA routers and how many agents every"},{"line_number":28,"context_line":"        router is scheduled to. The specified agent is not included in the"},{"line_number":29,"context_line":"        count."}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_ff34abe0","line":26,"in_reply_to":"fa98f980_305d8816","updated":"2014-09-09 17:50:39.000000000","message":"Very true.","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3c5018d842b2feed290c4857d9cc3e78bd31d0a5","unresolved":false,"context_lines":[{"line_number":58,"context_line":"            filter(agents_db.Agent.id.in_(agent_ids))."},{"line_number":59,"context_line":"            order_by(\u0027count\u0027))"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        return [record[0] for record in query.all()]"}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_8db61d89","line":61,"updated":"2014-09-09 12:05:29.000000000","message":"nit: why need .all()?","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a01c8eaf197bed1d467add4cdb4bb70f21aab7f2","unresolved":false,"context_lines":[{"line_number":58,"context_line":"            filter(agents_db.Agent.id.in_(agent_ids))."},{"line_number":59,"context_line":"            order_by(\u0027count\u0027))"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        return [record[0] for record in query.all()]"}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_3f5d5316","line":61,"in_reply_to":"fa98f980_8db61d89","updated":"2014-09-09 17:50:39.000000000","message":"No need, removed.","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d7dc3475d1faa1029acab8061e0e2457bdb447a","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class L3_HA_scheduler_db_mixin(l3_sch_db.L3AgentSchedulerDbMixin):"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def get_ha_routers_l3_agents_count(self, context, excluded_agent_id):"},{"line_number":27,"context_line":"        \"\"\"Return a map between HA routers and how many agents every"},{"line_number":28,"context_line":"        router is scheduled to. The specified agent is not included in the"},{"line_number":29,"context_line":"        count."}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_db7c3bb8","line":26,"updated":"2014-09-10 11:44:29.000000000","message":"Consider making excluded_agent_id optional, to make the function less specific","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5087d914a148ea1b9a94800b2d6e1a50770d9816","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class L3_HA_scheduler_db_mixin(l3_sch_db.L3AgentSchedulerDbMixin):"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def get_ha_routers_l3_agents_count(self, context, excluded_agent_id):"},{"line_number":27,"context_line":"        \"\"\"Return a map between HA routers and how many agents every"},{"line_number":28,"context_line":"        router is scheduled to. The specified agent is not included in the"},{"line_number":29,"context_line":"        count."}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_6d72b2e4","line":26,"in_reply_to":"fa98f980_db7c3bb8","updated":"2014-09-10 13:23:04.000000000","message":"I\u0027d much rather make it optional if we actually need to invoke the function without an excluded agent. Since this function only has a single usage which does need the excluded agent, for now, I\u0027d rather keep it mandatory. A bit more readable imo.","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"}],"neutron/scheduler/l3_agent_scheduler.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ba6959cbdce78899b5ec2edd62809b81bb178e0","unresolved":false,"context_lines":[{"line_number":194,"context_line":""},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"class HAChanceScheduler(ChanceScheduler):"},{"line_number":197,"context_line":"    \"\"\"Randomly allocate a router twice on two different agents.\"\"\""},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def schedule(self, plugin, context, router_id):"},{"line_number":200,"context_line":"        if not cfg.CONF.enable_l3_ha:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BxSw%3D","line":197,"updated":"2014-01-22 10:41:01.000000000","message":"HA may mean 2 or more agents per router. Does it make sense to make agents count per router as an initial parameter for the class?","commit_id":"b4e5536ee843b484199aa10b04924c0a48dd7b7e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ba6959cbdce78899b5ec2edd62809b81bb178e0","unresolved":false,"context_lines":[{"line_number":197,"context_line":"    \"\"\"Randomly allocate a router twice on two different agents.\"\"\""},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def schedule(self, plugin, context, router_id):"},{"line_number":200,"context_line":"        if not cfg.CONF.enable_l3_ha:"},{"line_number":201,"context_line":"            return super(HAChanceScheduler, self).schedule(plugin,"},{"line_number":202,"context_line":"                                                           context,"},{"line_number":203,"context_line":"                                                           router_id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BxSE%3D","line":200,"updated":"2014-01-22 10:41:01.000000000","message":"in the blueprint spec there is l3_agents_per_router config option. If this has changed can you please update the bp?","commit_id":"b4e5536ee843b484199aa10b04924c0a48dd7b7e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ba6959cbdce78899b5ec2edd62809b81bb178e0","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":207,"context_line":"            sync_router \u003d plugin.get_router(context, router_id)"},{"line_number":208,"context_line":"            candidates \u003d self.get_candidates(plugin, context, sync_router)"},{"line_number":209,"context_line":"            if not candidates or len(candidates) \u003c 2:"},{"line_number":210,"context_line":"                LOG.error(_(\"Not enough candidates\"))"},{"line_number":211,"context_line":"                return"},{"line_number":212,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BxQA%3D","line":209,"updated":"2014-01-22 10:41:01.000000000","message":"please use constant for 2","commit_id":"b4e5536ee843b484199aa10b04924c0a48dd7b7e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ba6959cbdce78899b5ec2edd62809b81bb178e0","unresolved":false,"context_lines":[{"line_number":215,"context_line":""},{"line_number":216,"context_line":"            router_ha_state \u003d \"master\""},{"line_number":217,"context_line":"            for agent in chosen_agents:"},{"line_number":218,"context_line":"                binding \u003d l3_agentschedulers_db.RouterL3AgentBinding()"},{"line_number":219,"context_line":"                binding.l3_agent \u003d agent"},{"line_number":220,"context_line":"                binding.router_id \u003d sync_router[\u0027id\u0027]"},{"line_number":221,"context_line":"                binding.router_ha_state \u003d router_ha_state"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BxOk%3D","line":218,"updated":"2014-01-22 10:41:01.000000000","message":"you can add router_ha_state parameter to self.bind_router() and use it here to get rid of duplication","commit_id":"b4e5536ee843b484199aa10b04924c0a48dd7b7e"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"b2414e33d4a50dd3d841319cc5af52e8281c66ee","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":"            return chosen_agent"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"class HAChanceScheduler(ChanceScheduler):"},{"line_number":198,"context_line":"    \"\"\"Randomly allocate a router twice on two different agents.\"\"\""},{"line_number":199,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BcCU%3D","line":196,"updated":"2014-01-26 15:12:08.000000000","message":"Would it be too much to ask to subclass from the LeastRoutersScheduler instead? Accounting of course only for \u0027active\u0027 routers.","commit_id":"093e8116ba86cd9fc7934ad228b286b31ef535c8"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"b2414e33d4a50dd3d841319cc5af52e8281c66ee","unresolved":false,"context_lines":[{"line_number":194,"context_line":"            return chosen_agent"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"class HAChanceScheduler(ChanceScheduler):"},{"line_number":198,"context_line":"    \"\"\"Randomly allocate a router twice on two different agents.\"\"\""},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    def schedule(self, plugin, context, router_id):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BcCg%3D","line":197,"updated":"2014-01-26 15:12:08.000000000","message":"The docstring is inaccurate as the number of routers and agents is configurable.","commit_id":"093e8116ba86cd9fc7934ad228b286b31ef535c8"},{"author":{"_account_id":2711,"name":"Zhang Hua","display_name":"Zhang Hua","email":"joshua.zhang@canonical.com","username":"zhhuabj"},"change_message_id":"6d6e2f3b537641106bfdd895c4f06dd32d313646","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    def schedule(self, plugin, context, router_id):"},{"line_number":201,"context_line":"        l3_need \u003d cfg.CONF.l3_agents_per_router"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        if l3_need \u003c\u003d 1:"},{"line_number":204,"context_line":"            return super(HAChanceScheduler, self).schedule(plugin,"},{"line_number":205,"context_line":"                                                           context,"},{"line_number":206,"context_line":"                                                           router_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BcXo%3D","line":203,"updated":"2014-01-26 10:29:35.000000000","message":"I think \u0027if not l3_need\u0027 should be enough because the default value of l3_agents_per_router is False.","commit_id":"093e8116ba86cd9fc7934ad228b286b31ef535c8"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"c5cde89c13952e39fb26bc86429912aa9405c20a","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    def schedule(self, plugin, context, router_id):"},{"line_number":201,"context_line":"        l3_need \u003d cfg.CONF.l3_agents_per_router"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        if l3_need \u003c\u003d 1:"},{"line_number":204,"context_line":"            return super(HAChanceScheduler, self).schedule(plugin,"},{"line_number":205,"context_line":"                                                           context,"},{"line_number":206,"context_line":"                                                           router_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BaPs%3D","line":203,"in_reply_to":"AAAAUH%2F%2BcXo%3D","updated":"2014-01-27 08:37:04.000000000","message":"default should be fixed","commit_id":"093e8116ba86cd9fc7934ad228b286b31ef535c8"},{"author":{"_account_id":2711,"name":"Zhang Hua","display_name":"Zhang Hua","email":"joshua.zhang@canonical.com","username":"zhhuabj"},"change_message_id":"6d6e2f3b537641106bfdd895c4f06dd32d313646","unresolved":false,"context_lines":[{"line_number":228,"context_line":""},{"line_number":229,"context_line":"                if not chosen_agent:"},{"line_number":230,"context_line":"                    chosen_agent \u003d agent"},{"line_number":231,"context_line":"                ha_state \u003d \"slave\""},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        return chosen_agent"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BcXg%3D","line":231,"updated":"2014-01-26 10:29:35.000000000","message":"suggest using constants","commit_id":"093e8116ba86cd9fc7934ad228b286b31ef535c8"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"8413b70353981a8babd0fa9d07be8428e9344978","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"                priority +\u003d 1"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        return chosen_agent"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F92WE%3D","line":235,"updated":"2014-02-03 10:46:09.000000000","message":"May be it would be interesting to have an HARouterLeastRoutersScheduler.\n\nCan schedules be aware of external conectivity on every l3-agent? Think of situations where two l3-agents don\u0027t have the same conectivity capabilities (different external networks, etc..)","commit_id":"fb2a0d1fd9895a5f4f0867b7d4aa091ae784dbd4"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"9f497eb32bb1cde2f103eb008f55877601bab3bc","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"                priority +\u003d 1"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        return chosen_agent"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F92RY%3D","line":235,"in_reply_to":"AAAAUH%2F92SQ%3D","updated":"2014-02-03 11:00:26.000000000","message":"Mmm, sorry but get_l3_agent_candidates already check the external connectivity to be sure that the router is able to be scheduled on the correct l3 agents.","commit_id":"fb2a0d1fd9895a5f4f0867b7d4aa091ae784dbd4"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"8f2ccaa3fd31b27559b5d272676c2f10d18a751b","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"                priority +\u003d 1"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        return chosen_agent"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F92SQ%3D","line":235,"in_reply_to":"AAAAUH%2F92WE%3D","updated":"2014-02-03 10:56:25.000000000","message":"For an HARouterLeastRoutersScheduler, yes but as a future improvement.\n\nYou\u0027re right for the external connectivity, I will fix that","commit_id":"fb2a0d1fd9895a5f4f0867b7d4aa091ae784dbd4"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9de533dde228c0c1e51f6610ca70b60966adb410","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            return chosen_agent"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"class HARouterScheduler(LeastRoutersScheduler):"},{"line_number":197,"context_line":"    \"\"\"Randomly allocate a router on many different l3 agents.\"\"\""},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def schedule(self, plugin, context, router_id):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F9qfU%3D","line":196,"updated":"2014-02-05 08:50:19.000000000","message":"Why choosing LeastRoutersScheduler as a base? it\u0027s probably worth adding a note to the docstring below","commit_id":"4ab5b84fac2a168ac855e736700890edf32d21bc"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"9b8f7b25f85d21193e8137b8a9e31d4626952cc3","unresolved":false,"context_lines":[{"line_number":197,"context_line":"    \"\"\"Randomly allocate a router on many different l3 agents."},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    Use l3_agents_per_router config parameter in order to schedule"},{"line_number":200,"context_line":"    the virtual router on many agents. If the value of this parameter is set"},{"line_number":201,"context_line":"    to 1 the router will be scheduler by using the LeastRoutersScheduler"},{"line_number":202,"context_line":"    scheduler algorithm."},{"line_number":203,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FiSU%3D","line":200,"updated":"2014-02-12 15:00:15.000000000","message":"\"scheduler\" -\u003e scheduled\n\n\"by using the LeastRoutersScheduler scheduler algorithm\" -\u003e by LeastRoutersScheduler.","commit_id":"03b440dc58cf7e72bca2fdd0b0b0c6589970a45d"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"550a55ad56076bdb67fab47b548be3c24db19db5","unresolved":false,"context_lines":[{"line_number":197,"context_line":"    \"\"\"Randomly allocate a router on many different l3 agents."},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    Use l3_agents_per_router config parameter in order to schedule"},{"line_number":200,"context_line":"    the virtual router on many agents. If the value of this parameter is set"},{"line_number":201,"context_line":"    to 1 the router will be scheduler by using the LeastRoutersScheduler"},{"line_number":202,"context_line":"    scheduler algorithm."},{"line_number":203,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2Fe%2Bc%3D","line":200,"in_reply_to":"AAAAUX%2F%2FiSU%3D","updated":"2014-02-12 21:38:43.000000000","message":"Done","commit_id":"03b440dc58cf7e72bca2fdd0b0b0c6589970a45d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"9b8f7b25f85d21193e8137b8a9e31d4626952cc3","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    \"\"\""},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def schedule(self, plugin, context, router_id):"},{"line_number":206,"context_line":"        l3_need \u003d cfg.CONF.l3_agents_per_router"},{"line_number":207,"context_line":"        if l3_need \u003c\u003d 1:"},{"line_number":208,"context_line":"            super(HARouterScheduler, self).schedule(plugin, context, router_id)"},{"line_number":209,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FipQ%3D","line":206,"updated":"2014-02-12 15:00:15.000000000","message":"I propose to remove:\nl3_agents_per_router\n\nFrom neutron.conf, and add:\nl3_HA \u003d (True|False)\n\nEach router will be scheduled as active on one agent, and as a slave on all other agents, instead of a fixed configurable number.\n\nIs there any use case or advantage to setting l3_agents_per_router to some fixed number?","commit_id":"03b440dc58cf7e72bca2fdd0b0b0c6589970a45d"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"550a55ad56076bdb67fab47b548be3c24db19db5","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    \"\"\""},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def schedule(self, plugin, context, router_id):"},{"line_number":206,"context_line":"        l3_need \u003d cfg.CONF.l3_agents_per_router"},{"line_number":207,"context_line":"        if l3_need \u003c\u003d 1:"},{"line_number":208,"context_line":"            super(HARouterScheduler, self).schedule(plugin, context, router_id)"},{"line_number":209,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2Fex4%3D","line":206,"in_reply_to":"AAAAUX%2F%2FipQ%3D","updated":"2014-02-12 21:38:43.000000000","message":"I think the operator could want to fix a minimum limit of agents on which the router will be spawned. And if don\u0027t set a limit, we will still have to check if a least two agents are available, so we will still have to check the number a valid candidates ?\n\nMoreover we have to create a port for each agent on which the router will be spawned, so more vrrp traffic on overlay, more processes, I prefer to let the user to decide the resources he wants to consume ? And If we want to spawn on every l3 agents we just have to set l3_agents_per_router to same number as the l3 agents number.","commit_id":"03b440dc58cf7e72bca2fdd0b0b0c6589970a45d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"9b8f7b25f85d21193e8137b8a9e31d4626952cc3","unresolved":false,"context_lines":[{"line_number":205,"context_line":"    def schedule(self, plugin, context, router_id):"},{"line_number":206,"context_line":"        l3_need \u003d cfg.CONF.l3_agents_per_router"},{"line_number":207,"context_line":"        if l3_need \u003c\u003d 1:"},{"line_number":208,"context_line":"            super(HARouterScheduler, self).schedule(plugin, context, router_id)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"        chosen_agent \u003d None"},{"line_number":211,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FipY%3D","line":208,"updated":"2014-02-12 15:00:15.000000000","message":"Add return \u003d super(...)\n\nOtherwise you\u0027ll schedule it once via the LeastRouters scheduler, and once again here if l3_agents_per_router \u003d\u003d 1.","commit_id":"03b440dc58cf7e72bca2fdd0b0b0c6589970a45d"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"550a55ad56076bdb67fab47b548be3c24db19db5","unresolved":false,"context_lines":[{"line_number":205,"context_line":"    def schedule(self, plugin, context, router_id):"},{"line_number":206,"context_line":"        l3_need \u003d cfg.CONF.l3_agents_per_router"},{"line_number":207,"context_line":"        if l3_need \u003c\u003d 1:"},{"line_number":208,"context_line":"            super(HARouterScheduler, self).schedule(plugin, context, router_id)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"        chosen_agent \u003d None"},{"line_number":211,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2Fe0Y%3D","line":208,"in_reply_to":"AAAAUX%2F%2FipY%3D","updated":"2014-02-12 21:38:43.000000000","message":"Oh yes thx","commit_id":"03b440dc58cf7e72bca2fdd0b0b0c6589970a45d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"9b8f7b25f85d21193e8137b8a9e31d4626952cc3","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        chosen_agent \u003d None"},{"line_number":211,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":212,"context_line":"            sync_router \u003d plugin.get_router(context, router_id)"},{"line_number":213,"context_line":"            candidates \u003d self.get_candidates(plugin, context, sync_router)"},{"line_number":214,"context_line":"            if not candidates or len(candidates) \u003c l3_need:"},{"line_number":215,"context_line":"                LOG.error(_(\"Not enough candidates\"))"},{"line_number":216,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2Fins%3D","line":213,"updated":"2014-02-12 15:00:15.000000000","message":"Removing l3_agents_per_router will remove the unneeded complexity of not having enough agents / having less agents available than the configured value. This seems like an unnecessary failure possibility.","commit_id":"03b440dc58cf7e72bca2fdd0b0b0c6589970a45d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"e8df9505c159cbfcf7924ede76818ee32a38db1e","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        chosen_agent \u003d None"},{"line_number":211,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":212,"context_line":"            sync_router \u003d plugin.get_router(context, router_id)"},{"line_number":213,"context_line":"            candidates \u003d self.get_candidates(plugin, context, sync_router)"},{"line_number":214,"context_line":"            if not candidates or len(candidates) \u003c l3_need:"},{"line_number":215,"context_line":"                LOG.error(_(\"Not enough candidates\"))"},{"line_number":216,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FZ0g%3D","line":213,"in_reply_to":"AAAAUX%2F%2FZ2c%3D","updated":"2014-02-13 13:13:30.000000000","message":"Thank you - I\u0027m glad we could come to an agreement :)","commit_id":"03b440dc58cf7e72bca2fdd0b0b0c6589970a45d"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"e62ac8a0f6b545c8a1bf946bc18fbec4b9a89bce","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        chosen_agent \u003d None"},{"line_number":211,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":212,"context_line":"            sync_router \u003d plugin.get_router(context, router_id)"},{"line_number":213,"context_line":"            candidates \u003d self.get_candidates(plugin, context, sync_router)"},{"line_number":214,"context_line":"            if not candidates or len(candidates) \u003c l3_need:"},{"line_number":215,"context_line":"                LOG.error(_(\"Not enough candidates\"))"},{"line_number":216,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FZ2c%3D","line":213,"in_reply_to":"AAAAUX%2F%2FaAM%3D","updated":"2014-02-13 13:09:22.000000000","message":"I\u0027m ok with that, so\n\nl3_ha \u003d (True|False)\n# max_l3_agents_per_router \u003d \n\nif max_l3_agents_per_router is set to nothing the router will be scheduled on all","commit_id":"03b440dc58cf7e72bca2fdd0b0b0c6589970a45d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a46ee966f3a0c45597383fd65ab0fd4d93601f70","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        chosen_agent \u003d None"},{"line_number":211,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":212,"context_line":"            sync_router \u003d plugin.get_router(context, router_id)"},{"line_number":213,"context_line":"            candidates \u003d self.get_candidates(plugin, context, sync_router)"},{"line_number":214,"context_line":"            if not candidates or len(candidates) \u003c l3_need:"},{"line_number":215,"context_line":"                LOG.error(_(\"Not enough candidates\"))"},{"line_number":216,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FaAM%3D","line":213,"in_reply_to":"AAAAUX%2F%2Fezk%3D","updated":"2014-02-13 12:50:53.000000000","message":"I can buy the need to set a maximum, but why a minimum (Other than 2)?\n\nI think that if we rename l3_agents_per_router to max_l3_agents_per_router, we\u0027ll save on the unneeded failure of not having \u0027enough\u0027 l3 agents.","commit_id":"03b440dc58cf7e72bca2fdd0b0b0c6589970a45d"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"550a55ad56076bdb67fab47b548be3c24db19db5","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        chosen_agent \u003d None"},{"line_number":211,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":212,"context_line":"            sync_router \u003d plugin.get_router(context, router_id)"},{"line_number":213,"context_line":"            candidates \u003d self.get_candidates(plugin, context, sync_router)"},{"line_number":214,"context_line":"            if not candidates or len(candidates) \u003c l3_need:"},{"line_number":215,"context_line":"                LOG.error(_(\"Not enough candidates\"))"},{"line_number":216,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2Fezk%3D","line":213,"in_reply_to":"AAAAUX%2F%2Fins%3D","updated":"2014-02-12 21:38:43.000000000","message":"As explained above, even if we remove the l3_agents_per_router parameter, we still have to check that at least 2 agents are candidates.","commit_id":"03b440dc58cf7e72bca2fdd0b0b0c6589970a45d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"9b8f7b25f85d21193e8137b8a9e31d4626952cc3","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                          {\u0027router_id\u0027: sync_router[\u0027id\u0027],"},{"line_number":233,"context_line":"                           \u0027agent_id\u0027: agent.id,"},{"line_number":234,"context_line":"                           \u0027priority\u0027: priority})"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"                if not chosen_agent:"},{"line_number":237,"context_line":"                    chosen_agent \u003d agent"},{"line_number":238,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FiVw%3D","line":235,"updated":"2014-02-12 15:00:15.000000000","message":"Note that you return the first agent, which will host the router with the lowest priority, but the master will be the last router with the highest priority, so you\u0027ll return an agent that will be hosting a slave router and not the master. I don\u0027t know if this was intended. In any case, it seems that this return value is not currently used by neutron/db/l3_agent_scheduler.py:schedule_routers, but I guess it makes more sense to return the agent that will be hosting the active router.","commit_id":"03b440dc58cf7e72bca2fdd0b0b0c6589970a45d"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"550a55ad56076bdb67fab47b548be3c24db19db5","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                          {\u0027router_id\u0027: sync_router[\u0027id\u0027],"},{"line_number":233,"context_line":"                           \u0027agent_id\u0027: agent.id,"},{"line_number":234,"context_line":"                           \u0027priority\u0027: priority})"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"                if not chosen_agent:"},{"line_number":237,"context_line":"                    chosen_agent \u003d agent"},{"line_number":238,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FezY%3D","line":235,"in_reply_to":"AAAAUX%2F%2FiVw%3D","updated":"2014-02-12 21:38:43.000000000","message":"You\u0027re right, I\u0027ll fix that","commit_id":"03b440dc58cf7e72bca2fdd0b0b0c6589970a45d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"630613d873c34ffba4ccc5c199a89f0b8ade3508","unresolved":false,"context_lines":[{"line_number":196,"context_line":"class HARouterScheduler(LeastRoutersScheduler):"},{"line_number":197,"context_line":"    \"\"\"Randomly allocate a router on many different l3 agents."},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    Use l3_agents_per_router config parameter in order to schedule"},{"line_number":200,"context_line":"    the virtual router on many agents. If the value of this parameter is set"},{"line_number":201,"context_line":"    to 1 the router will be scheduled by using the LeastRoutersScheduler"},{"line_number":202,"context_line":"    scheduler algorithm."}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUX%2F%2B5%2FA%3D","line":199,"updated":"2014-02-18 13:59:15.000000000","message":"max_l3_agents_per_router","commit_id":"454e217f2f7fb5f962129de97515c288a24ed6ed"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"630613d873c34ffba4ccc5c199a89f0b8ade3508","unresolved":false,"context_lines":[{"line_number":197,"context_line":"    \"\"\"Randomly allocate a router on many different l3 agents."},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    Use l3_agents_per_router config parameter in order to schedule"},{"line_number":200,"context_line":"    the virtual router on many agents. If the value of this parameter is set"},{"line_number":201,"context_line":"    to 1 the router will be scheduled by using the LeastRoutersScheduler"},{"line_number":202,"context_line":"    scheduler algorithm."},{"line_number":203,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUX%2F%2B5%2Bo%3D","line":200,"updated":"2014-02-18 13:59:15.000000000","message":"last sentence also needs to be updated","commit_id":"454e217f2f7fb5f962129de97515c288a24ed6ed"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"630613d873c34ffba4ccc5c199a89f0b8ade3508","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                            \"two agents are needed\"))"},{"line_number":217,"context_line":"                return"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"            max_agents \u003d cfg.CONF.max_l3_agents_per_router or len(candidates)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"            random.shuffle(candidates)"},{"line_number":222,"context_line":"            chosen_agents \u003d candidates[0:max_agents]"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUX%2F%2B578%3D","line":219,"updated":"2014-02-18 13:59:15.000000000","message":"what if max_l3_agents_per_router is set to 1 (by mistake)? Is there a check for it anywhere?","commit_id":"454e217f2f7fb5f962129de97515c288a24ed6ed"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"fd8171ef63dbb91c7c4c8c0c2147795bfe61da14","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            bindings \u003d plugin.get_router_port_binding(context, [router_id])"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"            priority \u003d 1"},{"line_number":226,"context_line":"            for binding, agent in zip(bindings, chosen_agents):"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"                binding.l3_agent_id \u003d agent.id"},{"line_number":229,"context_line":"                binding.priority \u003d priority"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAU3%2F%2F%2Buw%3D","line":226,"updated":"2014-02-23 05:14:13.000000000","message":"itertools.izip()","commit_id":"454e217f2f7fb5f962129de97515c288a24ed6ed"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ed4a8eeed6e434434d8993c4e6ececcdffe93de7","unresolved":false,"context_lines":[{"line_number":206,"context_line":"    def schedule(self, plugin, context, router_id):"},{"line_number":207,"context_line":"        if not cfg.CONF.l3_ha:"},{"line_number":208,"context_line":"            return super(HARouterScheduler, self).schedule(plugin,"},{"line_number":209,"context_line":"                                                           context, router_id)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        min_agents \u003d cfg.CONF.min_l3_agents_per_router"},{"line_number":212,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FxwM%3D","line":209,"updated":"2014-02-24 22:11:01.000000000","message":"nit:  This seems like it is masking a configuration problem.  But, I could live with it.","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d6a0d4d936985b040dcf0f8a0fa57e0282e71163","unresolved":false,"context_lines":[{"line_number":206,"context_line":"    def schedule(self, plugin, context, router_id):"},{"line_number":207,"context_line":"        if not cfg.CONF.l3_ha:"},{"line_number":208,"context_line":"            return super(HARouterScheduler, self).schedule(plugin,"},{"line_number":209,"context_line":"                                                           context, router_id)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        min_agents \u003d cfg.CONF.min_l3_agents_per_router"},{"line_number":212,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2F7Lw%3D","line":209,"in_reply_to":"AAAAU3%2F%2FbiE%3D","updated":"2014-03-03 11:42:33.000000000","message":"Agree this is a non-sensical configuration but I don\u0027t think we have to raise a exception for that, I\u0027ll add a log.warn instead.","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"578eb099412277bb991b7cd367b9f55905c78508","unresolved":false,"context_lines":[{"line_number":206,"context_line":"    def schedule(self, plugin, context, router_id):"},{"line_number":207,"context_line":"        if not cfg.CONF.l3_ha:"},{"line_number":208,"context_line":"            return super(HARouterScheduler, self).schedule(plugin,"},{"line_number":209,"context_line":"                                                           context, router_id)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        min_agents \u003d cfg.CONF.min_l3_agents_per_router"},{"line_number":212,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FbiE%3D","line":209,"in_reply_to":"AAAAU3%2F%2FgTU%3D","updated":"2014-02-26 17:33:37.000000000","message":"Configuration uses HARouterScheduler but doesn\u0027t enable l3_ha.  This is a non-sensical configuration to me.  But, not a big deal and not the reason for my -1.","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"77915cc4ad00f4f01ff99e6d42e7a0b42cd05115","unresolved":false,"context_lines":[{"line_number":206,"context_line":"    def schedule(self, plugin, context, router_id):"},{"line_number":207,"context_line":"        if not cfg.CONF.l3_ha:"},{"line_number":208,"context_line":"            return super(HARouterScheduler, self).schedule(plugin,"},{"line_number":209,"context_line":"                                                           context, router_id)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        min_agents \u003d cfg.CONF.min_l3_agents_per_router"},{"line_number":212,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FgTU%3D","line":209,"in_reply_to":"AAAAU3%2F%2FxwM%3D","updated":"2014-02-26 08:49:54.000000000","message":"What do you mean Carl? :)","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3d25982c6245a178ff24a1ab4b73629af4abcf0c","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            return super(HARouterScheduler, self).schedule(plugin,"},{"line_number":209,"context_line":"                                                           context, router_id)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        min_agents \u003d cfg.CONF.min_l3_agents_per_router"},{"line_number":212,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"        if max_agents and max_agents \u003c min_agents:"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2F254%3D","line":211,"updated":"2014-02-24 13:25:34.000000000","message":"same question - is there a check for min_l3_agents_per_router \u003e  1?","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d6a0d4d936985b040dcf0f8a0fa57e0282e71163","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            return super(HARouterScheduler, self).schedule(plugin,"},{"line_number":209,"context_line":"                                                           context, router_id)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        min_agents \u003d cfg.CONF.min_l3_agents_per_router"},{"line_number":212,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"        if max_agents and max_agents \u003c min_agents:"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2F7SM%3D","line":211,"in_reply_to":"AAAAU3%2F%2F254%3D","updated":"2014-03-03 11:42:33.000000000","message":"I\u0027ll remove this, since the check is made during the router creation","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ed4a8eeed6e434434d8993c4e6ececcdffe93de7","unresolved":false,"context_lines":[{"line_number":213,"context_line":""},{"line_number":214,"context_line":"        if max_agents and max_agents \u003c min_agents:"},{"line_number":215,"context_line":"            LOG.error(_(\"Configuration error, max_l3_agents_per_router is \""},{"line_number":216,"context_line":"                        \"lower than min_l3_agents_per_router\"))"},{"line_number":217,"context_line":"            return"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        chosen_agent \u003d None"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2Fxww%3D","line":216,"updated":"2014-02-24 22:11:01.000000000","message":"I think that configuration errors like this should be found earlier.  Can we check this closer to agent startup so that the problem becomes immediately apparent?  The agent could even die immediately indicating a bad configuration.  This helps the deployer find and fix these problems earlier.","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d6a0d4d936985b040dcf0f8a0fa57e0282e71163","unresolved":false,"context_lines":[{"line_number":213,"context_line":""},{"line_number":214,"context_line":"        if max_agents and max_agents \u003c min_agents:"},{"line_number":215,"context_line":"            LOG.error(_(\"Configuration error, max_l3_agents_per_router is \""},{"line_number":216,"context_line":"                        \"lower than min_l3_agents_per_router\"))"},{"line_number":217,"context_line":"            return"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        chosen_agent \u003d None"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2F7R8%3D","line":216,"in_reply_to":"AAAAU3%2F%2FgSw%3D","updated":"2014-03-03 11:42:33.000000000","message":"Same as above, I\u0027ll remove this test.","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"77915cc4ad00f4f01ff99e6d42e7a0b42cd05115","unresolved":false,"context_lines":[{"line_number":213,"context_line":""},{"line_number":214,"context_line":"        if max_agents and max_agents \u003c min_agents:"},{"line_number":215,"context_line":"            LOG.error(_(\"Configuration error, max_l3_agents_per_router is \""},{"line_number":216,"context_line":"                        \"lower than min_l3_agents_per_router\"))"},{"line_number":217,"context_line":"            return"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        chosen_agent \u003d None"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FgSw%3D","line":216,"in_reply_to":"AAAAU3%2F%2Fxww%3D","updated":"2014-02-26 08:49:54.000000000","message":"I agree.","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ed4a8eeed6e434434d8993c4e6ececcdffe93de7","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                        \"lower than min_l3_agents_per_router\"))"},{"line_number":217,"context_line":"            return"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        chosen_agent \u003d None"},{"line_number":220,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":221,"context_line":"            sync_router \u003d plugin.get_router(context, router_id)"},{"line_number":222,"context_line":"            candidates \u003d self.get_candidates(plugin, context, sync_router)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2Fxo4%3D","line":219,"updated":"2014-02-24 22:11:01.000000000","message":"suggestion:  rename this to primary_agent, or primary_chosen_agent for clarity.","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d6a0d4d936985b040dcf0f8a0fa57e0282e71163","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                        \"lower than min_l3_agents_per_router\"))"},{"line_number":217,"context_line":"            return"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        chosen_agent \u003d None"},{"line_number":220,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":221,"context_line":"            sync_router \u003d plugin.get_router(context, router_id)"},{"line_number":222,"context_line":"            candidates \u003d self.get_candidates(plugin, context, sync_router)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FZIo%3D","line":219,"in_reply_to":"AAAAU3%2F%2FgSk%3D","updated":"2014-03-03 11:42:33.000000000","message":"Agree","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"77915cc4ad00f4f01ff99e6d42e7a0b42cd05115","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                        \"lower than min_l3_agents_per_router\"))"},{"line_number":217,"context_line":"            return"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        chosen_agent \u003d None"},{"line_number":220,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":221,"context_line":"            sync_router \u003d plugin.get_router(context, router_id)"},{"line_number":222,"context_line":"            candidates \u003d self.get_candidates(plugin, context, sync_router)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FgSk%3D","line":219,"in_reply_to":"AAAAU3%2F%2Fxo4%3D","updated":"2014-02-26 08:49:54.000000000","message":"Agree.","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"77915cc4ad00f4f01ff99e6d42e7a0b42cd05115","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            if not candidates or len(candidates) \u003c min_agents:"},{"line_number":224,"context_line":"                LOG.error(_(\"Not enough candidates, in Ha mode at least \""},{"line_number":225,"context_line":"                            \"%s agents are needed\"),"},{"line_number":226,"context_line":"                          cfg.CONF.min_l3_agents_per_router)"},{"line_number":227,"context_line":"                return"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"            max_agents \u003d min(max_agents, len(candidates))"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FgRg%3D","line":226,"updated":"2014-02-26 08:49:54.000000000","message":"What happens if a network node is down temporarily, and a new router is created, that has at least a few network nodes available?\n\nShouldn\u0027t we just warn, and go on with what we have, instead of failing?","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d6a0d4d936985b040dcf0f8a0fa57e0282e71163","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            if not candidates or len(candidates) \u003c min_agents:"},{"line_number":224,"context_line":"                LOG.error(_(\"Not enough candidates, in Ha mode at least \""},{"line_number":225,"context_line":"                            \"%s agents are needed\"),"},{"line_number":226,"context_line":"                          cfg.CONF.min_l3_agents_per_router)"},{"line_number":227,"context_line":"                return"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"            max_agents \u003d min(max_agents, len(candidates))"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FZHM%3D","line":226,"in_reply_to":"AAAAU3%2F%2Fbgw%3D","updated":"2014-03-03 11:42:33.000000000","message":"I agree with Carl, seems to be a bad idea to scheduled an HA router to less that min_l3_agents_per_router which could be set to 2.","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"52e9348b896fbe62556cd2e7df61e134297618fe","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            if not candidates or len(candidates) \u003c min_agents:"},{"line_number":224,"context_line":"                LOG.error(_(\"Not enough candidates, in Ha mode at least \""},{"line_number":225,"context_line":"                            \"%s agents are needed\"),"},{"line_number":226,"context_line":"                          cfg.CONF.min_l3_agents_per_router)"},{"line_number":227,"context_line":"                return"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"            max_agents \u003d min(max_agents, len(candidates))"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FZhs%3D","line":226,"in_reply_to":"AAAAU3%2F%2Fbgw%3D","updated":"2014-02-27 08:18:23.000000000","message":"Yeah, you\u0027re right on that. Unless the ha router was able to auto-scale later when we had more available nodes.","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"578eb099412277bb991b7cd367b9f55905c78508","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            if not candidates or len(candidates) \u003c min_agents:"},{"line_number":224,"context_line":"                LOG.error(_(\"Not enough candidates, in Ha mode at least \""},{"line_number":225,"context_line":"                            \"%s agents are needed\"),"},{"line_number":226,"context_line":"                          cfg.CONF.min_l3_agents_per_router)"},{"line_number":227,"context_line":"                return"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"            max_agents \u003d min(max_agents, len(candidates))"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2Fbgw%3D","line":226,"in_reply_to":"AAAAU3%2F%2FgRg%3D","updated":"2014-02-26 17:33:37.000000000","message":"I wondered the same thing.  I tend to think that it would be a bad idea to give the impression that we\u0027ve created an HA router when we can\u0027t schedule at least min_l3_agents_per_router.  But, my opinion could be swayed.","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ed4a8eeed6e434434d8993c4e6ececcdffe93de7","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                            \u0027L3 agent %(agent_id)s with %(priority)s\u0027),"},{"line_number":245,"context_line":"                          {\u0027router_id\u0027: sync_router[\u0027id\u0027],"},{"line_number":246,"context_line":"                           \u0027agent_id\u0027: agent.id,"},{"line_number":247,"context_line":"                           \u0027priority\u0027: priority})"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"                chosen_agent \u003d agent"},{"line_number":250,"context_line":"                priority +\u003d 1"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2Fxmg%3D","line":247,"updated":"2014-02-24 22:11:01.000000000","message":"I assume higher number is higher priority but am I correct?","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"b749b735d7ca2c29dd07572c1cd81797472f5647","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                            \u0027L3 agent %(agent_id)s with %(priority)s\u0027),"},{"line_number":245,"context_line":"                          {\u0027router_id\u0027: sync_router[\u0027id\u0027],"},{"line_number":246,"context_line":"                           \u0027agent_id\u0027: agent.id,"},{"line_number":247,"context_line":"                           \u0027priority\u0027: priority})"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"                chosen_agent \u003d agent"},{"line_number":250,"context_line":"                priority +\u003d 1"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVX%2F%2F8h0%3D","line":247,"in_reply_to":"AAAAU3%2F%2Fxmg%3D","updated":"2014-02-27 07:54:54.000000000","message":"You\u0027re correct.\n\nhttp://en.wikipedia.org/wiki/Virtual_Router_Redundancy_Protocol#Implementation","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2bfa90e14fddeb827c855cd1dd9e07f4750d414d","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                            \u0027L3 agent %(agent_id)s with %(priority)s\u0027),"},{"line_number":245,"context_line":"                          {\u0027router_id\u0027: sync_router[\u0027id\u0027],"},{"line_number":246,"context_line":"                           \u0027agent_id\u0027: agent.id,"},{"line_number":247,"context_line":"                           \u0027priority\u0027: priority})"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"                chosen_agent \u003d agent"},{"line_number":250,"context_line":"                priority +\u003d 1"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVX%2F%2F2F0%3D","line":247,"in_reply_to":"AAAAVX%2F%2F8h0%3D","updated":"2014-02-27 21:44:03.000000000","message":"Thanks for the link.","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"6593df3637e97ab58fd6f36c5b678b09ca860acc","unresolved":false,"context_lines":[{"line_number":246,"context_line":""},{"line_number":247,"context_line":"                primary_chosen_agent \u003d agent"},{"line_number":248,"context_line":"                priority +\u003d 1"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"        return primary_chosen_agent"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FYV0%3D","line":249,"updated":"2014-03-06 14:05:56.000000000","message":"You could remove the \u0027primary_chosen_agent\u0027 definition at line 217, the assignment at line 247 and here in line 250:\n\nreturn chosen_agents[-1]\n\nIf you reach this return it means you didn\u0027t exit earlier, therefore chosen_agents is non-empty.","commit_id":"a29e43805be2ec1a6971815955102161ac101a70"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"fc5f569e94a114e5582b0f5bcf87a840f7ab6449","unresolved":false,"context_lines":[{"line_number":194,"context_line":"            return chosen_agent"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"class HARouterScheduler(LeastRoutersScheduler):"},{"line_number":198,"context_line":"    \"\"\"Randomly allocate a router on many different l3 agents."},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    Use min_l3_agents_per_router and max_l3_agents_per_router config parameter"}],"source_content_type":"text/x-python","patch_set":19,"id":"7adec928_a2f12b6c","line":197,"updated":"2014-05-22 19:55:10.000000000","message":"This scheduler is a \"chance\" scheduler but strangely inherits from LeastRouterScheduler instead of ChanceScheduler. It implies if l3_ha \u003d\u003d True, random placement is used otherwise Least charged placement is used\n\nCulture question: why do you implemented chance placement and not least charged one ?","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ff8cc1dd6a9a759191bc7deaf8c7999bdabcf033","unresolved":false,"context_lines":[{"line_number":194,"context_line":"            return chosen_agent"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"class HARouterScheduler(LeastRoutersScheduler):"},{"line_number":198,"context_line":"    \"\"\"Randomly allocate a router on many different l3 agents."},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    Use min_l3_agents_per_router and max_l3_agents_per_router config parameter"}],"source_content_type":"text/x-python","patch_set":19,"id":"baada198_f6c47293","line":197,"in_reply_to":"7adec928_a2f12b6c","updated":"2014-07-13 15:04:05.000000000","message":"I can\u0027t answer for Sylvain as for the why, but it should be an easy change to make in this scheduler, it just requires a change in get_l3_agent_with_min_routers.","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ff8cc1dd6a9a759191bc7deaf8c7999bdabcf033","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    Use min_l3_agents_per_router and max_l3_agents_per_router config parameter"},{"line_number":201,"context_line":"    in order to schedule the virtual router on many agents. If the l3_ha"},{"line_number":202,"context_line":"    config parameter is set to false the router will be scheduled by using"},{"line_number":203,"context_line":"    the LeastRoutersScheduler scheduler algorithm."},{"line_number":204,"context_line":"    \"\"\""},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    def schedule(self, plugin, context, router_id):"}],"source_content_type":"text/x-python","patch_set":19,"id":"baada198_56b8be10","line":203,"updated":"2014-07-13 15:04:05.000000000","message":"This comment is problematic (\"If the l3_ha config is set to false...\"), see comment below.","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"01b14cfb7232822857e60ded2038f7c7cb0e3985","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    Use min_l3_agents_per_router and max_l3_agents_per_router config parameter"},{"line_number":201,"context_line":"    in order to schedule the virtual router on many agents. If the l3_ha"},{"line_number":202,"context_line":"    config parameter is set to false the router will be scheduled by using"},{"line_number":203,"context_line":"    the LeastRoutersScheduler scheduler algorithm."},{"line_number":204,"context_line":"    \"\"\""},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    def schedule(self, plugin, context, router_id):"}],"source_content_type":"text/x-python","patch_set":19,"id":"baada198_29ead6d7","line":203,"in_reply_to":"baada198_56b8be10","updated":"2014-07-15 07:46:46.000000000","message":"Has to be revisited since the specs now introduced an API to manage the HA","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ff8cc1dd6a9a759191bc7deaf8c7999bdabcf033","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        if not cfg.CONF.l3_ha:"},{"line_number":208,"context_line":"            LOG.warn(_(\"HARouterScheduled is set in the configuration but \""},{"line_number":209,"context_line":"                       \"l3_ha is not enabled. LeastRoutersScheduler will be \""},{"line_number":210,"context_line":"                       \"used instead\"))"},{"line_number":211,"context_line":"            return super(HARouterScheduler, self).schedule(plugin,"},{"line_number":212,"context_line":"                                                           context, router_id)"},{"line_number":213,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"baada198_f019d9d1","line":210,"updated":"2014-07-13 15:04:05.000000000","message":"This means that cfg.CONF.l3_ha is not a default. IE: If someone sent create_router with ha: True, but CONF.l3_ha is False, the router is expected to be HA but will not be.","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"01b14cfb7232822857e60ded2038f7c7cb0e3985","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        if not cfg.CONF.l3_ha:"},{"line_number":208,"context_line":"            LOG.warn(_(\"HARouterScheduled is set in the configuration but \""},{"line_number":209,"context_line":"                       \"l3_ha is not enabled. LeastRoutersScheduler will be \""},{"line_number":210,"context_line":"                       \"used instead\"))"},{"line_number":211,"context_line":"            return super(HARouterScheduler, self).schedule(plugin,"},{"line_number":212,"context_line":"                                                           context, router_id)"},{"line_number":213,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"baada198_e9ca9e6c","line":210,"in_reply_to":"baada198_f019d9d1","updated":"2014-07-15 07:46:46.000000000","message":"See above :)","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"5129da8e83b92b602fe12f5303a2417784d07c90","unresolved":false,"context_lines":[{"line_number":223,"context_line":"                          cfg.CONF.min_l3_agents_per_router)"},{"line_number":224,"context_line":"                return"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"            max_agents \u003d min(max_agents, len(candidates))"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"            random.shuffle(candidates)"},{"line_number":229,"context_line":"            chosen_agents \u003d candidates[0:max_agents]"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAXH%2F%2Fc%2Fo%3D","line":226,"updated":"2014-04-21 16:49:14.000000000","message":"This line isn\u0027t needed\n\na \u003d range(10)\na[2:500] --\u003e [5, 6, 7, 8, 9]","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"24b6badf205eea1f6fddd8b22aad5e367cbbb19a","unresolved":false,"context_lines":[{"line_number":223,"context_line":"                          cfg.CONF.min_l3_agents_per_router)"},{"line_number":224,"context_line":"                return"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"            max_agents \u003d min(max_agents, len(candidates))"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"            random.shuffle(candidates)"},{"line_number":229,"context_line":"            chosen_agents \u003d candidates[0:max_agents]"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAXH%2F%2FXW4%3D","line":226,"in_reply_to":"AAAAXH%2F%2Fc%2Fo%3D","updated":"2014-04-22 09:38:02.000000000","message":"Hi Nachi, maybe I missed something here but this is not to generate a range but to choose what is the limit of the maximum number of l3 agents that is going to be used. This max limit will be the min between the number of available agents and the max defined in the config file.","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"fc5f569e94a114e5582b0f5bcf87a840f7ab6449","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                return"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"            max_agents \u003d min(max_agents, len(candidates))"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"            random.shuffle(candidates)"},{"line_number":229,"context_line":"            chosen_agents \u003d candidates[0:max_agents]"},{"line_number":230,"context_line":"            bindings \u003d plugin.get_router_port_binding(context, [router_id])"}],"source_content_type":"text/x-python","patch_set":19,"id":"7adec928_c2e8f77e","line":227,"updated":"2014-05-22 19:55:10.000000000","message":"Indeed \"max_agents \u003d min(max_agents ...)\" is not required because candidates[: max_agents] do it implicitly\n\nyou can use instead (seems more efficient ?)\n  chosen_agents \u003d random.sample(candidates, min(max_agents, len(candidates))","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"1dd544952e24db954e273fa65696696bdd55d109","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            bindings \u003d plugin.get_router_port_binding(context, [router_id])"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"            priority \u003d 1"},{"line_number":233,"context_line":"            for binding, agent in itertools.izip(bindings, chosen_agents):"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"                binding.l3_agent_id \u003d agent.id"},{"line_number":236,"context_line":"                binding.priority \u003d priority"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAWn%2F%2F9E8%3D","line":233,"updated":"2014-04-08 09:17:47.000000000","message":"Have u thought about the case(min\u003d2, max\u003d3)?:\n1. have two l3 agents alive,\n2. create the router, it is scheduled to those agents\n3. a new l3 agent alive, then since our max is 3,  the new l3 agent should host that router too.","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"ee277a73f1d130d72c18ab11469ce323611d4aef","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            bindings \u003d plugin.get_router_port_binding(context, [router_id])"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"            priority \u003d 1"},{"line_number":233,"context_line":"            for binding, agent in itertools.izip(bindings, chosen_agents):"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"                binding.l3_agent_id \u003d agent.id"},{"line_number":236,"context_line":"                binding.priority \u003d priority"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAW3%2F%2FeKw%3D","line":233,"in_reply_to":"AAAAWn%2F%2F9E8%3D","updated":"2014-04-14 11:55:24.000000000","message":"The purpose of the min/max is to fix an acceptable limit to have HA, so if the min is set to 2 I think it is ok even if a new agent is added after that the router was previously scheduled. Moreover I think there no way to trigger something like rescheduling when a new agent appear ?","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"fc5f569e94a114e5582b0f5bcf87a840f7ab6449","unresolved":false,"context_lines":[{"line_number":231,"context_line":""},{"line_number":232,"context_line":"            priority \u003d 1"},{"line_number":233,"context_line":"            for binding, agent in itertools.izip(bindings, chosen_agents):"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"                binding.l3_agent_id \u003d agent.id"},{"line_number":236,"context_line":"                binding.priority \u003d priority"},{"line_number":237,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7adec928_e2eb3376","line":234,"updated":"2014-05-22 19:55:10.000000000","message":"It is the purpose of auto_scheduler_routers, which must be updated because it assumes min/max_agents \u003d 1","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ff8cc1dd6a9a759191bc7deaf8c7999bdabcf033","unresolved":false,"context_lines":[{"line_number":231,"context_line":""},{"line_number":232,"context_line":"            priority \u003d 1"},{"line_number":233,"context_line":"            for binding, agent in itertools.izip(bindings, chosen_agents):"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"                binding.l3_agent_id \u003d agent.id"},{"line_number":236,"context_line":"                binding.priority \u003d priority"},{"line_number":237,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"baada198_166646ed","line":234,"in_reply_to":"7adec928_e2eb3376","updated":"2014-07-13 15:04:05.000000000","message":"+1\n\nauth_schedule_routers won\u0027t put the router on the 3rd agent since it\u0027s already scheduled. The solution could be to override auto_schedule_routers.","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"01b14cfb7232822857e60ded2038f7c7cb0e3985","unresolved":false,"context_lines":[{"line_number":231,"context_line":""},{"line_number":232,"context_line":"            priority \u003d 1"},{"line_number":233,"context_line":"            for binding, agent in itertools.izip(bindings, chosen_agents):"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"                binding.l3_agent_id \u003d agent.id"},{"line_number":236,"context_line":"                binding.priority \u003d priority"},{"line_number":237,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"baada198_a9834601","line":234,"in_reply_to":"baada198_166646ed","updated":"2014-07-15 07:46:46.000000000","message":"+1 to override auto_schedule_routers","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"1f74fd333e5e378579e31d4f29f7289ce2d84145","unresolved":false,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"class HARouterScheduler(LeastRoutersScheduler):"},{"line_number":198,"context_line":"    \"\"\"Randomly allocate a router on many different l3 agents."},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    Use min_l3_agents_per_router and max_l3_agents_per_router config parameter"},{"line_number":201,"context_line":"    in order to schedule the virtual router on many agents. If the l3_ha"}],"source_content_type":"text/x-python","patch_set":21,"id":"baada198_a7ad78ec","line":198,"updated":"2014-07-25 08:37:30.000000000","message":"It\u0027s confusing to define a HA chance scheduler which inherits from LeastRouterScheduler: not the same allocation strategy is used depending on sync_router[\u0027ha\u0027].","commit_id":"4941e3c167e166e8d107184e47b84123ec9ea64e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e492fc6f3008518b5fcf457c69dba848da9c2ad2","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        sync_router \u003d plugin.get_router(context, router_id)"},{"line_number":208,"context_line":"        if not sync_router[\u0027ha\u0027]:"},{"line_number":209,"context_line":"            return super(HARouterScheduler, self).schedule(plugin,"},{"line_number":210,"context_line":"                                                           context, router_id)"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        min_agents \u003d cfg.CONF.min_l3_agents_per_router"},{"line_number":213,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"}],"source_content_type":"text/x-python","patch_set":21,"id":"baada198_703ebb2a","line":210,"updated":"2014-07-25 06:57:28.000000000","message":"do you need to pass candidates as well?","commit_id":"4941e3c167e166e8d107184e47b84123ec9ea64e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e492fc6f3008518b5fcf457c69dba848da9c2ad2","unresolved":false,"context_lines":[{"line_number":216,"context_line":"            candidates \u003d (candidates or"},{"line_number":217,"context_line":"                          self.get_candidates(plugin, context, sync_router))"},{"line_number":218,"context_line":"            if not candidates or len(candidates) \u003c min_agents:"},{"line_number":219,"context_line":"                LOG.error(_(\"Not enough candidates, in Ha mode at least \""},{"line_number":220,"context_line":"                            \"%s agents are needed\"),"},{"line_number":221,"context_line":"                          cfg.CONF.min_l3_agents_per_router)"},{"line_number":222,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":21,"id":"baada198_b044d3b8","line":219,"updated":"2014-07-25 06:57:28.000000000","message":"nit: HA","commit_id":"4941e3c167e166e8d107184e47b84123ec9ea64e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e492fc6f3008518b5fcf457c69dba848da9c2ad2","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            if not candidates or len(candidates) \u003c min_agents:"},{"line_number":219,"context_line":"                LOG.error(_(\"Not enough candidates, in Ha mode at least \""},{"line_number":220,"context_line":"                            \"%s agents are needed\"),"},{"line_number":221,"context_line":"                          cfg.CONF.min_l3_agents_per_router)"},{"line_number":222,"context_line":"                return"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"            max_agents \u003d min(max_agents, len(candidates))"}],"source_content_type":"text/x-python","patch_set":21,"id":"baada198_3008c37f","line":221,"updated":"2014-07-25 06:57:28.000000000","message":"nit: can use min_agents","commit_id":"4941e3c167e166e8d107184e47b84123ec9ea64e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e492fc6f3008518b5fcf457c69dba848da9c2ad2","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                port_binding.l3_agent_id \u003d agent.id"},{"line_number":234,"context_line":"                self.bind_router(context, router_id, agent)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"                LOG.debug(_(\u0027HA Router %(router_id)s is scheduled to \u0027"},{"line_number":237,"context_line":"                            \u0027L3 agent %(agent_id)s)\u0027),"},{"line_number":238,"context_line":"                          {\u0027router_id\u0027: sync_router[\u0027id\u0027],"},{"line_number":239,"context_line":"                           \u0027agent_id\u0027: agent.id})"}],"source_content_type":"text/x-python","patch_set":21,"id":"baada198_307fe3e0","line":236,"updated":"2014-07-25 06:57:28.000000000","message":"please no translation for debug messages","commit_id":"4941e3c167e166e8d107184e47b84123ec9ea64e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e492fc6f3008518b5fcf457c69dba848da9c2ad2","unresolved":false,"context_lines":[{"line_number":235,"context_line":""},{"line_number":236,"context_line":"                LOG.debug(_(\u0027HA Router %(router_id)s is scheduled to \u0027"},{"line_number":237,"context_line":"                            \u0027L3 agent %(agent_id)s)\u0027),"},{"line_number":238,"context_line":"                          {\u0027router_id\u0027: sync_router[\u0027id\u0027],"},{"line_number":239,"context_line":"                           \u0027agent_id\u0027: agent.id})"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        return chosen_agents[-1]"}],"source_content_type":"text/x-python","patch_set":21,"id":"baada198_30cd2331","line":238,"updated":"2014-07-25 06:57:28.000000000","message":"nit: can use router_id","commit_id":"4941e3c167e166e8d107184e47b84123ec9ea64e"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"6fa6f292cc5677a844158ea52ba850f0a6079a18","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                LOG.warn(_(\u0027L3 agent %s is not active\u0027), l3_agent.id)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"            # check if each of the specified routers is hosted"},{"line_number":84,"context_line":"            l3_agents \u003d None"},{"line_number":85,"context_line":"            if router_ids:"},{"line_number":86,"context_line":"                routers \u003d plugin.get_routers("},{"line_number":87,"context_line":"                    context, filters\u003d{\u0027id\u0027: router_ids})"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_a1efe084","line":84,"updated":"2014-08-12 08:20:53.000000000","message":"This line is meaningless.","commit_id":"4d5f7221eca27616fda64803e03fd8eecc24c2a0"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5e8a5c00c97f5ff67e709935418cd2542b9bc974","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                LOG.warn(_(\u0027L3 agent %s is not active\u0027), l3_agent.id)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"            # check if each of the specified routers is hosted"},{"line_number":84,"context_line":"            l3_agents \u003d None"},{"line_number":85,"context_line":"            if router_ids:"},{"line_number":86,"context_line":"                routers \u003d plugin.get_routers("},{"line_number":87,"context_line":"                    context, filters\u003d{\u0027id\u0027: router_ids})"}],"source_content_type":"text/x-python","patch_set":29,"id":"1abeadc6_47f35e73","line":84,"in_reply_to":"baada198_a1efe084","updated":"2014-08-17 17:36:03.000000000","message":"Done","commit_id":"4d5f7221eca27616fda64803e03fd8eecc24c2a0"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"6fa6f292cc5677a844158ea52ba850f0a6079a18","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                    # all (specified) routers are already scheduled"},{"line_number":101,"context_line":"                    # In the case of HA check is the number of agents"},{"line_number":102,"context_line":"                    # hosting routers could be increased"},{"line_number":103,"context_line":"                    if utils.is_extension_supported("},{"line_number":104,"context_line":"                        plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":105,"context_line":"                        return self.ha_increase_scheduled_routers("},{"line_number":106,"context_line":"                            plugin, context, l3_agent)"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_93d78f21","line":103,"updated":"2014-08-12 08:20:53.000000000","message":"Code duplication is bad.\nWhy ha_increase_scheduled_routers is called only when there\u0027s no router to schedule?","commit_id":"4d5f7221eca27616fda64803e03fd8eecc24c2a0"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5e8a5c00c97f5ff67e709935418cd2542b9bc974","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                    # all (specified) routers are already scheduled"},{"line_number":101,"context_line":"                    # In the case of HA check is the number of agents"},{"line_number":102,"context_line":"                    # hosting routers could be increased"},{"line_number":103,"context_line":"                    if utils.is_extension_supported("},{"line_number":104,"context_line":"                        plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":105,"context_line":"                        return self.ha_increase_scheduled_routers("},{"line_number":106,"context_line":"                            plugin, context, l3_agent)"}],"source_content_type":"text/x-python","patch_set":29,"id":"1abeadc6_279582e4","line":103,"in_reply_to":"baada198_93d78f21","updated":"2014-08-17 17:36:03.000000000","message":"The idea here is that when a new agent is installed, the admin could raise max_l3_agents_per_router + 1. In this case, even though the existing HA routers are scheduled, we want to schedule them to the new agent. Unscheduled routers should go through the normal router scheduling flow.","commit_id":"4d5f7221eca27616fda64803e03fd8eecc24c2a0"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from neutron.db import l3_agentschedulers_db"},{"line_number":30,"context_line":"from neutron.db import l3_db"},{"line_number":31,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_a1dcb913","line":32,"updated":"2014-08-20 20:27:14.000000000","message":"Avoid unnecessary changes like this.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from neutron.db import l3_agentschedulers_db"},{"line_number":30,"context_line":"from neutron.db import l3_db"},{"line_number":31,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_085a4950","line":32,"in_reply_to":"1abeadc6_a1dcb913","updated":"2014-08-25 16:53:02.000000000","message":"Done","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            if agents_db.AgentDbMixin.is_agent_down("},{"line_number":80,"context_line":"                l3_agent.heartbeat_timestamp):"},{"line_number":81,"context_line":"                LOG.warn(_(\u0027L3 agent %s is not active\u0027), l3_agent.id)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"            # check if each of the specified routers is hosted"},{"line_number":84,"context_line":"            if router_ids:"},{"line_number":85,"context_line":"                routers \u003d plugin.get_routers("}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_0109ed94","line":82,"updated":"2014-08-20 20:27:14.000000000","message":"ditto","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            if agents_db.AgentDbMixin.is_agent_down("},{"line_number":80,"context_line":"                l3_agent.heartbeat_timestamp):"},{"line_number":81,"context_line":"                LOG.warn(_(\u0027L3 agent %s is not active\u0027), l3_agent.id)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"            # check if each of the specified routers is hosted"},{"line_number":84,"context_line":"            if router_ids:"},{"line_number":85,"context_line":"                routers \u003d plugin.get_routers("}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_e80a6d26","line":82,"in_reply_to":"1abeadc6_0109ed94","updated":"2014-08-25 16:53:02.000000000","message":"Done","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"87fc56a49a3c92654cb2a1d7f193cec5f854047d","unresolved":false,"context_lines":[{"line_number":95,"context_line":"                                   \u0027agent_id\u0027: l3_agents[0][\u0027id\u0027]})"},{"line_number":96,"context_line":"                    else:"},{"line_number":97,"context_line":"                        unscheduled_routers.append(router)"},{"line_number":98,"context_line":"                if not unscheduled_routers:"},{"line_number":99,"context_line":"                    # all (specified) routers are already scheduled"},{"line_number":100,"context_line":"                    # In the case of HA check is the number of agents"},{"line_number":101,"context_line":"                    # hosting routers could be increased"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_bb782bc5","line":98,"updated":"2014-08-21 09:44:51.000000000","message":"To avoid code duplication, I suggest moving lines 98-105 to line 126.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":95,"context_line":"                                   \u0027agent_id\u0027: l3_agents[0][\u0027id\u0027]})"},{"line_number":96,"context_line":"                    else:"},{"line_number":97,"context_line":"                        unscheduled_routers.append(router)"},{"line_number":98,"context_line":"                if not unscheduled_routers:"},{"line_number":99,"context_line":"                    # all (specified) routers are already scheduled"},{"line_number":100,"context_line":"                    # In the case of HA check is the number of agents"},{"line_number":101,"context_line":"                    # hosting routers could be increased"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_bd6c280a","line":98,"in_reply_to":"1abeadc6_bb782bc5","updated":"2014-08-25 16:53:02.000000000","message":"Done","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"87fc56a49a3c92654cb2a1d7f193cec5f854047d","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                    # hosting routers could be increased"},{"line_number":102,"context_line":"                    if utils.is_extension_supported("},{"line_number":103,"context_line":"                        plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":104,"context_line":"                        return self.ha_increase_scheduled_routers("},{"line_number":105,"context_line":"                            plugin, context, l3_agent)"},{"line_number":106,"context_line":"            else:"},{"line_number":107,"context_line":"                # get all routers that are not hosted"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_fb1d43bf","line":104,"updated":"2014-08-21 09:44:51.000000000","message":"(continuing from comments on patchset 29)\nI agree ha_increase_scheduled_routers should be called only when a new agent is added.  But what causes an auto_schedule_routers call on an agent addition?\nIf it\u0027s from sync_routers RPC call from the new agent, it\u0027s quite magical and needs to be documented.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                    # hosting routers could be increased"},{"line_number":102,"context_line":"                    if utils.is_extension_supported("},{"line_number":103,"context_line":"                        plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":104,"context_line":"                        return self.ha_increase_scheduled_routers("},{"line_number":105,"context_line":"                            plugin, context, l3_agent)"},{"line_number":106,"context_line":"            else:"},{"line_number":107,"context_line":"                # get all routers that are not hosted"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_c4af557c","line":104,"in_reply_to":"1abeadc6_fb1d43bf","updated":"2014-08-25 16:53:02.000000000","message":"That\u0027s exactly the case. Magical indeed :)","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"87fc56a49a3c92654cb2a1d7f193cec5f854047d","unresolved":false,"context_lines":[{"line_number":102,"context_line":"                    if utils.is_extension_supported("},{"line_number":103,"context_line":"                        plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":104,"context_line":"                        return self.ha_increase_scheduled_routers("},{"line_number":105,"context_line":"                            plugin, context, l3_agent)"},{"line_number":106,"context_line":"            else:"},{"line_number":107,"context_line":"                # get all routers that are not hosted"},{"line_number":108,"context_line":"                #TODO(gongysh) consider the disabled agent\u0027s router"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_5b51d734","line":105,"updated":"2014-08-21 09:44:51.000000000","message":"You need \"else return False\" here.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":102,"context_line":"                    if utils.is_extension_supported("},{"line_number":103,"context_line":"                        plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":104,"context_line":"                        return self.ha_increase_scheduled_routers("},{"line_number":105,"context_line":"                            plugin, context, l3_agent)"},{"line_number":106,"context_line":"            else:"},{"line_number":107,"context_line":"                # get all routers that are not hosted"},{"line_number":108,"context_line":"                #TODO(gongysh) consider the disabled agent\u0027s router"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_6b4c9777","line":105,"in_reply_to":"1abeadc6_5b51d734","updated":"2014-08-25 16:53:02.000000000","message":"Oh boy... You\u0027re correct.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"87fc56a49a3c92654cb2a1d7f193cec5f854047d","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                                              l3_db.Router.id).filter(stmt)]"},{"line_number":115,"context_line":"                if not unscheduled_router_ids:"},{"line_number":116,"context_line":"                    LOG.debug(_(\u0027No non-hosted routers\u0027))"},{"line_number":117,"context_line":"                    # The number of l3 agents hosting ha router could"},{"line_number":118,"context_line":"                    # potentially be increased, depending of the"},{"line_number":119,"context_line":"                    # configuration parameter"},{"line_number":120,"context_line":"                    if utils.is_extension_supported("}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_d6385ed5","line":117,"updated":"2014-08-21 09:44:51.000000000","message":"I suggest replacing lines 117-123 with \"unscheduled_routers \u003d []\" to avoid code duplication.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                                              l3_db.Router.id).filter(stmt)]"},{"line_number":115,"context_line":"                if not unscheduled_router_ids:"},{"line_number":116,"context_line":"                    LOG.debug(_(\u0027No non-hosted routers\u0027))"},{"line_number":117,"context_line":"                    # The number of l3 agents hosting ha router could"},{"line_number":118,"context_line":"                    # potentially be increased, depending of the"},{"line_number":119,"context_line":"                    # configuration parameter"},{"line_number":120,"context_line":"                    if utils.is_extension_supported("}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_dd71e4e1","line":117,"in_reply_to":"1abeadc6_d6385ed5","updated":"2014-08-25 16:53:02.000000000","message":"Done","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"c74b4b84e665ec9dcc34c0ead45a09656d6d23e3","unresolved":false,"context_lines":[{"line_number":148,"context_line":"                                             l3_agent.id)):"},{"line_number":149,"context_line":"                    continue"},{"line_number":150,"context_line":"                if router_dict.get(\u0027ha\u0027):"},{"line_number":151,"context_line":"                    if not self.ha_has_binding(plugin, context,"},{"line_number":152,"context_line":"                                               router_dict[\u0027id\u0027],"},{"line_number":153,"context_line":"                                               l3_agent.id):"},{"line_number":154,"context_line":"                        self.ha_create_new_router_binding(plugin, context,"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_e8be32ad","line":151,"updated":"2014-08-22 07:28:50.000000000","message":"DVR checks existence of a binding from RouterL3AgentBinding.  Why the HA code need to do otherwise?\n\nI suggest to change the name of dvr_has_binding to router_has_binding and use it instead of ha_has_binding.\n(line 146 needs to be updated, too)","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":148,"context_line":"                                             l3_agent.id)):"},{"line_number":149,"context_line":"                    continue"},{"line_number":150,"context_line":"                if router_dict.get(\u0027ha\u0027):"},{"line_number":151,"context_line":"                    if not self.ha_has_binding(plugin, context,"},{"line_number":152,"context_line":"                                               router_dict[\u0027id\u0027],"},{"line_number":153,"context_line":"                                               l3_agent.id):"},{"line_number":154,"context_line":"                        self.ha_create_new_router_binding(plugin, context,"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_31f4c986","line":151,"in_reply_to":"1abeadc6_e8be32ad","updated":"2014-08-25 16:53:02.000000000","message":"Good point.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bcab311da161a183c91ba006efc5dff5fa290ccc","unresolved":false,"context_lines":[{"line_number":231,"context_line":"                self.bind_router(context, router_id, chosen_agent)"},{"line_number":232,"context_line":"        elif sync_router.get(\u0027ha\u0027, False):"},{"line_number":233,"context_line":"            chosen_agent \u003d self.ha_bind_router(plugin, context,"},{"line_number":234,"context_line":"                                               router_id, candidates)"},{"line_number":235,"context_line":"        else:"},{"line_number":236,"context_line":"            chosen_agent \u003d self._choose_router_agent("},{"line_number":237,"context_line":"                plugin, context, candidates)"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_d865ff1e","line":234,"updated":"2014-08-20 20:27:14.000000000","message":"I guess this needs to be worked out for a router than is both distributed and ha.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":231,"context_line":"                self.bind_router(context, router_id, chosen_agent)"},{"line_number":232,"context_line":"        elif sync_router.get(\u0027ha\u0027, False):"},{"line_number":233,"context_line":"            chosen_agent \u003d self.ha_bind_router(plugin, context,"},{"line_number":234,"context_line":"                                               router_id, candidates)"},{"line_number":235,"context_line":"        else:"},{"line_number":236,"context_line":"            chosen_agent \u003d self._choose_router_agent("},{"line_number":237,"context_line":"                plugin, context, candidates)"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_44c34538","line":234,"in_reply_to":"1abeadc6_d865ff1e","updated":"2014-08-25 16:53:02.000000000","message":"I\u0027m suggesting that we do that in follow up patches, as bug fixes.","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"c74b4b84e665ec9dcc34c0ead45a09656d6d23e3","unresolved":false,"context_lines":[{"line_number":264,"context_line":"    def ha_has_binding(self, plugin, context, router_id, agent_id):"},{"line_number":265,"context_line":"        port_bindings \u003d plugin.get_ha_router_port_binding(context,"},{"line_number":266,"context_line":"                                                          [router_id],"},{"line_number":267,"context_line":"                                                          [agent_id])"},{"line_number":268,"context_line":"        return len(port_bindings) \u003e 0"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def ha_create_new_router_binding(self, plugin, context,"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_485806fa","line":267,"updated":"2014-08-22 07:28:50.000000000","message":"The 3rd arg to get_ha_router_port_binding seems to be incorrect.\nMoreover, I don\u0027t think this function is needed at all. (see the other comment)","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"ffe004bb24611b190298f5aee06d9ee54095fcbd","unresolved":false,"context_lines":[{"line_number":264,"context_line":"    def ha_has_binding(self, plugin, context, router_id, agent_id):"},{"line_number":265,"context_line":"        port_bindings \u003d plugin.get_ha_router_port_binding(context,"},{"line_number":266,"context_line":"                                                          [router_id],"},{"line_number":267,"context_line":"                                                          [agent_id])"},{"line_number":268,"context_line":"        return len(port_bindings) \u003e 0"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def ha_create_new_router_binding(self, plugin, context,"}],"source_content_type":"text/x-python","patch_set":31,"id":"1abeadc6_ab1f8f5a","line":267,"in_reply_to":"1abeadc6_485806fa","updated":"2014-08-25 16:53:02.000000000","message":"Done","commit_id":"60aa404e84072b7ebb9c65bf7c76691b2a51b081"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8ba43167394fa5482380d8b60090ed2e83a92622","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":39,"context_line":"class L3SchedulerMixin(object):"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    @abc.abstractmethod"},{"line_number":42,"context_line":"    def schedule(self, plugin, context, router_id,"}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_d17823c6","line":39,"updated":"2014-08-29 22:09:06.000000000","message":"(No action required) Oh mixins, how do I love thee? That\u0027s right, not at all.","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8ba43167394fa5482380d8b60090ed2e83a92622","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"            if not unscheduled_routers:"},{"line_number":135,"context_line":"                if utils.is_extension_supported("},{"line_number":136,"context_line":"                    plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":137,"context_line":"                    return self.ha_increase_scheduled_routers("},{"line_number":138,"context_line":"                        plugin, context, l3_agent)"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_71366f04","line":136,"updated":"2014-08-29 22:09:06.000000000","message":"IWAMOTO Toshihiro\u0027s comment below is incorrect, but that would be more obvious if this line were indented 4 more spaces to clearly differentiate the conditional from the block that follows (this is suggested by PEP8, too).","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"781e10488c41bf5611bcb9cd1845404bf432f401","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"            if not unscheduled_routers:"},{"line_number":135,"context_line":"                if utils.is_extension_supported("},{"line_number":136,"context_line":"                    plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":137,"context_line":"                    return self.ha_increase_scheduled_routers("},{"line_number":138,"context_line":"                        plugin, context, l3_agent)"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":44,"id":"fa98f980_c57c26b8","line":136,"in_reply_to":"1abeadc6_71366f04","updated":"2014-09-03 17:21:24.000000000","message":"Done","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"ebf5cd8f2bb42cceef22a53b2e7a1c5cf7bbe53b","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                if utils.is_extension_supported("},{"line_number":136,"context_line":"                    plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":137,"context_line":"                    return self.ha_increase_scheduled_routers("},{"line_number":138,"context_line":"                        plugin, context, l3_agent)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"            target_routers \u003d self.get_routers_can_schedule("},{"line_number":141,"context_line":"                context, plugin, unscheduled_routers, l3_agent)"}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_efc02f52","line":138,"updated":"2014-08-28 07:19:25.000000000","message":"\"return False\" is needed here.","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8ba43167394fa5482380d8b60090ed2e83a92622","unresolved":false,"context_lines":[{"line_number":186,"context_line":"    def bind_routers(self, context, plugin, routers, l3_agent):"},{"line_number":187,"context_line":"        for router in routers:"},{"line_number":188,"context_line":"            if (router.get(\u0027distributed\u0027, False) and"},{"line_number":189,"context_line":"                self.router_has_binding(context, router[\u0027id\u0027], l3_agent.id)):"},{"line_number":190,"context_line":"                    continue"},{"line_number":191,"context_line":"            if router.get(\u0027ha\u0027):"},{"line_number":192,"context_line":"                if not self.router_has_binding(context, router[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_4c163a4a","line":189,"updated":"2014-08-29 22:09:06.000000000","message":"This line should be indented 4 spaces and the one below dedented 4 spaces.","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"781e10488c41bf5611bcb9cd1845404bf432f401","unresolved":false,"context_lines":[{"line_number":186,"context_line":"    def bind_routers(self, context, plugin, routers, l3_agent):"},{"line_number":187,"context_line":"        for router in routers:"},{"line_number":188,"context_line":"            if (router.get(\u0027distributed\u0027, False) and"},{"line_number":189,"context_line":"                self.router_has_binding(context, router[\u0027id\u0027], l3_agent.id)):"},{"line_number":190,"context_line":"                    continue"},{"line_number":191,"context_line":"            if router.get(\u0027ha\u0027):"},{"line_number":192,"context_line":"                if not self.router_has_binding(context, router[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa98f980_3a3fd089","line":189,"in_reply_to":"1abeadc6_4c163a4a","updated":"2014-09-03 17:21:24.000000000","message":"Done","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"ebf5cd8f2bb42cceef22a53b2e7a1c5cf7bbe53b","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                    self.ha_create_new_router_binding("},{"line_number":195,"context_line":"                            plugin, context, router[\u0027id\u0027],"},{"line_number":196,"context_line":"                            router[\u0027tenant_id\u0027], l3_agent)"},{"line_number":197,"context_line":"                    continue"},{"line_number":198,"context_line":"            self.bind_router(context, router[\u0027id\u0027], l3_agent)"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    def bind_router(self, context, router_id, chosen_agent):"}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_cf0613ce","line":197,"updated":"2014-08-28 07:19:25.000000000","message":"This \"continue\" should have one less indent levels.","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"781e10488c41bf5611bcb9cd1845404bf432f401","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                    self.ha_create_new_router_binding("},{"line_number":195,"context_line":"                            plugin, context, router[\u0027id\u0027],"},{"line_number":196,"context_line":"                            router[\u0027tenant_id\u0027], l3_agent)"},{"line_number":197,"context_line":"                    continue"},{"line_number":198,"context_line":"            self.bind_router(context, router[\u0027id\u0027], l3_agent)"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    def bind_router(self, context, router_id, chosen_agent):"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa98f980_cbe51439","line":197,"in_reply_to":"1abeadc6_6c6056a5","updated":"2014-09-03 17:21:24.000000000","message":"Changed it around, added tests. Not 100% it\u0027s simpler, it can go either way.","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"781e10488c41bf5611bcb9cd1845404bf432f401","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                    self.ha_create_new_router_binding("},{"line_number":195,"context_line":"                            plugin, context, router[\u0027id\u0027],"},{"line_number":196,"context_line":"                            router[\u0027tenant_id\u0027], l3_agent)"},{"line_number":197,"context_line":"                    continue"},{"line_number":198,"context_line":"            self.bind_router(context, router[\u0027id\u0027], l3_agent)"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    def bind_router(self, context, router_id, chosen_agent):"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa98f980_2bf14002","line":197,"in_reply_to":"1abeadc6_cf0613ce","updated":"2014-09-03 17:21:24.000000000","message":"Correct!","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8ba43167394fa5482380d8b60090ed2e83a92622","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                    self.ha_create_new_router_binding("},{"line_number":195,"context_line":"                            plugin, context, router[\u0027id\u0027],"},{"line_number":196,"context_line":"                            router[\u0027tenant_id\u0027], l3_agent)"},{"line_number":197,"context_line":"                    continue"},{"line_number":198,"context_line":"            self.bind_router(context, router[\u0027id\u0027], l3_agent)"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    def bind_router(self, context, router_id, chosen_agent):"}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_6c6056a5","line":197,"in_reply_to":"1abeadc6_cf0613ce","updated":"2014-08-29 22:09:06.000000000","message":"How about we go one better and replace the use of continues with if/elif/else.  The first continue on line 190 could become \u0027pass\u0027.","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8ba43167394fa5482380d8b60090ed2e83a92622","unresolved":false,"context_lines":[{"line_number":249,"context_line":"class HASchedulerMixin(object):"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def __init__(self):"},{"line_number":252,"context_line":"        self.min_agents \u003d cfg.CONF.min_l3_agents_per_router"},{"line_number":253,"context_line":"        self.max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def get_num_of_agents(self, candidates):"}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_4cfc7ab5","line":252,"updated":"2014-08-29 22:09:06.000000000","message":"(No action required) Yuck, references to global config in a method that could accept the values instead.  Curse you, mixins.","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8ba43167394fa5482380d8b60090ed2e83a92622","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        return (min(self.max_agents, len(candidates)) if self.max_agents"},{"line_number":257,"context_line":"                else len(candidates))"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    def enough_candidates_for_ha(self, candidates):"},{"line_number":260,"context_line":"        if not candidates or len(candidates) \u003c self.min_agents:"},{"line_number":261,"context_line":"            LOG.error(_LE(\"Not enough candidates, an HA router needs at least \""},{"line_number":262,"context_line":"                          \"%s agents\"), self.min_agents)"}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_acdb4e4d","line":259,"updated":"2014-08-29 22:09:06.000000000","message":"(No action required) Am I the only one that finds the term \u0027candidates\u0027 kind of strange?  We\u0027re talking about scheduling, after all, not elections.","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8ba43167394fa5482380d8b60090ed2e83a92622","unresolved":false,"context_lines":[{"line_number":280,"context_line":"        to be scheduled on the given agent if max_l3_agents_per_router"},{"line_number":281,"context_line":"        is not yet reached."},{"line_number":282,"context_line":"        \"\"\""},{"line_number":283,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        routers_agents \u003d plugin.get_ha_routers_l3_agents_count(context,"},{"line_number":286,"context_line":"                                                               agent[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_6c14d69f","line":283,"updated":"2014-08-29 22:09:06.000000000","message":"This is already defined as self.max_agents","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"781e10488c41bf5611bcb9cd1845404bf432f401","unresolved":false,"context_lines":[{"line_number":280,"context_line":"        to be scheduled on the given agent if max_l3_agents_per_router"},{"line_number":281,"context_line":"        is not yet reached."},{"line_number":282,"context_line":"        \"\"\""},{"line_number":283,"context_line":"        max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        routers_agents \u003d plugin.get_ha_routers_l3_agents_count(context,"},{"line_number":286,"context_line":"                                                               agent[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa98f980_4bc924ab","line":283,"in_reply_to":"1abeadc6_6c14d69f","updated":"2014-09-03 17:21:24.000000000","message":"Done","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8ba43167394fa5482380d8b60090ed2e83a92622","unresolved":false,"context_lines":[{"line_number":288,"context_line":"        scheduled \u003d False"},{"line_number":289,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":290,"context_line":"        for router_agents in routers_agents:"},{"line_number":291,"context_line":"            router_id, tenant_id, agents \u003d router_agents"},{"line_number":292,"context_line":"            if not max_agents or agents \u003c max_agents:"},{"line_number":293,"context_line":"                if not self.router_has_binding(admin_ctx, router_id, agent.id):"},{"line_number":294,"context_line":"                    self.ha_create_new_router_binding(plugin, admin_ctx,"}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_2c049e16","line":291,"updated":"2014-08-29 22:09:06.000000000","message":"Consider unpacking in the for loop, e.g.\n\n for router_id, tenant_id, agents in router_agents:","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"781e10488c41bf5611bcb9cd1845404bf432f401","unresolved":false,"context_lines":[{"line_number":288,"context_line":"        scheduled \u003d False"},{"line_number":289,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":290,"context_line":"        for router_agents in routers_agents:"},{"line_number":291,"context_line":"            router_id, tenant_id, agents \u003d router_agents"},{"line_number":292,"context_line":"            if not max_agents or agents \u003c max_agents:"},{"line_number":293,"context_line":"                if not self.router_has_binding(admin_ctx, router_id, agent.id):"},{"line_number":294,"context_line":"                    self.ha_create_new_router_binding(plugin, admin_ctx,"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa98f980_6bcee8b5","line":291,"in_reply_to":"1abeadc6_2c049e16","updated":"2014-09-03 17:21:24.000000000","message":"Done","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8ba43167394fa5482380d8b60090ed2e83a92622","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":290,"context_line":"        for router_agents in routers_agents:"},{"line_number":291,"context_line":"            router_id, tenant_id, agents \u003d router_agents"},{"line_number":292,"context_line":"            if not max_agents or agents \u003c max_agents:"},{"line_number":293,"context_line":"                if not self.router_has_binding(admin_ctx, router_id, agent.id):"},{"line_number":294,"context_line":"                    self.ha_create_new_router_binding(plugin, admin_ctx,"},{"line_number":295,"context_line":"                                                      router_id, tenant_id,"}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_6c1a167e","line":292,"updated":"2014-08-29 22:09:06.000000000","message":"Consider simplifying as follows:\n\nbinding_required \u003d (if not max_agents...)\nif binding_required:\n  self.ha_create_new_router_binding()\n  scheduled \u003d True","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"781e10488c41bf5611bcb9cd1845404bf432f401","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":290,"context_line":"        for router_agents in routers_agents:"},{"line_number":291,"context_line":"            router_id, tenant_id, agents \u003d router_agents"},{"line_number":292,"context_line":"            if not max_agents or agents \u003c max_agents:"},{"line_number":293,"context_line":"                if not self.router_has_binding(admin_ctx, router_id, agent.id):"},{"line_number":294,"context_line":"                    self.ha_create_new_router_binding(plugin, admin_ctx,"},{"line_number":295,"context_line":"                                                      router_id, tenant_id,"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa98f980_ab0b7028","line":292,"in_reply_to":"1abeadc6_6c1a167e","updated":"2014-09-03 17:21:24.000000000","message":"Done","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"214601e79079f5ce7fed1f3836cede0404b56943","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":"cfg.CONF.register_opts(l3_hamode_db.L3_HA_OPTS)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":46,"id":"fa98f980_5f6ac9b3","line":35,"updated":"2014-09-03 11:22:40.000000000","message":"it seems from parent change options are already registered in l3_hamode and if not should be registered in l3_hamode","commit_id":"6c40d16d73653b5a5f1ca99ff18b5a79110f69d3"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"db170fea3d634c7543910af4c708487307df3253","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":"cfg.CONF.register_opts(l3_hamode_db.L3_HA_OPTS)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":46,"id":"fa98f980_665b7d2e","line":35,"in_reply_to":"fa98f980_5f6ac9b3","updated":"2014-09-03 17:21:34.000000000","message":"I added this line when NEC plugin failed to start because the min/max options weren\u0027t registered.","commit_id":"6c40d16d73653b5a5f1ca99ff18b5a79110f69d3"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"55f906e62abdac0adf24f5686610c1037f96f993","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            context, plugin, router_ids)"},{"line_number":132,"context_line":"        if not unscheduled_routers:"},{"line_number":133,"context_line":"            if utils.is_extension_supported("},{"line_number":134,"context_line":"                plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":135,"context_line":"                return self.ha_increase_scheduled_routers("},{"line_number":136,"context_line":"                    plugin, context, l3_agent)"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":46,"id":"fa98f980_e4b850ca","line":134,"updated":"2014-09-03 11:11:56.000000000","message":"as Maru said, this line needs to be indented, so the if statement is distinguishable from the if block.","commit_id":"6c40d16d73653b5a5f1ca99ff18b5a79110f69d3"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"db170fea3d634c7543910af4c708487307df3253","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            context, plugin, router_ids)"},{"line_number":132,"context_line":"        if not unscheduled_routers:"},{"line_number":133,"context_line":"            if utils.is_extension_supported("},{"line_number":134,"context_line":"                plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":135,"context_line":"                return self.ha_increase_scheduled_routers("},{"line_number":136,"context_line":"                    plugin, context, l3_agent)"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":46,"id":"fa98f980_c6498961","line":134,"in_reply_to":"fa98f980_e4b850ca","updated":"2014-09-03 17:21:34.000000000","message":"Done","commit_id":"6c40d16d73653b5a5f1ca99ff18b5a79110f69d3"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6135ccc4a864ef83fc6419cee5df92bef5287414","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":"cfg.CONF.register_opts(l3_hamode_db.L3_HA_OPTS)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_a8de086b","line":35,"updated":"2014-09-03 20:21:43.000000000","message":"Why do we need to register L3_HA_OPTS twice? It is already registered in l3_ha_db.py.","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"9a577eba6b719adf05d242e148f2a9d1084b843e","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":"cfg.CONF.register_opts(l3_hamode_db.L3_HA_OPTS)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_f636a6b3","line":35,"in_reply_to":"fa98f980_36202e9b","updated":"2014-09-09 00:02:38.000000000","message":"Re-introduced, finally I thought it is useful for plugins which doesn\u0027t implement HA, so doesn\u0027t import l3_hamode_db. Maybe Assaf could confirm this ?","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"6775ce422906ec320eceeec64255560df96dd4ca","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":"cfg.CONF.register_opts(l3_hamode_db.L3_HA_OPTS)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_36202e9b","line":35,"in_reply_to":"fa98f980_a8de086b","updated":"2014-09-08 23:46:46.000000000","message":"removed","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bb55d61f47514fbfcf2209dd2dc33962760ca52d","unresolved":false,"context_lines":[{"line_number":184,"context_line":"    def bind_routers(self, context, plugin, routers, l3_agent):"},{"line_number":185,"context_line":"        for router in routers:"},{"line_number":186,"context_line":"            is_distributed \u003d router.get(\u0027distributed\u0027, False)"},{"line_number":187,"context_line":"            is_ha \u003d router.get(\u0027ha\u0027)"},{"line_number":188,"context_line":"            if is_ha and not is_distributed:"},{"line_number":189,"context_line":"                if not self.router_has_binding(context, router[\u0027id\u0027],"},{"line_number":190,"context_line":"                                               l3_agent.id):"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_bb0ad423","line":187,"updated":"2014-09-03 21:44:17.000000000","message":"Should we have something blow up or log if is_ha and is_distributed until that is resolved in a future patch?","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"6775ce422906ec320eceeec64255560df96dd4ca","unresolved":false,"context_lines":[{"line_number":184,"context_line":"    def bind_routers(self, context, plugin, routers, l3_agent):"},{"line_number":185,"context_line":"        for router in routers:"},{"line_number":186,"context_line":"            is_distributed \u003d router.get(\u0027distributed\u0027, False)"},{"line_number":187,"context_line":"            is_ha \u003d router.get(\u0027ha\u0027)"},{"line_number":188,"context_line":"            if is_ha and not is_distributed:"},{"line_number":189,"context_line":"                if not self.router_has_binding(context, router[\u0027id\u0027],"},{"line_number":190,"context_line":"                                               l3_agent.id):"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_426df003","line":187,"in_reply_to":"fa98f980_bb0ad423","updated":"2014-09-08 23:46:46.000000000","message":"There is a test for that in the models patch.","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bb55d61f47514fbfcf2209dd2dc33962760ca52d","unresolved":false,"context_lines":[{"line_number":191,"context_line":"                    self.create_ha_router_binding("},{"line_number":192,"context_line":"                        plugin, context, router[\u0027id\u0027],"},{"line_number":193,"context_line":"                        router[\u0027tenant_id\u0027], l3_agent)"},{"line_number":194,"context_line":"            elif (is_distributed and not self.router_has_binding("},{"line_number":195,"context_line":"                    context, router[\u0027id\u0027], l3_agent.id)) or not is_distributed:"},{"line_number":196,"context_line":"                self.bind_router(context, router[\u0027id\u0027], l3_agent)"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_7b3eacdb","line":194,"updated":"2014-09-03 21:44:17.000000000","message":"This isn\u0027t quite a proper inversion of the original condition.  Should it be?  Given the original continues to the next iteration of the loop on (A and B) then these are proper inversions (assuming is_ha is False):\n\n  not (A and B)\n  not A or not B\n\nIn particular, self.bind_router will not be called if is_distributed is False.  In the original, it would be.","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c68c007e358746ecdfb505f3820fd918030896a9","unresolved":false,"context_lines":[{"line_number":191,"context_line":"                    self.create_ha_router_binding("},{"line_number":192,"context_line":"                        plugin, context, router[\u0027id\u0027],"},{"line_number":193,"context_line":"                        router[\u0027tenant_id\u0027], l3_agent)"},{"line_number":194,"context_line":"            elif (is_distributed and not self.router_has_binding("},{"line_number":195,"context_line":"                    context, router[\u0027id\u0027], l3_agent.id)) or not is_distributed:"},{"line_number":196,"context_line":"                self.bind_router(context, router[\u0027id\u0027], l3_agent)"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_6f71b443","line":194,"in_reply_to":"fa98f980_45f33a0a","updated":"2014-09-10 21:58:07.000000000","message":"I missed the last \"or not is_distributed\"  Claudiu\u0027s suggestion will improve readability.","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"6775ce422906ec320eceeec64255560df96dd4ca","unresolved":false,"context_lines":[{"line_number":191,"context_line":"                    self.create_ha_router_binding("},{"line_number":192,"context_line":"                        plugin, context, router[\u0027id\u0027],"},{"line_number":193,"context_line":"                        router[\u0027tenant_id\u0027], l3_agent)"},{"line_number":194,"context_line":"            elif (is_distributed and not self.router_has_binding("},{"line_number":195,"context_line":"                    context, router[\u0027id\u0027], l3_agent.id)) or not is_distributed:"},{"line_number":196,"context_line":"                self.bind_router(context, router[\u0027id\u0027], l3_agent)"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_45f33a0a","line":194,"in_reply_to":"fa98f980_7b3eacdb","updated":"2014-09-08 23:46:46.000000000","message":"If the is_distributed is false the \"or\" in the second part of the elif statement will trigger the binding. In any case I will use one of the suggestion of Claudiu, better for the readability.","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"c1af400a705e1207d84318560aef8ffb3cc4c6c9","unresolved":false,"context_lines":[{"line_number":191,"context_line":"                    self.create_ha_router_binding("},{"line_number":192,"context_line":"                        plugin, context, router[\u0027id\u0027],"},{"line_number":193,"context_line":"                        router[\u0027tenant_id\u0027], l3_agent)"},{"line_number":194,"context_line":"            elif (is_distributed and not self.router_has_binding("},{"line_number":195,"context_line":"                    context, router[\u0027id\u0027], l3_agent.id)) or not is_distributed:"},{"line_number":196,"context_line":"                self.bind_router(context, router[\u0027id\u0027], l3_agent)"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_9d867664","line":194,"in_reply_to":"fa98f980_7b3eacdb","updated":"2014-09-08 10:23:37.000000000","message":"this if also looks strange to me as well. \n\nif (is_distributed and not router_has_binding or not is_distrbuted):\n\nSince is_distributed is required twice, would be better:\n\nif (not is_distributed or not router_has_binding):\n\nor even better:\n\nif not (is_distributed and router_has_binding):\n\nAlso, what if is_ha \u003d True and is_distributed \u003d True?","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"6775ce422906ec320eceeec64255560df96dd4ca","unresolved":false,"context_lines":[{"line_number":191,"context_line":"                    self.create_ha_router_binding("},{"line_number":192,"context_line":"                        plugin, context, router[\u0027id\u0027],"},{"line_number":193,"context_line":"                        router[\u0027tenant_id\u0027], l3_agent)"},{"line_number":194,"context_line":"            elif (is_distributed and not self.router_has_binding("},{"line_number":195,"context_line":"                    context, router[\u0027id\u0027], l3_agent.id)) or not is_distributed:"},{"line_number":196,"context_line":"                self.bind_router(context, router[\u0027id\u0027], l3_agent)"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_a5f5c6cc","line":194,"in_reply_to":"fa98f980_9d867664","updated":"2014-09-08 23:46:46.000000000","message":"@Claudiu, we currently don\u0027t support ha and distributed, there is a check in the models patch. Thx for the suggestion of the if statement.","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bb55d61f47514fbfcf2209dd2dc33962760ca52d","unresolved":false,"context_lines":[{"line_number":231,"context_line":"                self.bind_router(context, router_id, chosen_agent)"},{"line_number":232,"context_line":"        elif sync_router.get(\u0027ha\u0027, False):"},{"line_number":233,"context_line":"            chosen_agent \u003d self.ha_bind_router(plugin, context,"},{"line_number":234,"context_line":"                                               router_id, candidates)"},{"line_number":235,"context_line":"        else:"},{"line_number":236,"context_line":"            chosen_agent \u003d self._choose_router_agent("},{"line_number":237,"context_line":"                plugin, context, candidates)"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_593e508d","line":234,"updated":"2014-09-03 21:44:17.000000000","message":"No action requested:  It doesn\u0027t seem quite right for _schedule_router to return a single agent given this new HA capability.  I wonder if this needs to be refactored.\n\nAt the least, could you consider my suggestion on L366","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6135ccc4a864ef83fc6419cee5df92bef5287414","unresolved":false,"context_lines":[{"line_number":246,"context_line":""},{"line_number":247,"context_line":"class HASchedulerMixin(object):"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def __init__(self):"},{"line_number":250,"context_line":"        self.min_agents \u003d cfg.CONF.min_l3_agents_per_router"},{"line_number":251,"context_line":"        self.max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_4854bcfe","line":249,"updated":"2014-09-03 20:21:43.000000000","message":"We need to call super().__init__().\nWithout it, this __init__ stops a chain of super().__init__() and it prevents from calling __init__ in the parent class.","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bb55d61f47514fbfcf2209dd2dc33962760ca52d","unresolved":false,"context_lines":[{"line_number":246,"context_line":""},{"line_number":247,"context_line":"class HASchedulerMixin(object):"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def __init__(self):"},{"line_number":250,"context_line":"        self.min_agents \u003d cfg.CONF.min_l3_agents_per_router"},{"line_number":251,"context_line":"        self.max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_bef722d2","line":249,"in_reply_to":"fa98f980_4854bcfe","updated":"2014-09-03 21:44:17.000000000","message":"+1.  This is true even though this class\u0027s parent is object.  I wasn\u0027t sure so I tried it.  In the case of a non-linear hierarchy with more than one such base class then the chain will get broken.","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"6775ce422906ec320eceeec64255560df96dd4ca","unresolved":false,"context_lines":[{"line_number":246,"context_line":""},{"line_number":247,"context_line":"class HASchedulerMixin(object):"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def __init__(self):"},{"line_number":250,"context_line":"        self.min_agents \u003d cfg.CONF.min_l3_agents_per_router"},{"line_number":251,"context_line":"        self.max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_85944245","line":249,"in_reply_to":"fa98f980_bef722d2","updated":"2014-09-08 23:46:46.000000000","message":"Done","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6135ccc4a864ef83fc6419cee5df92bef5287414","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        self.max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def get_num_of_agents(self, candidates):"},{"line_number":254,"context_line":"        return (min(self.max_agents, len(candidates)) if self.max_agents"},{"line_number":255,"context_line":"                else len(candidates))"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    def enough_candidates_for_ha(self, candidates):"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_e88d707d","line":254,"updated":"2014-09-03 20:21:43.000000000","message":"When does max_agents becomes 0 or None? max_agents\u003d\u003d0 seems not documented.","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bb55d61f47514fbfcf2209dd2dc33962760ca52d","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        self.max_agents \u003d cfg.CONF.max_l3_agents_per_router"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def get_num_of_agents(self, candidates):"},{"line_number":254,"context_line":"        return (min(self.max_agents, len(candidates)) if self.max_agents"},{"line_number":255,"context_line":"                else len(candidates))"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    def enough_candidates_for_ha(self, candidates):"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_7ee05afa","line":254,"in_reply_to":"fa98f980_e88d707d","updated":"2014-09-03 21:44:17.000000000","message":"It is documented in the patch on which this one depends in neutron.conf.","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bb55d61f47514fbfcf2209dd2dc33962760ca52d","unresolved":false,"context_lines":[{"line_number":262,"context_line":"        return True"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def create_ha_router_binding(self, plugin, context, router_id, tenant_id,"},{"line_number":265,"context_line":"                                 agent):"},{"line_number":266,"context_line":"        \"\"\"Creates and bind a new HA port for this agent.\"\"\""},{"line_number":267,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"},{"line_number":268,"context_line":"        port_binding \u003d plugin.add_ha_port(context, router_id,"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_7ea21a4c","line":265,"updated":"2014-09-03 21:44:17.000000000","message":"Do any of these operations need to be wrapped in a transaction?","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"6775ce422906ec320eceeec64255560df96dd4ca","unresolved":false,"context_lines":[{"line_number":262,"context_line":"        return True"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def create_ha_router_binding(self, plugin, context, router_id, tenant_id,"},{"line_number":265,"context_line":"                                 agent):"},{"line_number":266,"context_line":"        \"\"\"Creates and bind a new HA port for this agent.\"\"\""},{"line_number":267,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"},{"line_number":268,"context_line":"        port_binding \u003d plugin.add_ha_port(context, router_id,"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_2b444773","line":265,"in_reply_to":"fa98f980_7ea21a4c","updated":"2014-09-08 23:46:46.000000000","message":"All of these operations use core plugin operation so the transactions (rollback) are managed locally in the models  class.","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bb55d61f47514fbfcf2209dd2dc33962760ca52d","unresolved":false,"context_lines":[{"line_number":363,"context_line":""},{"line_number":364,"context_line":"        self.bind_router_to_agents(plugin, context, router_id, chosen_agents)"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"        return chosen_agents[-1]"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"class LeastRoutersScheduler(L3SchedulerMixin,"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_59f010fe","line":366,"updated":"2014-09-03 21:44:17.000000000","message":"It seems funny to return a single agent from ha_bind_router.  Could you return chosen_agents and let the caller \"_schedule_router\" pick one to return from _schedule_router if it needs?","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"6775ce422906ec320eceeec64255560df96dd4ca","unresolved":false,"context_lines":[{"line_number":363,"context_line":""},{"line_number":364,"context_line":"        self.bind_router_to_agents(plugin, context, router_id, chosen_agents)"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"        return chosen_agents[-1]"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"class LeastRoutersScheduler(L3SchedulerMixin,"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_c5c3aa36","line":366,"in_reply_to":"fa98f980_59f010fe","updated":"2014-09-08 23:46:46.000000000","message":"Done","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3c5018d842b2feed290c4857d9cc3e78bd31d0a5","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            context, plugin, router_ids)"},{"line_number":132,"context_line":"        if not unscheduled_routers:"},{"line_number":133,"context_line":"            if utils.is_extension_supported("},{"line_number":134,"context_line":"                    plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":135,"context_line":"                return self.ha_increase_scheduled_routers("},{"line_number":136,"context_line":"                    plugin, context, l3_agent)"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_b05df87b","line":134,"updated":"2014-09-09 12:05:29.000000000","message":"is it enforced somewhere that if l3 ha is supported then l3 agent scheduler is properly configured (to be HA)?","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a01c8eaf197bed1d467add4cdb4bb70f21aab7f2","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            context, plugin, router_ids)"},{"line_number":132,"context_line":"        if not unscheduled_routers:"},{"line_number":133,"context_line":"            if utils.is_extension_supported("},{"line_number":134,"context_line":"                    plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":135,"context_line":"                return self.ha_increase_scheduled_routers("},{"line_number":136,"context_line":"                    plugin, context, l3_agent)"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_5f7937fb","line":134,"in_reply_to":"fa98f980_b05df87b","updated":"2014-09-09 17:50:39.000000000","message":"At first we added a third new scheduler (So you had chance, least router, and HA) but now you can just choose chance or least router and both legacy and HA routers will be scheduled properly.","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3c5018d842b2feed290c4857d9cc3e78bd31d0a5","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        if not unscheduled_routers:"},{"line_number":133,"context_line":"            if utils.is_extension_supported("},{"line_number":134,"context_line":"                    plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":135,"context_line":"                return self.ha_increase_scheduled_routers("},{"line_number":136,"context_line":"                    plugin, context, l3_agent)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        target_routers \u003d self.get_routers_can_schedule("}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_90b63489","line":135,"updated":"2014-09-09 12:05:29.000000000","message":"was confused with ha_increase_scheduled_routers() name. imho something like try_schedule_routers_on_additional_agent will be more clear","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a01c8eaf197bed1d467add4cdb4bb70f21aab7f2","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        if not unscheduled_routers:"},{"line_number":133,"context_line":"            if utils.is_extension_supported("},{"line_number":134,"context_line":"                    plugin, constants.L3_HA_MODE_EXT_ALIAS):"},{"line_number":135,"context_line":"                return self.ha_increase_scheduled_routers("},{"line_number":136,"context_line":"                    plugin, context, l3_agent)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        target_routers \u003d self.get_routers_can_schedule("}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_94ec612b","line":135,"in_reply_to":"fa98f980_90b63489","updated":"2014-09-09 17:50:39.000000000","message":"Done","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3c5018d842b2feed290c4857d9cc3e78bd31d0a5","unresolved":false,"context_lines":[{"line_number":248,"context_line":"        pass"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"class HASchedulerMixin(object):"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def __init__(self):"},{"line_number":254,"context_line":"        super(HASchedulerMixin, self).__init__()"}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_f9f20b9a","line":251,"updated":"2014-09-09 12:05:29.000000000","message":"why not inherit form L3SchedulerMixin? The latter seems relying on some methods from this class","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a01c8eaf197bed1d467add4cdb4bb70f21aab7f2","unresolved":false,"context_lines":[{"line_number":248,"context_line":"        pass"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"class HASchedulerMixin(object):"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def __init__(self):"},{"line_number":254,"context_line":"        super(HASchedulerMixin, self).__init__()"}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_25c53d3d","line":251,"in_reply_to":"fa98f980_f9f20b9a","updated":"2014-09-09 17:50:39.000000000","message":"I\u0027ve decided to flatten the inheritance chain and remove all mixins. We can easily revert to this patchset, but I think it\u0027s simpler overall. Please let me know what you think.","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3c5018d842b2feed290c4857d9cc3e78bd31d0a5","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        port_binding.l3_agent_id \u003d agent[\u0027id\u0027]"},{"line_number":276,"context_line":"        self.bind_router(context, router_id, agent)"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"    def ha_increase_scheduled_routers(self, plugin, context, agent):"},{"line_number":279,"context_line":"        \"\"\"Bind already scheduled routers to the agent."},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"        Retrieve the number of agents per router and check if the router has"}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_d00b5c29","line":278,"updated":"2014-09-09 12:05:29.000000000","message":"please see my previous comment on the naming","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a01c8eaf197bed1d467add4cdb4bb70f21aab7f2","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        port_binding.l3_agent_id \u003d agent[\u0027id\u0027]"},{"line_number":276,"context_line":"        self.bind_router(context, router_id, agent)"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"    def ha_increase_scheduled_routers(self, plugin, context, agent):"},{"line_number":279,"context_line":"        \"\"\"Bind already scheduled routers to the agent."},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"        Retrieve the number of agents per router and check if the router has"}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_85dd0917","line":278,"in_reply_to":"fa98f980_d00b5c29","updated":"2014-09-09 17:50:39.000000000","message":"Done","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3c5018d842b2feed290c4857d9cc3e78bd31d0a5","unresolved":false,"context_lines":[{"line_number":334,"context_line":"        return chosen_agents"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"class ChanceScheduler(L3SchedulerMixin,"},{"line_number":338,"context_line":"                      HAChanceScheduler):"},{"line_number":339,"context_line":"    \"\"\"Randomly allocate an L3 agent for a router.\"\"\""},{"line_number":340,"context_line":""}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_99e73fe4","line":337,"updated":"2014-09-09 12:05:29.000000000","message":"Why inheriting from HAChanceScheduler, shouldn\u0027t these be two separate schedulers? Also it contradicts with the below description.","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a01c8eaf197bed1d467add4cdb4bb70f21aab7f2","unresolved":false,"context_lines":[{"line_number":334,"context_line":"        return chosen_agents"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"class ChanceScheduler(L3SchedulerMixin,"},{"line_number":338,"context_line":"                      HAChanceScheduler):"},{"line_number":339,"context_line":"    \"\"\"Randomly allocate an L3 agent for a router.\"\"\""},{"line_number":340,"context_line":""}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_25cc5d61","line":337,"in_reply_to":"fa98f980_99e73fe4","updated":"2014-09-09 17:50:39.000000000","message":"As I wrote above we\u0027re keeping the number of schedulers to 2 total, and both schedulers will be able to handle legacy, distributed, and HA routers.","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3c5018d842b2feed290c4857d9cc3e78bd31d0a5","unresolved":false,"context_lines":[{"line_number":371,"context_line":""},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"class LeastRoutersScheduler(L3SchedulerMixin,"},{"line_number":374,"context_line":"                            HALeastRoutersScheduler):"},{"line_number":375,"context_line":"    \"\"\"Allocate to a L3 agent with the least number of routers bound.\"\"\""},{"line_number":376,"context_line":""},{"line_number":377,"context_line":"    def schedule(self, plugin, context, router_id,"}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_591237b5","line":374,"updated":"2014-09-09 12:05:29.000000000","message":"ditto","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a01c8eaf197bed1d467add4cdb4bb70f21aab7f2","unresolved":false,"context_lines":[{"line_number":371,"context_line":""},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"class LeastRoutersScheduler(L3SchedulerMixin,"},{"line_number":374,"context_line":"                            HALeastRoutersScheduler):"},{"line_number":375,"context_line":"    \"\"\"Allocate to a L3 agent with the least number of routers bound.\"\"\""},{"line_number":376,"context_line":""},{"line_number":377,"context_line":"    def schedule(self, plugin, context, router_id,"}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_65d665f3","line":374,"in_reply_to":"fa98f980_591237b5","updated":"2014-09-09 17:50:39.000000000","message":"Done","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d7dc3475d1faa1029acab8061e0e2457bdb447a","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":"cfg.CONF.register_opts(l3_hamode_db.L3_HA_OPTS)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_daa8b979","line":35,"updated":"2014-09-10 11:44:29.000000000","message":"Saw comments on this in PS47 but still not sure why registering here while it was already registered in l3_hamode_db which is imported. Seems this should be removed. Also wondering why no failures in unit tests regarding duplicate opts..","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5087d914a148ea1b9a94800b2d6e1a50770d9816","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":"cfg.CONF.register_opts(l3_hamode_db.L3_HA_OPTS)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_ed34e2fc","line":35,"in_reply_to":"fa98f980_daa8b979","updated":"2014-09-10 13:23:04.000000000","message":"I noticed this some time ago and removed it, then the NEC plugin wouldn\u0027t start, so I put this back.","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1fc6e40385d7feb9dc9c77d33c112d3071f44b66","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":"cfg.CONF.register_opts(l3_hamode_db.L3_HA_OPTS)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_b48f7e22","line":35,"in_reply_to":"fa98f980_ed34e2fc","updated":"2014-09-10 16:02:24.000000000","message":"that\u0027s really weird.. once l3_hamode_db is imported at #29 these options are already registered","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d7dc3475d1faa1029acab8061e0e2457bdb447a","unresolved":false,"context_lines":[{"line_number":188,"context_line":"    def bind_routers(self, context, plugin, routers, l3_agent):"},{"line_number":189,"context_line":"        for router in routers:"},{"line_number":190,"context_line":"            is_distributed \u003d router.get(\u0027distributed\u0027, False)"},{"line_number":191,"context_line":"            is_ha \u003d router.get(\u0027ha\u0027)"},{"line_number":192,"context_line":"            if is_ha and not is_distributed:"},{"line_number":193,"context_line":"                if not self.router_has_binding(context, router[\u0027id\u0027],"},{"line_number":194,"context_line":"                                               l3_agent.id):"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_daed19b9","line":191,"updated":"2014-09-10 11:44:29.000000000","message":"nit: router.get(\u0027ha\u0027, False) for consistency","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5087d914a148ea1b9a94800b2d6e1a50770d9816","unresolved":false,"context_lines":[{"line_number":188,"context_line":"    def bind_routers(self, context, plugin, routers, l3_agent):"},{"line_number":189,"context_line":"        for router in routers:"},{"line_number":190,"context_line":"            is_distributed \u003d router.get(\u0027distributed\u0027, False)"},{"line_number":191,"context_line":"            is_ha \u003d router.get(\u0027ha\u0027)"},{"line_number":192,"context_line":"            if is_ha and not is_distributed:"},{"line_number":193,"context_line":"                if not self.router_has_binding(context, router[\u0027id\u0027],"},{"line_number":194,"context_line":"                                               l3_agent.id):"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_d026d5b9","line":191,"in_reply_to":"fa98f980_daed19b9","updated":"2014-09-10 13:23:04.000000000","message":"I don\u0027t know why this is the case with distributed routers, seems unneeded.","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d7dc3475d1faa1029acab8061e0e2457bdb447a","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        if sync_router.get(\u0027distributed\u0027, False):"},{"line_number":235,"context_line":"            for chosen_agent in candidates:"},{"line_number":236,"context_line":"                self.bind_router(context, router_id, chosen_agent)"},{"line_number":237,"context_line":"        elif sync_router.get(\u0027ha\u0027, False):"},{"line_number":238,"context_line":"            chosen_agents \u003d self.bind_ha_router(plugin, context,"},{"line_number":239,"context_line":"                                                router_id, candidates)"},{"line_number":240,"context_line":"            if not chosen_agents:"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_951b621b","line":237,"updated":"2014-09-10 11:44:29.000000000","message":"Better to use constant instead of \u0027ha\u0027. I see this is the same for \u0027distributed\u0027 so probably should be a separate cleanup","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d7dc3475d1faa1029acab8061e0e2457bdb447a","unresolved":false,"context_lines":[{"line_number":239,"context_line":"                                                router_id, candidates)"},{"line_number":240,"context_line":"            if not chosen_agents:"},{"line_number":241,"context_line":"                return"},{"line_number":242,"context_line":"            chosen_agent \u003d chosen_agents[-1]"},{"line_number":243,"context_line":"        else:"},{"line_number":244,"context_line":"            chosen_agent \u003d self._choose_router_agent("},{"line_number":245,"context_line":"                plugin, context, candidates)"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_1593f24f","line":242,"updated":"2014-09-10 11:44:29.000000000","message":"Why returning just one agent? Isn\u0027t it better to update calling logic to handle list result?","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5087d914a148ea1b9a94800b2d6e1a50770d9816","unresolved":false,"context_lines":[{"line_number":239,"context_line":"                                                router_id, candidates)"},{"line_number":240,"context_line":"            if not chosen_agents:"},{"line_number":241,"context_line":"                return"},{"line_number":242,"context_line":"            chosen_agent \u003d chosen_agents[-1]"},{"line_number":243,"context_line":"        else:"},{"line_number":244,"context_line":"            chosen_agent \u003d self._choose_router_agent("},{"line_number":245,"context_line":"                plugin, context, candidates)"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_a3010908","line":242,"in_reply_to":"fa98f980_1593f24f","updated":"2014-09-10 13:23:04.000000000","message":"It\u0027s possible. If you follow the call chain (Quite a long chain!) then creations and updates of routers don\u0027t actually use the return value of the scheduler. The only place it\u0027s used is when rescheduling a router due to Kevin\u0027s new code that reschedules routers from dead agents, but that is disabled for HA routers anyway.\n\nWith that in mind I\u0027m not confident in making this change at this time. It would require making (Small) changes in a lot of places for no functional gain.","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"5e9f6f67310bd6a878ca5a7f09c81fa8e1e15535","unresolved":false,"context_lines":[{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    @abc.abstractmethod"},{"line_number":260,"context_line":"    def bind_ha_router(self, plugin, context, router_id, candidates):"},{"line_number":261,"context_line":"        \"\"\"Choose a HA router to agents based on a specific policy.\"\"\""},{"line_number":262,"context_line":"        pass"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def get_num_of_agents_for_ha(self, candidates_count):"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_0cc04fdf","line":261,"updated":"2014-09-10 08:25:50.000000000","message":"s/Choose/Bind/","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5087d914a148ea1b9a94800b2d6e1a50770d9816","unresolved":false,"context_lines":[{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    @abc.abstractmethod"},{"line_number":260,"context_line":"    def bind_ha_router(self, plugin, context, router_id, candidates):"},{"line_number":261,"context_line":"        \"\"\"Choose a HA router to agents based on a specific policy.\"\"\""},{"line_number":262,"context_line":"        pass"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def get_num_of_agents_for_ha(self, candidates_count):"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_603f1ad7","line":261,"in_reply_to":"fa98f980_0cc04fdf","updated":"2014-09-10 13:23:04.000000000","message":"Done","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"5e9f6f67310bd6a878ca5a7f09c81fa8e1e15535","unresolved":false,"context_lines":[{"line_number":259,"context_line":"    @abc.abstractmethod"},{"line_number":260,"context_line":"    def bind_ha_router(self, plugin, context, router_id, candidates):"},{"line_number":261,"context_line":"        \"\"\"Choose a HA router to agents based on a specific policy.\"\"\""},{"line_number":262,"context_line":"        pass"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def get_num_of_agents_for_ha(self, candidates_count):"},{"line_number":265,"context_line":"        return (min(self.max_ha_agents, candidates_count) if self.max_ha_agents"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_ecbceb6e","line":262,"updated":"2014-09-10 08:25:50.000000000","message":"bind_ha_router is defined at L.324 in the same class. It seems unnecessary and the docstring needs to be moved around L.324.","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5087d914a148ea1b9a94800b2d6e1a50770d9816","unresolved":false,"context_lines":[{"line_number":259,"context_line":"    @abc.abstractmethod"},{"line_number":260,"context_line":"    def bind_ha_router(self, plugin, context, router_id, candidates):"},{"line_number":261,"context_line":"        \"\"\"Choose a HA router to agents based on a specific policy.\"\"\""},{"line_number":262,"context_line":"        pass"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def get_num_of_agents_for_ha(self, candidates_count):"},{"line_number":265,"context_line":"        return (min(self.max_ha_agents, candidates_count) if self.max_ha_agents"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_a02022b1","line":262,"in_reply_to":"fa98f980_ecbceb6e","updated":"2014-09-10 13:23:04.000000000","message":"Oops...","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d7dc3475d1faa1029acab8061e0e2457bdb447a","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        \"\"\"Choose a HA router to agents based on a specific policy.\"\"\""},{"line_number":262,"context_line":"        pass"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def get_num_of_agents_for_ha(self, candidates_count):"},{"line_number":265,"context_line":"        return (min(self.max_ha_agents, candidates_count) if self.max_ha_agents"},{"line_number":266,"context_line":"                else candidates_count)"},{"line_number":267,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_55481a87","line":264,"updated":"2014-09-10 11:44:29.000000000","message":"I think it is more safe to check self.enough_candidates_for_ha(candidates) here rather then at #325","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5087d914a148ea1b9a94800b2d6e1a50770d9816","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        \"\"\"Choose a HA router to agents based on a specific policy.\"\"\""},{"line_number":262,"context_line":"        pass"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def get_num_of_agents_for_ha(self, candidates_count):"},{"line_number":265,"context_line":"        return (min(self.max_ha_agents, candidates_count) if self.max_ha_agents"},{"line_number":266,"context_line":"                else candidates_count)"},{"line_number":267,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_7068c921","line":264,"in_reply_to":"fa98f980_55481a87","updated":"2014-09-10 13:23:04.000000000","message":"But then get_num_of_agents_for_ha becomes:\n\nget_num_of_agents_for_ha_and_validate_minimum,\n\nWhich is kind of messy. The function should probably only do one thing?","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1fc6e40385d7feb9dc9c77d33c112d3071f44b66","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        \"\"\"Choose a HA router to agents based on a specific policy.\"\"\""},{"line_number":262,"context_line":"        pass"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def get_num_of_agents_for_ha(self, candidates_count):"},{"line_number":265,"context_line":"        return (min(self.max_ha_agents, candidates_count) if self.max_ha_agents"},{"line_number":266,"context_line":"                else candidates_count)"},{"line_number":267,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_94727a0f","line":264,"in_reply_to":"fa98f980_7068c921","updated":"2014-09-10 16:02:24.000000000","message":"Why don\u0027t you name bind_ha_router as validate_minimum_and_bind_ha_router? :P\n\nActually I was confused when reviewing _choose_router_agents_for_ha at #344: it took me time to verify that enough_candidates_for_ha() was performed in call chain.","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d7dc3475d1faa1029acab8061e0e2457bdb447a","unresolved":false,"context_lines":[{"line_number":290,"context_line":"        \"\"\""},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"        routers_agents \u003d plugin.get_ha_routers_l3_agents_count(context,"},{"line_number":293,"context_line":"                                                               agent[\u0027id\u0027])"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"        scheduled \u003d False"},{"line_number":296,"context_line":"        admin_ctx \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_9b59d35d","line":293,"updated":"2014-09-10 11:44:29.000000000","message":"Please specify excluded_agent_id\u003dagent[\u0027id\u0027] to be more clear here","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5087d914a148ea1b9a94800b2d6e1a50770d9816","unresolved":false,"context_lines":[{"line_number":290,"context_line":"        \"\"\""},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"        routers_agents \u003d plugin.get_ha_routers_l3_agents_count(context,"},{"line_number":293,"context_line":"                                                               agent[\u0027id\u0027])"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"        scheduled \u003d False"},{"line_number":296,"context_line":"        admin_ctx \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_f063d93e","line":293,"in_reply_to":"fa98f980_9b59d35d","updated":"2014-09-10 13:23:04.000000000","message":"Done","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d7dc3475d1faa1029acab8061e0e2457bdb447a","unresolved":false,"context_lines":[{"line_number":299,"context_line":"            # haven\u0027t reached the max"},{"line_number":300,"context_line":"            binding_required \u003d ("},{"line_number":301,"context_line":"                (not self.max_ha_agents or agents \u003c self.max_ha_agents) and"},{"line_number":302,"context_line":"                not self.router_has_binding(admin_ctx, router_id, agent.id))"},{"line_number":303,"context_line":"            if binding_required:"},{"line_number":304,"context_line":"                self.create_ha_router_binding(plugin, admin_ctx,"},{"line_number":305,"context_line":"                                              router_id, tenant_id,"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_ad501ad5","line":302,"updated":"2014-09-10 11:44:29.000000000","message":"wondering if you even need this excluded_agent_id in get_ha_routers_l3_agents_count(). Seems this condition will work  without it. I might be missing something though","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1fc6e40385d7feb9dc9c77d33c112d3071f44b66","unresolved":false,"context_lines":[{"line_number":299,"context_line":"            # haven\u0027t reached the max"},{"line_number":300,"context_line":"            binding_required \u003d ("},{"line_number":301,"context_line":"                (not self.max_ha_agents or agents \u003c self.max_ha_agents) and"},{"line_number":302,"context_line":"                not self.router_has_binding(admin_ctx, router_id, agent.id))"},{"line_number":303,"context_line":"            if binding_required:"},{"line_number":304,"context_line":"                self.create_ha_router_binding(plugin, admin_ctx,"},{"line_number":305,"context_line":"                                              router_id, tenant_id,"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_744ef6c2","line":302,"in_reply_to":"fa98f980_a3ed89b9","updated":"2014-09-10 16:02:24.000000000","message":"I\u0027m glad that we got rid of this confusing parameter:)","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5087d914a148ea1b9a94800b2d6e1a50770d9816","unresolved":false,"context_lines":[{"line_number":299,"context_line":"            # haven\u0027t reached the max"},{"line_number":300,"context_line":"            binding_required \u003d ("},{"line_number":301,"context_line":"                (not self.max_ha_agents or agents \u003c self.max_ha_agents) and"},{"line_number":302,"context_line":"                not self.router_has_binding(admin_ctx, router_id, agent.id))"},{"line_number":303,"context_line":"            if binding_required:"},{"line_number":304,"context_line":"                self.create_ha_router_binding(plugin, admin_ctx,"},{"line_number":305,"context_line":"                                              router_id, tenant_id,"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_a3ed89b9","line":302,"in_reply_to":"fa98f980_ad501ad5","updated":"2014-09-10 13:23:04.000000000","message":"I gave this a bit of thought and talked to Sylvain and I\u0027ll remove it. We couldn\u0027t find a flow where the exclusion changes anything (I added the router_has_binding check pretty recently which changes the game a bit).","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"05e89d6c3c9194bb21be2ca2374222c65002f299","unresolved":false,"context_lines":[{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def create_ha_router_binding(self, plugin, context, router_id, tenant_id,"},{"line_number":271,"context_line":"                                 agent):"},{"line_number":272,"context_line":"        \"\"\"Creates and bind a new HA port for this agent.\"\"\""},{"line_number":273,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"},{"line_number":274,"context_line":"        port_binding \u003d plugin.add_ha_port(context.elevated(), router_id,"},{"line_number":275,"context_line":"                                          ha_network.network.id, tenant_id)"}],"source_content_type":"text/x-python","patch_set":51,"id":"fa98f980_88008b03","line":272,"updated":"2014-09-11 03:34:17.000000000","message":"Nit:  Creates and binds","commit_id":"1a2e535162845686422b2cb362e770318a94f7f4"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fe426d19cae3f15224428de5387dbd8c4b8c6473","unresolved":false,"context_lines":[{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def create_ha_router_binding(self, plugin, context, router_id, tenant_id,"},{"line_number":271,"context_line":"                                 agent):"},{"line_number":272,"context_line":"        \"\"\"Creates and bind a new HA port for this agent.\"\"\""},{"line_number":273,"context_line":"        ha_network \u003d plugin.get_ha_network(context, tenant_id)"},{"line_number":274,"context_line":"        port_binding \u003d plugin.add_ha_port(context.elevated(), router_id,"},{"line_number":275,"context_line":"                                          ha_network.network.id, tenant_id)"}],"source_content_type":"text/x-python","patch_set":51,"id":"fa98f980_abae102c","line":272,"in_reply_to":"fa98f980_88008b03","updated":"2014-09-11 19:11:55.000000000","message":"Done","commit_id":"1a2e535162845686422b2cb362e770318a94f7f4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"05e89d6c3c9194bb21be2ca2374222c65002f299","unresolved":false,"context_lines":[{"line_number":290,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":291,"context_line":"        for router_id, tenant_id, agents in routers_agents:"},{"line_number":292,"context_line":"            # If the router is unbound, and max_agents is unlimited or we"},{"line_number":293,"context_line":"            # haven\u0027t reached the max"},{"line_number":294,"context_line":"            binding_required \u003d ("},{"line_number":295,"context_line":"                (not self.max_ha_agents or agents \u003c self.max_ha_agents) and"},{"line_number":296,"context_line":"                not self.router_has_binding(admin_ctx, router_id, agent.id))"}],"source_content_type":"text/x-python","patch_set":51,"id":"fa98f980_af663c27","line":293,"updated":"2014-09-11 03:34:17.000000000","message":"Here, you might consider some self-documenting temporary variables instead of a comment which could get out of sync with the code.\n\n router_is_unbound \u003d ...\n max_agents_not_reached \u003d ...","commit_id":"1a2e535162845686422b2cb362e770318a94f7f4"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fe426d19cae3f15224428de5387dbd8c4b8c6473","unresolved":false,"context_lines":[{"line_number":290,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":291,"context_line":"        for router_id, tenant_id, agents in routers_agents:"},{"line_number":292,"context_line":"            # If the router is unbound, and max_agents is unlimited or we"},{"line_number":293,"context_line":"            # haven\u0027t reached the max"},{"line_number":294,"context_line":"            binding_required \u003d ("},{"line_number":295,"context_line":"                (not self.max_ha_agents or agents \u003c self.max_ha_agents) and"},{"line_number":296,"context_line":"                not self.router_has_binding(admin_ctx, router_id, agent.id))"}],"source_content_type":"text/x-python","patch_set":51,"id":"fa98f980_a63f25b3","line":293,"in_reply_to":"fa98f980_af663c27","updated":"2014-09-11 19:11:55.000000000","message":"Done","commit_id":"1a2e535162845686422b2cb362e770318a94f7f4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"05e89d6c3c9194bb21be2ca2374222c65002f299","unresolved":false,"context_lines":[{"line_number":347,"context_line":""},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"class LeastRoutersScheduler(L3Scheduler):"},{"line_number":350,"context_line":"    \"\"\"Allocate to a L3 agent with the least number of routers bound.\"\"\""},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"    def schedule(self, plugin, context, router_id,"},{"line_number":353,"context_line":"                 candidates\u003dNone, hints\u003dNone):"}],"source_content_type":"text/x-python","patch_set":51,"id":"fa98f980_0b5ad529","line":350,"updated":"2014-09-11 03:34:17.000000000","message":"Don\u0027t change this.  First, it is out of scope.  Second, some like me prefer it the way it was.","commit_id":"1a2e535162845686422b2cb362e770318a94f7f4"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fe426d19cae3f15224428de5387dbd8c4b8c6473","unresolved":false,"context_lines":[{"line_number":347,"context_line":""},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"class LeastRoutersScheduler(L3Scheduler):"},{"line_number":350,"context_line":"    \"\"\"Allocate to a L3 agent with the least number of routers bound.\"\"\""},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"    def schedule(self, plugin, context, router_id,"},{"line_number":353,"context_line":"                 candidates\u003dNone, hints\u003dNone):"}],"source_content_type":"text/x-python","patch_set":51,"id":"fa98f980_6b70a8dc","line":350,"in_reply_to":"fa98f980_0b5ad529","updated":"2014-09-11 19:11:55.000000000","message":"Done","commit_id":"1a2e535162845686422b2cb362e770318a94f7f4"}],"neutron/services/l3_router/l3_router_plugin.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3c5018d842b2feed290c4857d9cc3e78bd31d0a5","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                     l3_dvrscheduler_db.L3_DVRsch_db_mixin,"},{"line_number":40,"context_line":"                     l3_hamode_db.L3_HA_NAT_db_mixin,"},{"line_number":41,"context_line":"                     l3_hascheduler_db.L3_HA_scheduler_db_mixin,"},{"line_number":42,"context_line":"                     l3_agentschedulers_db.L3AgentSchedulerDbMixin):"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    \"\"\"Implementation of the Neutron L3 Router Service Plugin."},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_702f103f","line":42,"updated":"2014-09-09 12:05:29.000000000","message":"can be removed as now it\u0027s part of L3_HA_scheduler_db_mixin","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a01c8eaf197bed1d467add4cdb4bb70f21aab7f2","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                     l3_dvrscheduler_db.L3_DVRsch_db_mixin,"},{"line_number":40,"context_line":"                     l3_hamode_db.L3_HA_NAT_db_mixin,"},{"line_number":41,"context_line":"                     l3_hascheduler_db.L3_HA_scheduler_db_mixin,"},{"line_number":42,"context_line":"                     l3_agentschedulers_db.L3AgentSchedulerDbMixin):"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    \"\"\"Implementation of the Neutron L3 Router Service Plugin."},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":48,"id":"fa98f980_d8a9b725","line":42,"in_reply_to":"fa98f980_702f103f","updated":"2014-09-09 17:50:39.000000000","message":"True, thanks.","commit_id":"31a48d6e1c3d98f74b06a2ec6d61058230bc6867"}],"neutron/tests/unit/test_l3_schedulers.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ba6959cbdce78899b5ec2edd62809b81bb178e0","unresolved":false,"context_lines":[{"line_number":30,"context_line":"from neutron.db import l3_agentschedulers_db"},{"line_number":31,"context_line":"from neutron.extensions import l3 as ext_l3"},{"line_number":32,"context_line":"from neutron import manager"},{"line_number":33,"context_line":"from neutron.manager import NeutronManager"},{"line_number":34,"context_line":"from neutron.openstack.common import importutils"},{"line_number":35,"context_line":"from neutron.openstack.common import timeutils"},{"line_number":36,"context_line":"from neutron.tests.unit import test_db_plugin"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BxNk%3D","line":33,"updated":"2014-01-22 10:41:01.000000000","message":"please use module level imports (http://docs.openstack.org/developer/hacking/)","commit_id":"b4e5536ee843b484199aa10b04924c0a48dd7b7e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ba6959cbdce78899b5ec2edd62809b81bb178e0","unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        router_scheduler \u003d (\u0027neutron.scheduler.l3_agent_scheduler.\u0027"},{"line_number":231,"context_line":"                            \u0027HAChanceScheduler\u0027)"},{"line_number":232,"context_line":"        self.router_scheduler \u003d importutils.import_object(router_scheduler)"},{"line_number":233,"context_line":"        plugin \u003d NeutronManager.get_plugin()"},{"line_number":234,"context_line":"        plugin.router_scheduler \u003d importutils.import_object(router_scheduler)"},{"line_number":235,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BxL4%3D","line":232,"updated":"2014-01-22 10:41:01.000000000","message":"not used","commit_id":"b4e5536ee843b484199aa10b04924c0a48dd7b7e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ba6959cbdce78899b5ec2edd62809b81bb178e0","unresolved":false,"context_lines":[{"line_number":231,"context_line":"                            \u0027HAChanceScheduler\u0027)"},{"line_number":232,"context_line":"        self.router_scheduler \u003d importutils.import_object(router_scheduler)"},{"line_number":233,"context_line":"        plugin \u003d NeutronManager.get_plugin()"},{"line_number":234,"context_line":"        plugin.router_scheduler \u003d importutils.import_object(router_scheduler)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"        self._register_l3_agents(plugin\u003dplugin)"},{"line_number":237,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BxLs%3D","line":234,"updated":"2014-01-22 10:41:01.000000000","message":"why importing twice?","commit_id":"b4e5536ee843b484199aa10b04924c0a48dd7b7e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ba6959cbdce78899b5ec2edd62809b81bb178e0","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        self._register_l3_agents(plugin\u003dplugin)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    def tearDown(self):"},{"line_number":239,"context_line":"        cfg.CONF.set_override(\u0027enable_l3_ha\u0027, False)"},{"line_number":240,"context_line":"        super(L3AgentHASchedulerTestCase, self).tearDown()"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def test_scheduler_with_ha_enabled(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BxKU%3D","line":239,"updated":"2014-01-22 10:41:01.000000000","message":"test_db_plugin.NeutronDbPluginV2TestCase already has  cfg.CONF.reset() in tearDown()","commit_id":"b4e5536ee843b484199aa10b04924c0a48dd7b7e"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"b2414e33d4a50dd3d841319cc5af52e8281c66ee","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        with self.router() as r1:"},{"line_number":247,"context_line":"            agents \u003d self.get_l3_agents_hosting_routers("},{"line_number":248,"context_line":"                self.adminContext, [r1[\u0027router\u0027][\u0027id\u0027]],"},{"line_number":249,"context_line":"                admin_state_up\u003dTrue)"},{"line_number":250,"context_line":"            self.assertEqual(len(agents), 0)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        with self.subnet() as subnet:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BcCQ%3D","line":249,"updated":"2014-01-26 15:12:08.000000000","message":"I might be absolutely wrong here, but shouldn\u0027t the len of agents at this point be equal to 1, and not 0?","commit_id":"093e8116ba86cd9fc7934ad228b286b31ef535c8"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9de533dde228c0c1e51f6610ca70b60966adb410","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        self.notify_ha_int_p.start()"},{"line_number":242,"context_line":"        super(L3AgentHASchedulerTestCase, self).tearDown()"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def test_scheduler_with_ha_enabled(self):"},{"line_number":245,"context_line":"        cfg.CONF.set_override(\u0027l3_agents_per_router\u0027, 2)"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"        with self.router() as r1:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F9qY8%3D","line":244,"updated":"2014-02-05 08:50:19.000000000","message":"you may also consider adding a test case with ha enabled but not enough agents","commit_id":"4ab5b84fac2a168ac855e736700890edf32d21bc"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9de533dde228c0c1e51f6610ca70b60966adb410","unresolved":false,"context_lines":[{"line_number":242,"context_line":"        super(L3AgentHASchedulerTestCase, self).tearDown()"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def test_scheduler_with_ha_enabled(self):"},{"line_number":245,"context_line":"        cfg.CONF.set_override(\u0027l3_agents_per_router\u0027, 2)"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"        with self.router() as r1:"},{"line_number":248,"context_line":"            agents \u003d self.get_l3_agents_hosting_routers("}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F9qZY%3D","line":245,"updated":"2014-02-05 08:50:19.000000000","message":"seems it\u0027s already done in L3HABaseForIntTests.setUp()","commit_id":"4ab5b84fac2a168ac855e736700890edf32d21bc"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"630613d873c34ffba4ccc5c199a89f0b8ade3508","unresolved":false,"context_lines":[{"line_number":217,"context_line":""},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"class L3AgentHASchedulerTestCase(l3_agentschedulers_db.L3AgentSchedulerDbMixin,"},{"line_number":220,"context_line":"                                 db_base_plugin_v2.CommonDbMixin,"},{"line_number":221,"context_line":"                                 l3_hamode_db.L3_HA_NAT_db_mixin,"},{"line_number":222,"context_line":"                                 test_l3_plugin.L3NatTestCaseMixin,"},{"line_number":223,"context_line":"                                 test_extension_l3_ha.L3HABaseForIntTests,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUX%2F%2B3zk%3D","line":220,"updated":"2014-02-18 13:59:15.000000000","message":"can you please clarify the need for CommonDbMixin and L3_HA_NAT_db_mixin here? I think you can use self.plugin.get_sync_data() at #254 and #262","commit_id":"454e217f2f7fb5f962129de97515c288a24ed6ed"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3d25982c6245a178ff24a1ab4b73629af4abcf0c","unresolved":false,"context_lines":[{"line_number":216,"context_line":""},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"class L3AgentHASchedulerTestCase(l3_agentschedulers_db.L3AgentSchedulerDbMixin,"},{"line_number":219,"context_line":"                                 l3_hamode_db.L3_HA_NAT_db_mixin,"},{"line_number":220,"context_line":"                                 test_l3_plugin.L3NatTestCaseMixin,"},{"line_number":221,"context_line":"                                 test_extension_l3_ha.L3HABaseForIntTests,"},{"line_number":222,"context_line":"                                 L3SchedulerTestBaseMixin):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2F3DA%3D","line":219,"updated":"2014-02-24 13:25:34.000000000","message":"is it still needed?","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d6a0d4d936985b040dcf0f8a0fa57e0282e71163","unresolved":false,"context_lines":[{"line_number":216,"context_line":""},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"class L3AgentHASchedulerTestCase(l3_agentschedulers_db.L3AgentSchedulerDbMixin,"},{"line_number":219,"context_line":"                                 l3_hamode_db.L3_HA_NAT_db_mixin,"},{"line_number":220,"context_line":"                                 test_l3_plugin.L3NatTestCaseMixin,"},{"line_number":221,"context_line":"                                 test_extension_l3_ha.L3HABaseForIntTests,"},{"line_number":222,"context_line":"                                 L3SchedulerTestBaseMixin):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2F7M4%3D","line":219,"in_reply_to":"AAAAU3%2F%2F3DA%3D","updated":"2014-03-03 11:42:33.000000000","message":"removed","commit_id":"6f0a1ddc956417365cee4f387068a17c535640d4"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"5129da8e83b92b602fe12f5303a2417784d07c90","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        super(L3AgentHASchedulerTestCase, self).tearDown()"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    def test_scheduler_with_ha_enabled(self):"},{"line_number":244,"context_line":"        with self.router() as r1:"},{"line_number":245,"context_line":"            agents \u003d self.get_l3_agents_hosting_routers("},{"line_number":246,"context_line":"                self.adminContext, [r1[\u0027router\u0027][\u0027id\u0027]],"},{"line_number":247,"context_line":"                admin_state_up\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAXH%2F%2Fc%2B0%3D","line":244,"updated":"2014-04-21 16:49:14.000000000","message":"nit: i prefer \"router\" here","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"5129da8e83b92b602fe12f5303a2417784d07c90","unresolved":false,"context_lines":[{"line_number":266,"context_line":"    def test_scheduler_with_ha_enabled_not_enough_agent(self):"},{"line_number":267,"context_line":"        with self.router() as r1:"},{"line_number":268,"context_line":"            agents \u003d self.get_l3_agents_hosting_routers("},{"line_number":269,"context_line":"                self.adminContext, [r1[\u0027router\u0027][\u0027id\u0027]],"},{"line_number":270,"context_line":"                admin_state_up\u003dTrue)"},{"line_number":271,"context_line":"            self.assertEqual(2, len(agents))"},{"line_number":272,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAXH%2F%2Fc%2Bs%3D","line":269,"updated":"2014-04-21 16:49:14.000000000","message":"ditto","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"5129da8e83b92b602fe12f5303a2417784d07c90","unresolved":false,"context_lines":[{"line_number":285,"context_line":"    def test_scheduler_with_ha_disabled(self):"},{"line_number":286,"context_line":"        cfg.CONF.set_override(\u0027l3_ha\u0027, False)"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"        with self.router() as r1:"},{"line_number":289,"context_line":"            agents \u003d self.get_l3_agents_hosting_routers("},{"line_number":290,"context_line":"                self.adminContext, [r1[\u0027router\u0027][\u0027id\u0027]],"},{"line_number":291,"context_line":"                admin_state_up\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAXH%2F%2Fc%2Bo%3D","line":288,"updated":"2014-04-21 16:49:14.000000000","message":"ditto","commit_id":"2215eda3001d7a929bb0c22961c5f27ffa504305"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e492fc6f3008518b5fcf457c69dba848da9c2ad2","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        self.get_l3_agents_p.stop()"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    def tearDown(self):"},{"line_number":239,"context_line":"        self.notify_ha_p.start()"},{"line_number":240,"context_line":"        self.get_l3_agents_p.start()"},{"line_number":241,"context_line":"        super(L3AgentHASchedulerTestCase, self).tearDown()"},{"line_number":242,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"baada198_90ac2f37","line":239,"updated":"2014-07-25 06:57:28.000000000","message":"self.addCleanup() is a preferable way for cleanups","commit_id":"4941e3c167e166e8d107184e47b84123ec9ea64e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e492fc6f3008518b5fcf457c69dba848da9c2ad2","unresolved":false,"context_lines":[{"line_number":279,"context_line":"            admin_state_up\u003dTrue)"},{"line_number":280,"context_line":"        self.assertEqual(0, len(agents))"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        self._set_l3_agent_admin_state(self.adminContext,"},{"line_number":283,"context_line":"                                       self.agent_id2, True)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def test_scheduler_with_ha_disabled(self):"}],"source_content_type":"text/x-python","patch_set":21,"id":"baada198_b053f338","line":282,"updated":"2014-07-25 06:57:28.000000000","message":"consider adding this as a cleanup rigth after line 274","commit_id":"4941e3c167e166e8d107184e47b84123ec9ea64e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8ba43167394fa5482380d8b60090ed2e83a92622","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import contextlib"},{"line_number":20,"context_line":"import datetime"},{"line_number":21,"context_line":"from oslo.config import cfg"},{"line_number":22,"context_line":"import uuid"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"import mock"}],"source_content_type":"text/x-python","patch_set":44,"id":"1abeadc6_0cf52282","line":21,"updated":"2014-08-29 22:09:06.000000000","message":"This is not in stdlib","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"781e10488c41bf5611bcb9cd1845404bf432f401","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import contextlib"},{"line_number":20,"context_line":"import datetime"},{"line_number":21,"context_line":"from oslo.config import cfg"},{"line_number":22,"context_line":"import uuid"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"import mock"}],"source_content_type":"text/x-python","patch_set":44,"id":"fa98f980_a591e2f2","line":21,"in_reply_to":"1abeadc6_0cf52282","updated":"2014-09-03 17:21:24.000000000","message":"Done","commit_id":"f3cb9b0defe36ff88f6723c43c5960c6fe13e97d"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"55f906e62abdac0adf24f5686610c1037f96f993","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    \u0027start_flag\u0027: True"},{"line_number":76,"context_line":"}"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"HOST_4 \u003d \u0027my_l3_host_4\u0027"},{"line_number":79,"context_line":"FORTH_L3_AGENT \u003d {"},{"line_number":80,"context_line":"    \u0027binary\u0027: \u0027neutron-l3-agent\u0027,"},{"line_number":81,"context_line":"    \u0027host\u0027: HOST_4,"}],"source_content_type":"text/x-python","patch_set":46,"id":"fa98f980_99f8d1c4","line":78,"updated":"2014-09-03 11:11:56.000000000","message":"since you still have to apply Maru\u0027s nits, I suggest renaming this to FOURTH_L3_AGENT.","commit_id":"6c40d16d73653b5a5f1ca99ff18b5a79110f69d3"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"db170fea3d634c7543910af4c708487307df3253","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    \u0027start_flag\u0027: True"},{"line_number":76,"context_line":"}"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"HOST_4 \u003d \u0027my_l3_host_4\u0027"},{"line_number":79,"context_line":"FORTH_L3_AGENT \u003d {"},{"line_number":80,"context_line":"    \u0027binary\u0027: \u0027neutron-l3-agent\u0027,"},{"line_number":81,"context_line":"    \u0027host\u0027: HOST_4,"}],"source_content_type":"text/x-python","patch_set":46,"id":"fa98f980_66a9bdde","line":78,"in_reply_to":"fa98f980_99f8d1c4","updated":"2014-09-03 17:21:34.000000000","message":"Done","commit_id":"6c40d16d73653b5a5f1ca99ff18b5a79110f69d3"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"55f906e62abdac0adf24f5686610c1037f96f993","unresolved":false,"context_lines":[{"line_number":527,"context_line":"                agents \u003d self.get_l3_agents_hosting_routers("},{"line_number":528,"context_line":"                    self.adminContext, [r1[\u0027router\u0027][\u0027id\u0027]],"},{"line_number":529,"context_line":"                    admin_state_up\u003dTrue)"},{"line_number":530,"context_line":"                self.assertEqual(1, len(agents))"},{"line_number":531,"context_line":""},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"class L3AgentLeastRoutersSchedulerTestCase(L3SchedulerTestCase):"}],"source_content_type":"text/x-python","patch_set":46,"id":"fa98f980_445cbced","line":530,"updated":"2014-09-03 11:11:56.000000000","message":"can you do something like self.assertEqual(self.agent_id1, agents[0])?\n\nor however the expected should look like.","commit_id":"6c40d16d73653b5a5f1ca99ff18b5a79110f69d3"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"db170fea3d634c7543910af4c708487307df3253","unresolved":false,"context_lines":[{"line_number":527,"context_line":"                agents \u003d self.get_l3_agents_hosting_routers("},{"line_number":528,"context_line":"                    self.adminContext, [r1[\u0027router\u0027][\u0027id\u0027]],"},{"line_number":529,"context_line":"                    admin_state_up\u003dTrue)"},{"line_number":530,"context_line":"                self.assertEqual(1, len(agents))"},{"line_number":531,"context_line":""},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"class L3AgentLeastRoutersSchedulerTestCase(L3SchedulerTestCase):"}],"source_content_type":"text/x-python","patch_set":46,"id":"fa98f980_0732a8f1","line":530,"in_reply_to":"fa98f980_445cbced","updated":"2014-09-03 17:21:34.000000000","message":"Done","commit_id":"6c40d16d73653b5a5f1ca99ff18b5a79110f69d3"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"55f906e62abdac0adf24f5686610c1037f96f993","unresolved":false,"context_lines":[{"line_number":879,"context_line":"        result \u003d self.plugin.get_l3_agents_ordered_by_num_routers("},{"line_number":880,"context_line":"            self.adminContext, agent_ids)"},{"line_number":881,"context_line":""},{"line_number":882,"context_line":"        self.assertEqual(agent_ids, [record[\u0027id\u0027] for record in result])"},{"line_number":883,"context_line":""},{"line_number":884,"context_line":""},{"line_number":885,"context_line":"class L3AgentSchedulerDbMixinTestCase(L3HATestCaseMixin):"}],"source_content_type":"text/x-python","patch_set":46,"id":"fa98f980_24c978ac","line":882,"updated":"2014-09-03 11:11:56.000000000","message":"what if 2 agents have the same number of routers? Will their order matter?","commit_id":"6c40d16d73653b5a5f1ca99ff18b5a79110f69d3"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"db170fea3d634c7543910af4c708487307df3253","unresolved":false,"context_lines":[{"line_number":879,"context_line":"        result \u003d self.plugin.get_l3_agents_ordered_by_num_routers("},{"line_number":880,"context_line":"            self.adminContext, agent_ids)"},{"line_number":881,"context_line":""},{"line_number":882,"context_line":"        self.assertEqual(agent_ids, [record[\u0027id\u0027] for record in result])"},{"line_number":883,"context_line":""},{"line_number":884,"context_line":""},{"line_number":885,"context_line":"class L3AgentSchedulerDbMixinTestCase(L3HATestCaseMixin):"}],"source_content_type":"text/x-python","patch_set":46,"id":"fa98f980_275dec15","line":882,"in_reply_to":"fa98f980_24c978ac","updated":"2014-09-03 17:21:34.000000000","message":"Are you talking about get_l3_agents_ordered_by_num_routers itself? No we don\u0027t care the internal ordering of two agents hosting the same number of routers. Specifically in this test I make sure that each agent is hosting a different number of routers so the expected order is deterministic.","commit_id":"6c40d16d73653b5a5f1ca99ff18b5a79110f69d3"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6135ccc4a864ef83fc6419cee5df92bef5287414","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        routers \u003d [{\u0027id\u0027: \u0027foo_router\u0027, \u0027distributed\u0027: True}]"},{"line_number":237,"context_line":"        agent \u003d agents_db.Agent(id\u003d\u0027foo_agent\u0027)"},{"line_number":238,"context_line":"        with mock.patch.object(self.scheduler,"},{"line_number":239,"context_line":"                               \u0027router_has_binding\u0027) as mock_has:"},{"line_number":240,"context_line":"            with mock.patch.object(self.scheduler, \u0027bind_router\u0027) as mock_bind:"},{"line_number":241,"context_line":"                self.scheduler.bind_routers(mock.ANY, mock.ANY, routers, agent)"},{"line_number":242,"context_line":"        mock_has.assert_called_once_with(mock.ANY, \u0027foo_router\u0027, \u0027foo_agent\u0027)"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_e81730ec","line":239,"updated":"2014-09-03 20:21:43.000000000","message":"\"has\" is confusing. Can we use \"ha_sch\" instead if you prefer to shorter name.","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"6775ce422906ec320eceeec64255560df96dd4ca","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        routers \u003d [{\u0027id\u0027: \u0027foo_router\u0027, \u0027distributed\u0027: True}]"},{"line_number":237,"context_line":"        agent \u003d agents_db.Agent(id\u003d\u0027foo_agent\u0027)"},{"line_number":238,"context_line":"        with mock.patch.object(self.scheduler,"},{"line_number":239,"context_line":"                               \u0027router_has_binding\u0027) as mock_has:"},{"line_number":240,"context_line":"            with mock.patch.object(self.scheduler, \u0027bind_router\u0027) as mock_bind:"},{"line_number":241,"context_line":"                self.scheduler.bind_routers(mock.ANY, mock.ANY, routers, agent)"},{"line_number":242,"context_line":"        mock_has.assert_called_once_with(mock.ANY, \u0027foo_router\u0027, \u0027foo_agent\u0027)"}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_c5daca16","line":239,"in_reply_to":"fa98f980_e81730ec","updated":"2014-09-08 23:46:46.000000000","message":"Done","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"c1af400a705e1207d84318560aef8ffb3cc4c6c9","unresolved":false,"context_lines":[{"line_number":245,"context_line":"    def _test_bind_routers_ha(self, has_binding):"},{"line_number":246,"context_line":"        routers \u003d [{\u0027id\u0027: \u0027foo_router\u0027, \u0027ha\u0027: True, \u0027tenant_id\u0027: \u002742\u0027}]"},{"line_number":247,"context_line":"        agent \u003d agents_db.Agent(id\u003d\u0027foo_agent\u0027)"},{"line_number":248,"context_line":"        with mock.patch.object(self.scheduler,"},{"line_number":249,"context_line":"                               \u0027router_has_binding\u0027,"},{"line_number":250,"context_line":"                               return_value\u003dhas_binding) as mock_has:"},{"line_number":251,"context_line":"            with mock.patch.object("}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_fdcce28c","line":248,"updated":"2014-09-08 10:23:37.000000000","message":"what about a contextlib.nested, so you have less indents?","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"6775ce422906ec320eceeec64255560df96dd4ca","unresolved":false,"context_lines":[{"line_number":245,"context_line":"    def _test_bind_routers_ha(self, has_binding):"},{"line_number":246,"context_line":"        routers \u003d [{\u0027id\u0027: \u0027foo_router\u0027, \u0027ha\u0027: True, \u0027tenant_id\u0027: \u002742\u0027}]"},{"line_number":247,"context_line":"        agent \u003d agents_db.Agent(id\u003d\u0027foo_agent\u0027)"},{"line_number":248,"context_line":"        with mock.patch.object(self.scheduler,"},{"line_number":249,"context_line":"                               \u0027router_has_binding\u0027,"},{"line_number":250,"context_line":"                               return_value\u003dhas_binding) as mock_has:"},{"line_number":251,"context_line":"            with mock.patch.object("}],"source_content_type":"text/x-python","patch_set":47,"id":"fa98f980_057932fc","line":248,"in_reply_to":"fa98f980_fdcce28c","updated":"2014-09-08 23:46:46.000000000","message":"Done","commit_id":"3f8e7041587eceff2bd7e711c33164eee223ee9e"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"5e9f6f67310bd6a878ca5a7f09c81fa8e1e15535","unresolved":false,"context_lines":[{"line_number":821,"context_line":"class L3HAPlugin(db_v2.NeutronDbPluginV2,"},{"line_number":822,"context_line":"                 l3_hamode_db.L3_HA_NAT_db_mixin,"},{"line_number":823,"context_line":"                 l3_hascheduler_db.L3_HA_scheduler_db_mixin):"},{"line_number":824,"context_line":"    supported_extension_aliases \u003d [\"l3-ha\"]"},{"line_number":825,"context_line":""},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"class L3HATestCaseMixin(testlib_api.SqlTestCase,"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_cc2ac78f","line":824,"updated":"2014-09-10 08:25:50.000000000","message":"Don\u0027t we need to add l3_agent_scheduler, router, agent in the extension aliases?","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5087d914a148ea1b9a94800b2d6e1a50770d9816","unresolved":false,"context_lines":[{"line_number":821,"context_line":"class L3HAPlugin(db_v2.NeutronDbPluginV2,"},{"line_number":822,"context_line":"                 l3_hamode_db.L3_HA_NAT_db_mixin,"},{"line_number":823,"context_line":"                 l3_hascheduler_db.L3_HA_scheduler_db_mixin):"},{"line_number":824,"context_line":"    supported_extension_aliases \u003d [\"l3-ha\"]"},{"line_number":825,"context_line":""},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"class L3HATestCaseMixin(testlib_api.SqlTestCase,"}],"source_content_type":"text/x-python","patch_set":49,"id":"fa98f980_cdbc7e6f","line":824,"in_reply_to":"fa98f980_cc2ac78f","updated":"2014-09-10 13:23:04.000000000","message":"I honestly don\u0027t know. Obviously the unit tests that use this plugin work fine as it is, but maybe if we add additional unit tests it\u0027ll bork out? For example explicitly adding or removing a router from an agent via the API?","commit_id":"aa00b526cca815d8fbbbe2b1126391f839fd8337"}]}
