)]}'
{"neutron/db/agents_db.py":[{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"fc3d3a85702c4c0ee93194bb16b3a282913a6af1","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        if agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_L3:"},{"line_number":242,"context_line":"            # TODO(xiaohhui): Should we make it configurable? Available"},{"line_number":243,"context_line":"            # options are routers, interfaces, floating_ips, and ex_gw_ports."},{"line_number":244,"context_line":"            load_type \u003d \u0027routers\u0027"},{"line_number":245,"context_line":"        if load_type:"},{"line_number":246,"context_line":"            load \u003d int(configs.get(load_type, 0))"},{"line_number":247,"context_line":"        return load"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a9d85d2_7095183f","line":244,"updated":"2016-06-20 10:39:03.000000000","message":"I think \u0027l3_load_type\u0027 config parameter is better option.","commit_id":"b33091c6a8dffff1877d5f3a77cc187e4835c2ba"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"e27e1d006079db1eea6a3cbc65994846f81908e7","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        if agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_L3:"},{"line_number":242,"context_line":"            # TODO(xiaohhui): Should we make it configurable? Available"},{"line_number":243,"context_line":"            # options are routers, interfaces, floating_ips, and ex_gw_ports."},{"line_number":244,"context_line":"            load_type \u003d \u0027routers\u0027"},{"line_number":245,"context_line":"        if load_type:"},{"line_number":246,"context_line":"            load \u003d int(configs.get(load_type, 0))"},{"line_number":247,"context_line":"        return load"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a9d85d2_c717efeb","line":244,"in_reply_to":"5a9d85d2_7095183f","updated":"2016-06-20 10:55:31.000000000","message":"Yes, that is a feasible enhancement, we can do that in following patches. In this patch, I think it is better to keep it as simple as possible.","commit_id":"b33091c6a8dffff1877d5f3a77cc187e4835c2ba"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":239,"context_line":"        if(agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":240,"context_line":"            load_type \u003d cfg.CONF.dhcp_load_type"},{"line_number":241,"context_line":"        if agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_L3:"},{"line_number":242,"context_line":"            # TODO(xiaohhui): Should we make it configurable? Available"},{"line_number":243,"context_line":"            # options are routers, interfaces, floating_ips, and ex_gw_ports."},{"line_number":244,"context_line":"            load_type \u003d \u0027routers\u0027"},{"line_number":245,"context_line":"        if load_type:"},{"line_number":246,"context_line":"            load \u003d int(configs.get(load_type, 0))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_ed6fc18f","line":243,"range":{"start_line":242,"start_character":12,"end_line":243,"end_character":77},"updated":"2016-07-12 21:34:03.000000000","message":"routers and floating_ips might be reasonable things to use for weight scheduling.  But, really, neither is a perfect measure of load.  If it were me, I\u0027d just take the default of routers and hope that with enough of them, the load averages out pretty well.","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"6ba9324b11f99890413e78e40629d241defeeff8","unresolved":false,"context_lines":[{"line_number":239,"context_line":"        if(agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":240,"context_line":"            load_type \u003d cfg.CONF.dhcp_load_type"},{"line_number":241,"context_line":"        if agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_L3:"},{"line_number":242,"context_line":"            # TODO(xiaohhui): Should we make it configurable? Available"},{"line_number":243,"context_line":"            # options are routers, interfaces, floating_ips, and ex_gw_ports."},{"line_number":244,"context_line":"            load_type \u003d \u0027routers\u0027"},{"line_number":245,"context_line":"        if load_type:"},{"line_number":246,"context_line":"            load \u003d int(configs.get(load_type, 0))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_717b99f5","line":243,"range":{"start_line":242,"start_character":12,"end_line":243,"end_character":77},"in_reply_to":"1aa78d24_ed6fc18f","updated":"2016-07-13 06:27:58.000000000","message":"yeah, there is no perfect measure of load. These options are  currently provided by l3 agent. I think they might have some meanings in some special case. For example, \"interfaces\" means how many subnets connected to the routes in the l3 agent. The bigger of its number, l3 agent will have higher possibility to have higher load of network traffic.\n\nI think most time, the load type \"router\" should be enough as you said. But making it be configurable will keep consistent with dhcp agent, and provide other use case to user.\n\nI add this option at [1], maybe we can discuss more there.\n[1] https://review.openstack.org/#/c/332644","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"}],"neutron/scheduler/l3_agent_scheduler.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":271,"context_line":""},{"line_number":272,"context_line":"        return routers_agents"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"    # TODO(xiaohhui): This should unify with dhcp_agent_scheduler at"},{"line_number":275,"context_line":"    # base_scheduler"},{"line_number":276,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":277,"context_line":"               resource_hosted_agents, num_agents_needed):"},{"line_number":278,"context_line":"        # The dict to record the agents in each AZ, the record will be sorted"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_b2d231cf","line":275,"range":{"start_line":274,"start_character":6,"end_line":275,"end_character":20},"updated":"2016-07-12 21:34:03.000000000","message":"Yes! There is *way* too much complicated logic here to be duplicated even once. Normally, I have a tolerance for duplicating some code once or twice but probably not in this case.\n\nMy review notes below are just from me trying to understand the algorithm. I do understand that it is essentially duplicated from the DHCP version of this code.\n\nI\u0027d prefer you work on unifying the two versions rather than trying to address my comments below.","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"6ba9324b11f99890413e78e40629d241defeeff8","unresolved":false,"context_lines":[{"line_number":271,"context_line":""},{"line_number":272,"context_line":"        return routers_agents"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"    # TODO(xiaohhui): This should unify with dhcp_agent_scheduler at"},{"line_number":275,"context_line":"    # base_scheduler"},{"line_number":276,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":277,"context_line":"               resource_hosted_agents, num_agents_needed):"},{"line_number":278,"context_line":"        # The dict to record the agents in each AZ, the record will be sorted"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_118df5d2","line":275,"range":{"start_line":274,"start_character":6,"end_line":275,"end_character":20},"in_reply_to":"1aa78d24_b2d231cf","updated":"2016-07-13 06:27:58.000000000","message":"Actually, the content of this select method is completely copied from dhcp_agent_scheduler. All of comments also applies to the code in dhcp_agent_scheduler.\n\nI unify the two version at this patch [1]. Maybe all the related comments can be brought to [1].\n\n\n[1] https://review.openstack.org/#/c/332727","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        # The dict to record the agents in each AZ, the record will be sorted"},{"line_number":279,"context_line":"        # according to the weight of agent. So that the agent with less weight"},{"line_number":280,"context_line":"        # will be used first."},{"line_number":281,"context_line":"        hostable_az_agents \u003d collections.defaultdict(list)"},{"line_number":282,"context_line":"        # The dict to record the number of agents in each AZ. When the number"},{"line_number":283,"context_line":"        # of agents in each AZ is the same and num_agents_needed is less than"},{"line_number":284,"context_line":"        # the number of AZs, we want to select agents with less weight."}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_0d284d99","line":281,"range":{"start_line":281,"start_character":8,"end_line":281,"end_character":26},"updated":"2016-07-12 21:34:03.000000000","message":"nit:  A slightly more helpful name might be \"hostable_agents_by_az\"","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":285,"context_line":"        # Use an OrderedDict here, so that the AZ with least weight agent"},{"line_number":286,"context_line":"        # will be recorded first in the case described above. And, as a result,"},{"line_number":287,"context_line":"        # the agent with least weight will be used first."},{"line_number":288,"context_line":"        num_az_agents \u003d collections.OrderedDict()"},{"line_number":289,"context_line":"        # resource_hostable_agents should be a list with agents in the order of"},{"line_number":290,"context_line":"        # their weight."},{"line_number":291,"context_line":"        resource_hostable_agents \u003d ("}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_ed098132","line":288,"range":{"start_line":288,"start_character":8,"end_line":288,"end_character":21},"updated":"2016-07-12 21:34:03.000000000","message":"* num_agents_by_az","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":288,"context_line":"        num_az_agents \u003d collections.OrderedDict()"},{"line_number":289,"context_line":"        # resource_hostable_agents should be a list with agents in the order of"},{"line_number":290,"context_line":"        # their weight."},{"line_number":291,"context_line":"        resource_hostable_agents \u003d ("},{"line_number":292,"context_line":"            super(AZLeastRoutersScheduler, self).select("},{"line_number":293,"context_line":"                plugin, context, resource_hostable_agents,"},{"line_number":294,"context_line":"                resource_hosted_agents, len(resource_hostable_agents)))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_edcea158","line":291,"range":{"start_line":291,"start_character":8,"end_line":291,"end_character":32},"updated":"2016-07-12 21:34:03.000000000","message":"nit:  I prefer not to overwrite the original value passed in. I\u0027d prefer this had a different name.","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":293,"context_line":"                plugin, context, resource_hostable_agents,"},{"line_number":294,"context_line":"                resource_hosted_agents, len(resource_hostable_agents)))"},{"line_number":295,"context_line":"        for agent in resource_hostable_agents:"},{"line_number":296,"context_line":"            az_agent \u003d agent[\u0027availability_zone\u0027]"},{"line_number":297,"context_line":"            hostable_az_agents[az_agent].append(agent)"},{"line_number":298,"context_line":"            if az_agent not in num_az_agents:"},{"line_number":299,"context_line":"                num_az_agents[az_agent] \u003d 0"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_ad0db990","line":296,"range":{"start_line":296,"start_character":12,"end_line":296,"end_character":20},"updated":"2016-07-12 21:34:03.000000000","message":"nit:  I\u0027d call this agent_az.","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":305,"context_line":"                num_az_agents[az_agent] +\u003d 1"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        chosen_agents \u003d []"},{"line_number":308,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":309,"context_line":"            # \u0027min\u0027 will stably output the first min value in the list."},{"line_number":310,"context_line":"            select_az \u003d min(num_az_agents.items(), key\u003ditemgetter(1))[0]"},{"line_number":311,"context_line":"            # Select the agent in AZ with least weight."}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_5202edb4","line":308,"range":{"start_line":308,"start_character":14,"end_line":308,"end_character":35},"updated":"2016-07-12 21:34:03.000000000","message":"nit:  Just a suggestion:\n\n  while len(chosen_agents) \u003c num_agents_needed:\n\nI don\u0027t know, it seems slightly more readable to me.  Also, it would allow you to remove L320.","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        chosen_agents \u003d []"},{"line_number":308,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":309,"context_line":"            # \u0027min\u0027 will stably output the first min value in the list."},{"line_number":310,"context_line":"            select_az \u003d min(num_az_agents.items(), key\u003ditemgetter(1))[0]"},{"line_number":311,"context_line":"            # Select the agent in AZ with least weight."},{"line_number":312,"context_line":"            select_agent \u003d hostable_az_agents[select_az][0]"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_b29a3160","line":309,"range":{"start_line":309,"start_character":14,"end_line":309,"end_character":71},"updated":"2016-07-12 21:34:03.000000000","message":"nit:  I\u0027d suggest rewriting this comment to reflect your intent.\n\n  \"Select the AZ remaining with the least number of agents and with least weight.\"\n\nAlso, I notice that the ordered dict is not changed to reflect the agent\u0027s weight after being chosen.","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":307,"context_line":"        chosen_agents \u003d []"},{"line_number":308,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":309,"context_line":"            # \u0027min\u0027 will stably output the first min value in the list."},{"line_number":310,"context_line":"            select_az \u003d min(num_az_agents.items(), key\u003ditemgetter(1))[0]"},{"line_number":311,"context_line":"            # Select the agent in AZ with least weight."},{"line_number":312,"context_line":"            select_agent \u003d hostable_az_agents[select_az][0]"},{"line_number":313,"context_line":"            chosen_agents.append(select_agent)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_72e289d6","line":310,"range":{"start_line":310,"start_character":12,"end_line":310,"end_character":21},"updated":"2016-07-12 21:34:03.000000000","message":"nit:  Consider renaming this to \"selected_az\"","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":309,"context_line":"            # \u0027min\u0027 will stably output the first min value in the list."},{"line_number":310,"context_line":"            select_az \u003d min(num_az_agents.items(), key\u003ditemgetter(1))[0]"},{"line_number":311,"context_line":"            # Select the agent in AZ with least weight."},{"line_number":312,"context_line":"            select_agent \u003d hostable_az_agents[select_az][0]"},{"line_number":313,"context_line":"            chosen_agents.append(select_agent)"},{"line_number":314,"context_line":"            # Update the AZ-agents records."},{"line_number":315,"context_line":"            del hostable_az_agents[select_az][0]"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_b2e871b4","line":312,"range":{"start_line":312,"start_character":12,"end_line":312,"end_character":24},"updated":"2016-07-12 21:34:03.000000000","message":"Consider renaming this to \"selected_agent\"","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":309,"context_line":"            # \u0027min\u0027 will stably output the first min value in the list."},{"line_number":310,"context_line":"            select_az \u003d min(num_az_agents.items(), key\u003ditemgetter(1))[0]"},{"line_number":311,"context_line":"            # Select the agent in AZ with least weight."},{"line_number":312,"context_line":"            select_agent \u003d hostable_az_agents[select_az][0]"},{"line_number":313,"context_line":"            chosen_agents.append(select_agent)"},{"line_number":314,"context_line":"            # Update the AZ-agents records."},{"line_number":315,"context_line":"            del hostable_az_agents[select_az][0]"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_32be41ae","line":312,"updated":"2016-07-12 21:34:03.000000000","message":"suggestion:\n\n  select_agent \u003d hostable_az_agents[select_az].pop(0)\n\nAnd then remove L315.","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":396,"context_line":"    def _get_candidates(self, plugin, context, sync_router):"},{"line_number":397,"context_line":"        \"\"\"Return L3 agents where a router could be scheduled.\"\"\""},{"line_number":398,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":399,"context_line":"            # allow one router is hosted by just"},{"line_number":400,"context_line":"            # one enabled l3 agent hosting since active is just a"},{"line_number":401,"context_line":"            # timing problem. Non-active l3 agent can return to"},{"line_number":402,"context_line":"            # active any time"},{"line_number":403,"context_line":"            current_l3_agents \u003d plugin.get_l3_agents_hosting_routers("},{"line_number":404,"context_line":"                context, [sync_router[\u0027id\u0027]], admin_state_up\u003dTrue)"},{"line_number":405,"context_line":"            if current_l3_agents:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_b55b3b85","line":402,"range":{"start_line":399,"start_character":14,"end_line":402,"end_character":29},"updated":"2016-07-12 21:34:03.000000000","message":"I don\u0027t understand this comment","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"6ba9324b11f99890413e78e40629d241defeeff8","unresolved":false,"context_lines":[{"line_number":396,"context_line":"    def _get_candidates(self, plugin, context, sync_router):"},{"line_number":397,"context_line":"        \"\"\"Return L3 agents where a router could be scheduled.\"\"\""},{"line_number":398,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":399,"context_line":"            # allow one router is hosted by just"},{"line_number":400,"context_line":"            # one enabled l3 agent hosting since active is just a"},{"line_number":401,"context_line":"            # timing problem. Non-active l3 agent can return to"},{"line_number":402,"context_line":"            # active any time"},{"line_number":403,"context_line":"            current_l3_agents \u003d plugin.get_l3_agents_hosting_routers("},{"line_number":404,"context_line":"                context, [sync_router[\u0027id\u0027]], admin_state_up\u003dTrue)"},{"line_number":405,"context_line":"            if current_l3_agents:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_f10e6939","line":402,"range":{"start_line":399,"start_character":14,"end_line":402,"end_character":29},"in_reply_to":"1aa78d24_b55b3b85","updated":"2016-07-13 06:27:58.000000000","message":"This is actually copied from line 168-171 in base. (most of the code are copied from base version and rearranged here).\n\nIn reality, I think it means if the router is already scheduled to a agent, even if it is an in-acitve agent, we still think it has been already scheduled. And no more other scheduling for the router, because the in-active agent may revive anytime.","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        return True"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def _get_num_of_agents_for_ha(self, candidates_count):"},{"line_number":439,"context_line":"        return (min(self.max_ha_agents, candidates_count) if self.max_ha_agents"},{"line_number":440,"context_line":"                else candidates_count)"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":"    def filter_agents(self, plugin, context, router):"},{"line_number":443,"context_line":"        \"\"\"Return the agents that can host the router."}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_95df1f0c","line":440,"range":{"start_line":439,"start_character":15,"end_line":440,"end_character":38},"updated":"2016-07-12 21:34:03.000000000","message":"nit:  I\u0027d prefer this as a standard if / else statement:\n\n  if self.max_ha_agents:\n      return min(self.max_ha_agents, candidates_count)\n  return candidates_count","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"6ba9324b11f99890413e78e40629d241defeeff8","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        return True"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def _get_num_of_agents_for_ha(self, candidates_count):"},{"line_number":439,"context_line":"        return (min(self.max_ha_agents, candidates_count) if self.max_ha_agents"},{"line_number":440,"context_line":"                else candidates_count)"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":"    def filter_agents(self, plugin, context, router):"},{"line_number":443,"context_line":"        \"\"\"Return the agents that can host the router."}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_649d99bb","line":440,"range":{"start_line":439,"start_character":15,"end_line":440,"end_character":38},"in_reply_to":"1aa78d24_95df1f0c","updated":"2016-07-13 06:27:58.000000000","message":"This is also another copy from base code to here. I think it maybe good to keep it unchanged","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"58f7d9ac2443581a8ceed17dfdd403816b1d0144","unresolved":false,"context_lines":[{"line_number":456,"context_line":"        num_agents \u003d 1"},{"line_number":457,"context_line":"        if router.get(\u0027ha\u0027, False):"},{"line_number":458,"context_line":"            # filter agent for ha router"},{"line_number":459,"context_line":"            if not self._enough_candidates_for_ha(candidates):"},{"line_number":460,"context_line":"                return {\u0027n_agents\u0027: 0, \u0027hostable_agents\u0027: [],"},{"line_number":461,"context_line":"                        \u0027hosted_agents\u0027: []}"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"            num_agents \u003d self._get_num_of_agents_for_ha(len(candidates))"},{"line_number":464,"context_line":"        return {\u0027n_agents\u0027: num_agents, \u0027hostable_agents\u0027: candidates,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_d58087f9","line":461,"range":{"start_line":459,"start_character":12,"end_line":461,"end_character":44},"updated":"2016-07-12 21:34:03.000000000","message":"I have say that I still don\u0027t like this.  We should schedule HA routers to as many as we can.  But, I think your patch is just preserving this behavior.  So, this comment isn\u0027t really relevant.","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"6ba9324b11f99890413e78e40629d241defeeff8","unresolved":false,"context_lines":[{"line_number":456,"context_line":"        num_agents \u003d 1"},{"line_number":457,"context_line":"        if router.get(\u0027ha\u0027, False):"},{"line_number":458,"context_line":"            # filter agent for ha router"},{"line_number":459,"context_line":"            if not self._enough_candidates_for_ha(candidates):"},{"line_number":460,"context_line":"                return {\u0027n_agents\u0027: 0, \u0027hostable_agents\u0027: [],"},{"line_number":461,"context_line":"                        \u0027hosted_agents\u0027: []}"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"            num_agents \u003d self._get_num_of_agents_for_ha(len(candidates))"},{"line_number":464,"context_line":"        return {\u0027n_agents\u0027: num_agents, \u0027hostable_agents\u0027: candidates,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_248f1176","line":461,"range":{"start_line":459,"start_character":12,"end_line":461,"end_character":44},"in_reply_to":"1aa78d24_d58087f9","updated":"2016-07-13 06:27:58.000000000","message":"Yeah, I agree with you here. Since \"min_l3_agents_per_router\" is deprecated for removal now. We can see the desirable behavior when the options is actually removed.","commit_id":"131840ff8216c9696938d6606f6adff199da8d2d"}]}
