)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0263996e5d0f871ff2a12f455e77656cfb1ba840","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"DocImpact"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Implements: blueprint dhcpservice-loadbalancing"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: I5ec8adf0c4336f885d603662223caa7694708876"},{"line_number":29,"context_line":"Author: Shivakumar M \u003cshiva.kum.m@hp.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3a961159_f37c3b22","line":26,"updated":"2015-01-08 19:10:44.000000000","message":"This patch does not complete the blueprint, as you\u0027d need the agent-side changes. As far as I can tell, I see none.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e71f9fe104ca4e0d8f6f5f0dc8c995cee8742539","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"DocImpact"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Implements: blueprint dhcpservice-loadbalancing"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: I5ec8adf0c4336f885d603662223caa7694708876"},{"line_number":29,"context_line":"Author: Shivakumar M \u003cshiva.kum.m@hp.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3a961159_85355f46","line":26,"in_reply_to":"3a961159_f37c3b22","updated":"2015-01-09 09:51:00.000000000","message":"Currently agents are sending, networks,subnets,ports,routers,interfaces in the report status, so as of now we think agent side changes are none.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"94738f216988434c9d09a5abebfb7f42ff5a008e","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2014-11-25 00:46:07 -0800"},{"line_number":4,"context_line":"Commit:     Praveen Kumar SM \u003cpraveen-sm.kumar@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-02-14 07:38:19 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"DHCP Service LoadBalancing Scheduler"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"With the current Agent Management and Scheduler extensions we are not"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"da86d52c_3d1bbe1d","line":6,"updated":"2015-02-14 19:23:56.000000000","message":"What is the advantage to letting the DHCP agent report a load type, and the load?\n\nLoad type can be \u0027networks, namespaces, etc\u0027. Currently, the number of networks \u003d\u003d number of namespaces, and what does etc mean? Are you referring to downstream modifications that would allow you to track other kinds of resources? What resources? Can you upstream these changes?\n\nAlso, it seems like in this revision the DHCP agent reports the load_type but not the load in the configurations dict.\n\nWhy can\u0027t we simplify by removing all reporting done by DHCP agents, remove the \u0027load\u0027 column (Which is never written to? I don\u0027t understand this) and just sort the DHCP agents by the number of network bindings they have. I read your replies to similar comments on the blueprint and I still don\u0027t understand. You said \u0027ever evolving scheduler logic\u0027. Are there additional metrics you\u0027d like to track and report? What metrics? When would this be implemented? All I\u0027m seeing right now is the creation of a generic infrastructure that isn\u0027t needed now, with no concrete plans to use it, not even in this patch.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"94738f216988434c9d09a5abebfb7f42ff5a008e","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2015-02-14 07:38:19 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"DHCP Service LoadBalancing Scheduler"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"With the current Agent Management and Scheduler extensions we are not"},{"line_number":10,"context_line":"able to effectively distribute the DHCP namespace services when there"},{"line_number":11,"context_line":"are multiple Network Nodes available. Existing scheduler(Chance"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"da86d52c_5def92e9","line":8,"updated":"2015-02-14 19:23:56.000000000","message":"It seems like this patch mixes different concepts: Do you have to implement the resource filter concept in this patch? I don\u0027t think it\u0027s strictly to do with sorting DHCP agents by load? Can you do it in a preceding patch?\n\nAbout the filter, are you planning, or do you foresee the addition of different filters? If not, why are you adding this generic functionality? For now, since we have only one filter, can you register it in the initialization of the DHCP scheduler, so that the plugins don\u0027t have to know about it? I don\u0027t understand why plugins would register filters? Shouldn\u0027t this be configurable? Why would a plugin choose different filters? If a plugin chooses to use the DHCP agent I guess choosing different filters would be interesting to the admin, not the plugin writer. Maybe I\u0027m misunderstanding what you\u0027re trying to achieve with filters.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2015-02-14 07:38:19 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"DHCP Service LoadBalancing Scheduler"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"With the current Agent Management and Scheduler extensions we are not"},{"line_number":10,"context_line":"able to effectively distribute the DHCP namespace services when there"},{"line_number":11,"context_line":"are multiple Network Nodes available. Existing scheduler(Chance"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"da86d52c_33d04ec9","line":8,"in_reply_to":"da86d52c_5def92e9","updated":"2015-02-15 07:16:08.000000000","message":"This bp attempts to write generic scheduler implementation which is common across dhcp and l3 ,  also this bp addresses dhcp related changes , l3 changes will be taken as a seperate dependent  bp , the load type can be name space, ports count, etc for dhcp scheduler , similarly l3 scheduler can also have different load types other than namespace,  we agree to your feedback and change commit messages to reflect the commit in the patchset","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4eec846c0387d16e08ab1ab1517beb948a4f0ab2","unresolved":false,"context_lines":[{"line_number":16,"context_line":"Chance scheduler schedules around 90% of DHCP namespaces on a single"},{"line_number":17,"context_line":"Network Node and remaining 10% of namespaces are distributed across"},{"line_number":18,"context_line":"remaining Network Nodes."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"This blueprint attempts to address this issue by proposing a new"},{"line_number":21,"context_line":"DHCP agent scheduler which will equally distribute the DHCP namespaces"},{"line_number":22,"context_line":"across multiple Network Nodes based on network load of DHCP agents."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"da86d52c_7d71b643","line":19,"updated":"2015-02-14 19:34:33.000000000","message":"The commit message doesn\u0027t mention anything about a generic infrastructure to allow DHCP agents to report arbitrary load metrics and persisting that information on the server, nor anything about the generic DHCP agent filtering infrastructure.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"3808c350d9b3c4dd942d2d455638f66f2401c2d8","unresolved":false,"context_lines":[{"line_number":18,"context_line":"remaining Network Nodes."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"This blueprint attempts to address this issue by proposing a new"},{"line_number":21,"context_line":"DHCP agent scheduler which will equally distribute the DHCP namespaces"},{"line_number":22,"context_line":"across multiple Network Nodes based on network load of DHCP agents."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"DocImpact"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"da86d52c_fd85a607","line":21,"updated":"2015-02-14 19:25:20.000000000","message":"\u0027network load\u0027?","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":21,"context_line":"DHCP agent scheduler which will equally distribute the DHCP namespaces"},{"line_number":22,"context_line":"across multiple Network Nodes based on network load of DHCP agents."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"DocImpact"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Implements: blueprint dhcpservice-loadbalancing"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"da86d52c_9d166a57","line":24,"updated":"2015-02-14 22:07:53.000000000","message":"UpgradeImpact flag is required too because the previous config parameter was removed and the new one is add. Hopefully it is nice if we have backward-compat config option if operators does not change the current scheduler (chance scheduler).","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":21,"context_line":"DHCP agent scheduler which will equally distribute the DHCP namespaces"},{"line_number":22,"context_line":"across multiple Network Nodes based on network load of DHCP agents."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"DocImpact"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Implements: blueprint dhcpservice-loadbalancing"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"da86d52c_33592e8f","line":24,"in_reply_to":"da86d52c_9d166a57","updated":"2015-02-15 07:16:08.000000000","message":"Agreed. Will modify it.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"fe8a1f417f5e207015165aa8cfe526d795a8090e","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"DHCP Service LoadBalancing Scheduler"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"In this blueprint, we also propose to write a genreic scheduler"},{"line_number":10,"context_line":"framework which can be used to schedule a new resource on selected"},{"line_number":11,"context_line":"least loaded agents."},{"line_number":12,"context_line":"load_type will be tracked from agents, and persisted in server side db."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"da86d52c_1c16f7a7","line":9,"updated":"2015-02-15 13:47:49.000000000","message":"genreic ---\u003egeneric","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"DHCP Service LoadBalancing Scheduler"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"In this blueprint, we also propose to write a genreic scheduler"},{"line_number":10,"context_line":"framework which can be used to schedule a new resource on selected"},{"line_number":11,"context_line":"least loaded agents."},{"line_number":12,"context_line":"load_type will be tracked from agents, and persisted in server side db."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"da86d52c_67875cb7","line":9,"in_reply_to":"da86d52c_1c16f7a7","updated":"2015-02-15 17:25:39.000000000","message":"Agreed","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"f4ef4cd34085576b0a33cdcb0734a2248ed4d168","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"In this blueprint, we also propose to write a genreic scheduler"},{"line_number":10,"context_line":"framework which can be used to schedule a new resource on selected"},{"line_number":11,"context_line":"least loaded agents."},{"line_number":12,"context_line":"load_type will be tracked from agents, and persisted in server side db."},{"line_number":13,"context_line":"During scheduling, agent will be selected based on sorting all the agents"},{"line_number":14,"context_line":"of particular type based on load column."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"da86d52c_48cee5b5","line":11,"updated":"2015-02-15 23:45:23.000000000","message":"Could you expand on what metrics you\u0027d like the agent(s) to report in the future?","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"}],"etc/dhcp_agent.ini":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":2,"context_line":"# Show debugging output in log (sets DEBUG log level output)"},{"line_number":3,"context_line":"# debug \u003d False"},{"line_number":4,"context_line":""},{"line_number":5,"context_line":"# Allows scheduler to schedule dhcp namespaces based on dhcp load type."},{"line_number":6,"context_line":"# dhcp_load_type \u003d networks"},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"# The DHCP agent will resync its state with Neutron to recover from any"}],"source_content_type":"text/x-properties","patch_set":7,"id":"da86d52c_5dfd49b0","line":5,"updated":"2015-02-11 21:41:04.000000000","message":"I think this is more readable:\n\n  # StrOpt representing the resource type whose load is being tracked by\n  # the agent.\n  # This can be \u0027networks\u0027, \u0027namespaces\u0027, etc. When specified (Default is\n  # None), the agent will report, as part of its configuration object, the\n  # number of resources being consumed, at every report_interval.\n  # It is worth noting that this must be consistent across all the agents of\n  # the same category (dhcp, L3, etc).\n  # load_type \u003d\n\nThe importance of keeping the default None is to have the behavior backward compatible (change scheduler). Remember that the comment here must match the help on the config definition.","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":2,"context_line":"# Show debugging output in log (sets DEBUG log level output)"},{"line_number":3,"context_line":"# debug \u003d False"},{"line_number":4,"context_line":""},{"line_number":5,"context_line":"# Allows scheduler to schedule dhcp namespaces based on dhcp load type."},{"line_number":6,"context_line":"# dhcp_load_type \u003d networks"},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"# The DHCP agent will resync its state with Neutron to recover from any"}],"source_content_type":"text/x-properties","patch_set":7,"id":"da86d52c_2c53a53a","line":5,"in_reply_to":"da86d52c_5dfd49b0","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"fe8a1f417f5e207015165aa8cfe526d795a8090e","unresolved":false,"context_lines":[{"line_number":3,"context_line":"# debug \u003d False"},{"line_number":4,"context_line":""},{"line_number":5,"context_line":"# StrOpt representing the resource type whose load is being tracked by"},{"line_number":6,"context_line":"# the agent."},{"line_number":7,"context_line":"# This can be \u0027networks\u0027, \u0027namespaces\u0027, etc. When specified (Default is"},{"line_number":8,"context_line":"# None), the agent will report, as part of its configuration object, the"},{"line_number":9,"context_line":"# number of resources being consumed, at every report_interval."}],"source_content_type":"text/x-properties","patch_set":11,"id":"da86d52c_7c24530e","line":6,"updated":"2015-02-15 13:47:49.000000000","message":"# (StrOpt) Representing .....","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":3,"context_line":"# debug \u003d False"},{"line_number":4,"context_line":""},{"line_number":5,"context_line":"# StrOpt representing the resource type whose load is being tracked by"},{"line_number":6,"context_line":"# the agent."},{"line_number":7,"context_line":"# This can be \u0027networks\u0027, \u0027namespaces\u0027, etc. When specified (Default is"},{"line_number":8,"context_line":"# None), the agent will report, as part of its configuration object, the"},{"line_number":9,"context_line":"# number of resources being consumed, at every report_interval."}],"source_content_type":"text/x-properties","patch_set":11,"id":"da86d52c_a79154f3","line":6,"in_reply_to":"da86d52c_7c24530e","updated":"2015-02-15 17:25:39.000000000","message":"Agreed","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"093565426764231506b3f1941744263eb67ac84b","unresolved":false,"context_lines":[{"line_number":4,"context_line":""},{"line_number":5,"context_line":"# (StrOpt) Representing the resource type whose load is being tracked by"},{"line_number":6,"context_line":"# the agent."},{"line_number":7,"context_line":"# This can be \u0027networks\u0027. When specified (Default is None), the agent will"},{"line_number":8,"context_line":"# report, as part of its configuration object, the number of resources being"},{"line_number":9,"context_line":"# consumed, at every report_interval."},{"line_number":10,"context_line":"# It is worth noting that this must be consistent across all the agents of"}],"source_content_type":"text/x-properties","patch_set":15,"id":"da86d52c_6feece8c","line":7,"updated":"2015-02-18 21:19:22.000000000","message":"based on a discussion we had on a previous patchset, it sounds like this load type make sense in combination with the scheduler\u0027s choice, where that choice is WeightScheduler. So perhaps this might be best put in neutron.conf; this means we\u0027ll need to have:\n\n  dhcp_load_type\n  l3_load_type\n\nWe can document that dhcp_load_type must be specified when choosing WeightScheduler. The actual values (for instance, \u0027networks\u0027) can be anything that is being reported by the agents.\n\n\nFor now, WeightScheduler is not the default scheduler; DHCP will have it introduced with the patch, and later on, once/if this patch finally gets where it needs to be, we could move the existing L3 weight-base scheduler to the same framework.\n\nThis means that instead of having two weight-scheduler options we can have a single one, whose weight is determined by the load type, so in future we may have in [1]:\n\n  dhcp_scheduler_driver \u003d neutron.scheduler.WeightScheduler\n  l3_scheduler_driver \u003d neutron.scheduler.WeightScheduler\n\n  dhcp_load_type \u003d \u0027networks\u0027\n  l3_load_type \u003d \u0027routers\u0027\n\n\n[1] https://github.com/openstack/neutron/blob/master/etc/neutron.conf#L155","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"af972aadc251a222eb82acbd9b3de339b1073768","unresolved":false,"context_lines":[{"line_number":4,"context_line":""},{"line_number":5,"context_line":"# (StrOpt) Representing the resource type whose load is being tracked by"},{"line_number":6,"context_line":"# the agent."},{"line_number":7,"context_line":"# This can be \u0027networks\u0027. When specified (Default is None), the agent will"},{"line_number":8,"context_line":"# report, as part of its configuration object, the number of resources being"},{"line_number":9,"context_line":"# consumed, at every report_interval."},{"line_number":10,"context_line":"# It is worth noting that this must be consistent across all the agents of"}],"source_content_type":"text/x-properties","patch_set":15,"id":"ba7be1f8_0b65e4e0","line":7,"in_reply_to":"da86d52c_6feece8c","updated":"2015-02-20 17:13:14.000000000","message":"Sounds reasonable.\n\nIt is likely that operators want to use different load_type for different resources.\n\nxConsidering the current use cases in Neutron, least scheduler makes sense. Even if we take into account a combination of two resources (e.g. combos of networks and hosts), we can still use this option \u0027xxx_load_type\u0027 (for example \u0027networks+ports\u0027).","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"}],"etc/neutron.conf":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"864aa9f8e12b362fa87c428561ab8371635c9349","unresolved":false,"context_lines":[{"line_number":159,"context_line":"# router_scheduler_driver \u003d neutron.scheduler.l3_agent_scheduler.ChanceScheduler"},{"line_number":160,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"},{"line_number":161,"context_line":"# loadbalancer_pool_scheduler_driver \u003d neutron.services.loadbalancer.agent_scheduler.ChanceScheduler"},{"line_number":162,"context_line":"# dhcp_load_type \u003d networks"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"# Allow auto scheduling networks to DHCP agent. It will schedule non-hosted"},{"line_number":165,"context_line":"# networks to first DHCP agent which sends get_active_networks message to"}],"source_content_type":"text/plain","patch_set":5,"id":"fa81d914_9f453db5","line":162,"updated":"2015-01-29 19:02:30.000000000","message":"This should have an explanation as to what it is, and the description should match the description on the config option definition. I\u0027d argue that this should be part of the agent configuration file.","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f9dff6e4f5bf0a03b4f26f67e70798ab63f9eb6f","unresolved":false,"context_lines":[{"line_number":159,"context_line":"# router_scheduler_driver \u003d neutron.scheduler.l3_agent_scheduler.ChanceScheduler"},{"line_number":160,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"},{"line_number":161,"context_line":"# loadbalancer_pool_scheduler_driver \u003d neutron.services.loadbalancer.agent_scheduler.ChanceScheduler"},{"line_number":162,"context_line":"# dhcp_load_type \u003d networks"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"# Allow auto scheduling networks to DHCP agent. It will schedule non-hosted"},{"line_number":165,"context_line":"# networks to first DHCP agent which sends get_active_networks message to"}],"source_content_type":"text/plain","patch_set":5,"id":"fa81d914_b17a30ef","line":162,"in_reply_to":"fa81d914_9f453db5","updated":"2015-01-29 19:54:11.000000000","message":"+1, it should be defined in dhcp-agent.ini file","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ebfb0e27efb849b4578d3e6781beebc44e255227","unresolved":false,"context_lines":[{"line_number":159,"context_line":"# router_scheduler_driver \u003d neutron.scheduler.l3_agent_scheduler.ChanceScheduler"},{"line_number":160,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"},{"line_number":161,"context_line":"# loadbalancer_pool_scheduler_driver \u003d neutron.services.loadbalancer.agent_scheduler.ChanceScheduler"},{"line_number":162,"context_line":"# dhcp_load_type \u003d networks"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"# Allow auto scheduling networks to DHCP agent. It will schedule non-hosted"},{"line_number":165,"context_line":"# networks to first DHCP agent which sends get_active_networks message to"}],"source_content_type":"text/plain","patch_set":5,"id":"da86d52c_2bf9cf4d","line":162,"in_reply_to":"fa81d914_b17a30ef","updated":"2015-02-01 05:48:07.000000000","message":"Done, if we add this config in dhcp-agent.ini file, then each agent can decide load paramter on its own.","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6e14ba56bad7efbf3d30fede34f3341ebf55cbc0","unresolved":false,"context_lines":[{"line_number":154,"context_line":""},{"line_number":155,"context_line":"# \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d items for agent scheduler extension \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":156,"context_line":"# Driver to use for scheduling network to DHCP agent"},{"line_number":157,"context_line":"# network_scheduler_driver \u003d neutron.scheduler.base_scheduler.ChanceScheduler"},{"line_number":158,"context_line":"# Driver to use for scheduling router to a default L3 agent"},{"line_number":159,"context_line":"# router_scheduler_driver \u003d neutron.scheduler.l3_agent_scheduler.ChanceScheduler"},{"line_number":160,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"}],"source_content_type":"text/plain","patch_set":11,"id":"da86d52c_477178df","line":157,"updated":"2015-02-15 16:58:29.000000000","message":"this shouldn\u0027t be touched","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":154,"context_line":""},{"line_number":155,"context_line":"# \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d items for agent scheduler extension \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":156,"context_line":"# Driver to use for scheduling network to DHCP agent"},{"line_number":157,"context_line":"# network_scheduler_driver \u003d neutron.scheduler.base_scheduler.ChanceScheduler"},{"line_number":158,"context_line":"# Driver to use for scheduling router to a default L3 agent"},{"line_number":159,"context_line":"# router_scheduler_driver \u003d neutron.scheduler.l3_agent_scheduler.ChanceScheduler"},{"line_number":160,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"}],"source_content_type":"text/plain","patch_set":11,"id":"da86d52c_42f7a6f5","line":157,"in_reply_to":"da86d52c_477178df","updated":"2015-02-15 17:25:39.000000000","message":"We will think in this line ,","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f8082aea7b7f287bb18a72ef8ab8f13a099edf5f","unresolved":false,"context_lines":[{"line_number":160,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"},{"line_number":161,"context_line":"# loadbalancer_pool_scheduler_driver \u003d neutron.services.loadbalancer.agent_scheduler.ChanceScheduler"},{"line_number":162,"context_line":"# Filter to use for selecting agents to host resources."},{"line_number":163,"context_line":"# scheduler_filter \u003d DhcpFilter"},{"line_number":164,"context_line":"# Allow auto scheduling networks to DHCP agent. It will schedule non-hosted"},{"line_number":165,"context_line":"# networks to first DHCP agent which sends get_active_networks message to"},{"line_number":166,"context_line":"# neutron server"}],"source_content_type":"text/plain","patch_set":13,"id":"da86d52c_8a65d9e2","line":163,"updated":"2015-02-18 03:11:04.000000000","message":"I am puzzled as to whether this should be exposed or not. I find it complicated to understand and to use it. What if more filters needed to be added, how would that work?","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bfc23729ba16cd5fdb83992947b27c33b78d8d5b","unresolved":false,"context_lines":[{"line_number":160,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"},{"line_number":161,"context_line":"# loadbalancer_pool_scheduler_driver \u003d neutron.services.loadbalancer.agent_scheduler.ChanceScheduler"},{"line_number":162,"context_line":"# Filter to use for selecting agents to host resources."},{"line_number":163,"context_line":"# scheduler_filter \u003d DhcpFilter"},{"line_number":164,"context_line":"# Allow auto scheduling networks to DHCP agent. It will schedule non-hosted"},{"line_number":165,"context_line":"# networks to first DHCP agent which sends get_active_networks message to"},{"line_number":166,"context_line":"# neutron server"}],"source_content_type":"text/plain","patch_set":13,"id":"ba7be1f8_304e93c2","line":163,"in_reply_to":"da86d52c_2c9b0474","updated":"2015-02-20 15:15:54.000000000","message":"Armando, thanks for the detail explanation. Now I begin to understand the background of various concepts. The base concept sounds reasonable to me:\n\n- \"scheduler\" defines what algorithm is used to select agent(s) from candidates. The algorithm can be shared among various resources (networks, routers, pools..)\n- \"filter\" picks up candidates of agents for a resource\n\nI have several points which may need discussion.\n\n- (1) I am not sure that bind() belongs to \"scheduler\" or \"filter\".\nForm the perspective that \"scheduler\" makes a final decision, bind() in \"scheduler\" looks good, but \"scheduler\" is neutral on resource type... hmm\n- (2) we can have multiple types of \"filters\". Operators can select what they want. DhcpFilter seems too generic.\n\nRegarding the number of filters per resource, I am not sure we need to limit to one, but at now I don\u0027t see a need for multiple filter in neutron use cases.\n\nAnyway, thanks for helping me understand the concept.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5a33674315cf4f5d02ecceda110cc1969031199","unresolved":false,"context_lines":[{"line_number":160,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"},{"line_number":161,"context_line":"# loadbalancer_pool_scheduler_driver \u003d neutron.services.loadbalancer.agent_scheduler.ChanceScheduler"},{"line_number":162,"context_line":"# Filter to use for selecting agents to host resources."},{"line_number":163,"context_line":"# scheduler_filter \u003d DhcpFilter"},{"line_number":164,"context_line":"# Allow auto scheduling networks to DHCP agent. It will schedule non-hosted"},{"line_number":165,"context_line":"# networks to first DHCP agent which sends get_active_networks message to"},{"line_number":166,"context_line":"# neutron server"}],"source_content_type":"text/plain","patch_set":13,"id":"da86d52c_2c9b0474","line":163,"in_reply_to":"da86d52c_460cb5ec","updated":"2015-02-18 20:51:22.000000000","message":"Akihiro, your questions are very reasonable, and I am having a hard time wrapping my head around the proposed changes too :)\n\nI proposed the idea of \u0027filters\u0027 in this PS:\n\nhttps://review.openstack.org/#/c/137017/5/neutron/scheduler/dhcp_agent_scheduler.py\n\nand I further clarified it here:\n\nhttps://review.openstack.org/#/c/137017/11/neutron/scheduler/resource_filter.py\n\nIn hindsight, having chosen filter as word it\u0027s probably a mistake of mine as it\u0027s an overloaded term.\n\nHaving said that, I think the original goal of the spec was all along to introduce a dhcp scheduler that was scheduling based on network load. Now, that got me thinking: with the existing code structure the scheduler must be aware of the resource type, the agent intricacies, etc...We can add a LeastNetworkScheduler, but the code and the duplication effort will suck. We have a weight scheduler for L3 and one for DHCP, when in theory we could just have one, that applies the scheduling policy regardless of the resource. In my opinion the scheduler\u0027s sole job is to pick from a pool of entities based on some algorithm (round-robin, least used, last used, etc.). Hence the idea of \u0027filter\u0027 (a misnomer now), where we could wrap the resource-specific logic of determining what is the pool of agents to choose from.\n\nSo I was proposing to split the existing scheduler structure into two:\n\na) one that knows how to select/pick/determine the agents that are available to host the resource\n\nand \n\nb) one that knows how to select/schedule/bind the resource to the agent, based on some logic (random, load, etc)\n\n\nSo to your question, I see one filter per resource type, and the filter is the one that encapsulate the resource-specific logic and nothing else.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c4f880bde082bc798cf3979c502823081f69208b","unresolved":false,"context_lines":[{"line_number":160,"context_line":"# Driver to use for scheduling a loadbalancer pool to an lbaas agent"},{"line_number":161,"context_line":"# loadbalancer_pool_scheduler_driver \u003d neutron.services.loadbalancer.agent_scheduler.ChanceScheduler"},{"line_number":162,"context_line":"# Filter to use for selecting agents to host resources."},{"line_number":163,"context_line":"# scheduler_filter \u003d DhcpFilter"},{"line_number":164,"context_line":"# Allow auto scheduling networks to DHCP agent. It will schedule non-hosted"},{"line_number":165,"context_line":"# networks to first DHCP agent which sends get_active_networks message to"},{"line_number":166,"context_line":"# neutron server"}],"source_content_type":"text/plain","patch_set":13,"id":"da86d52c_460cb5ec","line":163,"in_reply_to":"da86d52c_8a65d9e2","updated":"2015-02-18 09:50:02.000000000","message":"I have questions on the base design (because it is not described the blueprint spec at all).\n\n- Is a scheduler filter shared by all resource type or defined per resource type? I think it is per resource type.\n- Do we have only one filter per resource type (e.g. network, router..) or can we define multiple filters per resource type? I think either is acceptable.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3136ead8546744cc82a5ecc37f19eaf53a4230b2","unresolved":false,"context_lines":[{"line_number":163,"context_line":"# (StrOpt) Representing the resource type whose load is being obtained by"},{"line_number":164,"context_line":"# the agent."},{"line_number":165,"context_line":"# This can be \u0027networks\u0027. When specified (Default is None), the server will"},{"line_number":166,"context_line":"# extract particular load sent as part of its configuration object from the"},{"line_number":167,"context_line":"# agent report state, which is the number of resources being consumed, at"},{"line_number":168,"context_line":"# every report_interval. Example: dhcp_load_type \u003d networks"},{"line_number":169,"context_line":"# dhcp_load_type \u003d"}],"source_content_type":"text/plain","patch_set":22,"id":"ba7be1f8_bc15604a","line":166,"updated":"2015-02-25 16:25:19.000000000","message":"its refers to the the agent, but in this context it sounds like it\u0027s the server, so this reads better if you explicitly say: agent\u0027s config object","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3136ead8546744cc82a5ecc37f19eaf53a4230b2","unresolved":false,"context_lines":[{"line_number":165,"context_line":"# This can be \u0027networks\u0027. When specified (Default is None), the server will"},{"line_number":166,"context_line":"# extract particular load sent as part of its configuration object from the"},{"line_number":167,"context_line":"# agent report state, which is the number of resources being consumed, at"},{"line_number":168,"context_line":"# every report_interval. Example: dhcp_load_type \u003d networks"},{"line_number":169,"context_line":"# dhcp_load_type \u003d"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"# Allow auto scheduling networks to DHCP agent. It will schedule non-hosted"}],"source_content_type":"text/plain","patch_set":22,"id":"ba7be1f8_97f15503","line":168,"updated":"2015-02-25 16:25:19.000000000","message":"I think that we should mention that dhcp_load_type can be used in combination with a network_scheduler_driver \u003d ...WeightScheduler.\n\nWhen the scheduler_driver is the weightScheduler, dhcp_load_type must be defined and it represents the choice for the resource being balanced.","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"53026be3d0ebf1d4e9720277ba4222e310aad174","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"# (StrOpt) Representing the resource type whose load is being reported by"},{"line_number":164,"context_line":"# the agent."},{"line_number":165,"context_line":"# This can be \u0027networks\u0027. When specified (Default is networks), the server will"},{"line_number":166,"context_line":"# extract particular load sent as part of its agent configuration object from"},{"line_number":167,"context_line":"# the agent report state, which is the number of resources being consumed, at"},{"line_number":168,"context_line":"# every report_interval."}],"source_content_type":"text/plain","patch_set":27,"id":"9a80dd14_adf5e9cc","line":165,"updated":"2015-03-04 07:37:53.000000000","message":"It seems subnets or ports can be specified here.\nWhy don\u0027t you mention config alternatives?","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"14e52e355f0bb5a4755fd4e5d2c0ccd473b5c198","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"# (StrOpt) Representing the resource type whose load is being reported by"},{"line_number":164,"context_line":"# the agent."},{"line_number":165,"context_line":"# This can be \u0027networks\u0027. When specified (Default is networks), the server will"},{"line_number":166,"context_line":"# extract particular load sent as part of its agent configuration object from"},{"line_number":167,"context_line":"# the agent report state, which is the number of resources being consumed, at"},{"line_number":168,"context_line":"# every report_interval."}],"source_content_type":"text/plain","patch_set":27,"id":"9a80dd14_e1889724","line":165,"in_reply_to":"9a80dd14_5387a761","updated":"2015-03-05 07:06:22.000000000","message":"If dhcp_load_type can be other than networks, it should be documented.  If not, dhcp_load_type isn\u0027t configurable and this just confuses cloud admins, I think.","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"44a929472be94f88ccc6569b95225e13c87b699e","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"# (StrOpt) Representing the resource type whose load is being reported by"},{"line_number":164,"context_line":"# the agent."},{"line_number":165,"context_line":"# This can be \u0027networks\u0027. When specified (Default is networks), the server will"},{"line_number":166,"context_line":"# extract particular load sent as part of its agent configuration object from"},{"line_number":167,"context_line":"# the agent report state, which is the number of resources being consumed, at"},{"line_number":168,"context_line":"# every report_interval."}],"source_content_type":"text/plain","patch_set":27,"id":"9a80dd14_5387a761","line":165,"in_reply_to":"9a80dd14_adf5e9cc","updated":"2015-03-04 10:19:49.000000000","message":"It is valid point. If the community agrees we can add these also.","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"1dd62bb0dfab5e2a255eb08176dd9883faf38fe6","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"# (StrOpt) Representing the resource type whose load is being reported by"},{"line_number":164,"context_line":"# the agent."},{"line_number":165,"context_line":"# This can be \u0027networks\u0027. When specified (Default is networks), the server will"},{"line_number":166,"context_line":"# extract particular load sent as part of its agent configuration object from"},{"line_number":167,"context_line":"# the agent report state, which is the number of resources being consumed, at"},{"line_number":168,"context_line":"# every report_interval."}],"source_content_type":"text/plain","patch_set":27,"id":"9a80dd14_d5dd0472","line":165,"in_reply_to":"9a80dd14_e1889724","updated":"2015-03-05 10:33:36.000000000","message":"Done","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"6195ab50e78fe53210e307d769f004c069f58891","unresolved":false,"context_lines":[{"line_number":171,"context_line":"# When the network_scheduler_driver is WeightScheduler, dhcp_load_type must"},{"line_number":172,"context_line":"# be defined and it represents the choice for the resource being balanced."},{"line_number":173,"context_line":"# Example: dhcp_load_type \u003d networks"},{"line_number":174,"context_line":"# dhcp_load_type \u003d networks"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"# Allow auto scheduling networks to DHCP agent. It will schedule non-hosted"},{"line_number":177,"context_line":"# networks to first DHCP agent which sends get_active_networks message to"}],"source_content_type":"text/plain","patch_set":29,"id":"9a80dd14_3482eb4f","line":174,"updated":"2015-03-05 07:25:37.000000000","message":"it seems this can be \u0027networks, subnets and ports\u0027","commit_id":"e6707cdd8325cc4be3d92995709e43af09bf1fb0"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"8d21aa868b5422a7bd0277fa630f04478773eca1","unresolved":false,"context_lines":[{"line_number":171,"context_line":"# When the network_scheduler_driver is WeightScheduler, dhcp_load_type must"},{"line_number":172,"context_line":"# be defined and it represents the choice for the resource being balanced."},{"line_number":173,"context_line":"# Example: dhcp_load_type \u003d networks"},{"line_number":174,"context_line":"# dhcp_load_type \u003d networks"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"# Allow auto scheduling networks to DHCP agent. It will schedule non-hosted"},{"line_number":177,"context_line":"# networks to first DHCP agent which sends get_active_networks message to"}],"source_content_type":"text/plain","patch_set":29,"id":"9a80dd14_555f54e5","line":174,"in_reply_to":"9a80dd14_3482eb4f","updated":"2015-03-05 10:34:03.000000000","message":"Done","commit_id":"e6707cdd8325cc4be3d92995709e43af09bf1fb0"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"79b3291e8f37739fd29f7750fb570eee520150b4","unresolved":false,"context_lines":[{"line_number":163,"context_line":"# (StrOpt) Representing the resource type whose load is being reported by"},{"line_number":164,"context_line":"# the agent."},{"line_number":165,"context_line":"# This can be \u0027networks\u0027,\u0027subnets\u0027 or \u0027ports\u0027. When specified (Default is networks),"},{"line_number":166,"context_line":"# the server will extract particular load sent as part of its agent configuration object "},{"line_number":167,"context_line":"# from the agent report state, which is the number of resources being consumed, at"},{"line_number":168,"context_line":"# every report_interval."},{"line_number":169,"context_line":"# dhcp_load_type can be used in combination with network_scheduler_driver \u003d"}],"source_content_type":"text/plain","patch_set":30,"id":"9a80dd14_3660e100","line":166,"range":{"start_line":166,"start_character":82,"end_line":166,"end_character":88},"updated":"2015-03-06 14:33:08.000000000","message":"nit: white space at EOL","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"79b3291e8f37739fd29f7750fb570eee520150b4","unresolved":false,"context_lines":[{"line_number":169,"context_line":"# dhcp_load_type can be used in combination with network_scheduler_driver \u003d"},{"line_number":170,"context_line":"# neutron.scheduler.dhcp_agent_scheduler.WeightScheduler"},{"line_number":171,"context_line":"# When the network_scheduler_driver is WeightScheduler, dhcp_load_type must"},{"line_number":172,"context_line":"# be defined and it represents the choice for the resource being balanced."},{"line_number":173,"context_line":"# Example: dhcp_load_type \u003d networks"},{"line_number":174,"context_line":"# Values:"},{"line_number":175,"context_line":"#   networks - number of networks hosted on the agent"}],"source_content_type":"text/plain","patch_set":30,"id":"9a80dd14_79496a5f","line":172,"updated":"2015-03-06 14:33:08.000000000","message":"dhcp_load_type has the default value \"networks\", so I don\u0027t think we need to mention \"must be defined\" here. How about the following?\n\n  dhcp_load_type should be configured to represent ....","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"}],"neutron/agent/common/config.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    cfg.StrOpt(\u0027load_type\u0027, default\u003dNone,"},{"line_number":42,"context_line":"              help\u003d_(\u0027StrOpt representing the resource type whose load is\u0027"},{"line_number":43,"context_line":"                     \u0027being tracked by the agent.\u0027"},{"line_number":44,"context_line":"                     \u0027This can be \"networks\", \"namespaces\", etc.\u0027"},{"line_number":45,"context_line":"                     \u0027When specified (Default is None), the agent will report,\u0027"},{"line_number":46,"context_line":"                     \u0027as part of its configuration object, the number of\u0027"},{"line_number":47,"context_line":"                     \u0027resources being consumed, at every report_interval.\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_3d073e1f","line":44,"updated":"2015-02-14 22:07:53.000000000","message":"How can an operator know what kind of resource can be specified for this option? It is worth mentioned in the help message. This description is also used in the configuration guide.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    cfg.StrOpt(\u0027load_type\u0027, default\u003dNone,"},{"line_number":42,"context_line":"              help\u003d_(\u0027StrOpt representing the resource type whose load is\u0027"},{"line_number":43,"context_line":"                     \u0027being tracked by the agent.\u0027"},{"line_number":44,"context_line":"                     \u0027This can be \"networks\", \"namespaces\", etc.\u0027"},{"line_number":45,"context_line":"                     \u0027When specified (Default is None), the agent will report,\u0027"},{"line_number":46,"context_line":"                     \u0027as part of its configuration object, the number of\u0027"},{"line_number":47,"context_line":"                     \u0027resources being consumed, at every report_interval.\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_f3779606","line":44,"in_reply_to":"da86d52c_3d073e1f","updated":"2015-02-15 07:16:08.000000000","message":"Done","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                     \u0027being tracked by the agent.\u0027"},{"line_number":44,"context_line":"                     \u0027This can be \"networks\", \"namespaces\", etc.\u0027"},{"line_number":45,"context_line":"                     \u0027When specified (Default is None), the agent will report,\u0027"},{"line_number":46,"context_line":"                     \u0027as part of its configuration object, the number of\u0027"},{"line_number":47,"context_line":"                     \u0027resources being consumed, at every report_interval.\u0027"},{"line_number":48,"context_line":"                     \u0027It is worth noting that this must be consistent across\u0027"},{"line_number":49,"context_line":"                     \u0027all the agents of the same category (dhcp, L3, etc).\u0027)),"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_dd10e25b","line":46,"updated":"2015-02-14 22:07:53.000000000","message":"Now \"load_type\" is not a part of \"configuration\". Please update the description.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                     \u0027being tracked by the agent.\u0027"},{"line_number":44,"context_line":"                     \u0027This can be \"networks\", \"namespaces\", etc.\u0027"},{"line_number":45,"context_line":"                     \u0027When specified (Default is None), the agent will report,\u0027"},{"line_number":46,"context_line":"                     \u0027as part of its configuration object, the number of\u0027"},{"line_number":47,"context_line":"                     \u0027resources being consumed, at every report_interval.\u0027"},{"line_number":48,"context_line":"                     \u0027It is worth noting that this must be consistent across\u0027"},{"line_number":49,"context_line":"                     \u0027all the agents of the same category (dhcp, L3, etc).\u0027)),"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_137d0ae8","line":46,"in_reply_to":"da86d52c_dd10e25b","updated":"2015-02-15 07:16:08.000000000","message":"Done","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":46,"context_line":"                     \u0027as part of its configuration object, the number of\u0027"},{"line_number":47,"context_line":"                     \u0027resources being consumed, at every report_interval.\u0027"},{"line_number":48,"context_line":"                     \u0027It is worth noting that this must be consistent across\u0027"},{"line_number":49,"context_line":"                     \u0027all the agents of the same category (dhcp, L3, etc).\u0027)),"},{"line_number":50,"context_line":"]"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"INTERFACE_DRIVER_OPTS \u003d ["}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_7d01b605","line":49,"updated":"2015-02-14 22:07:53.000000000","message":"Is it worth mentioned now? At now only dhcp agent supports this feature and I am not sure it is worth mentioned here.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":46,"context_line":"                     \u0027as part of its configuration object, the number of\u0027"},{"line_number":47,"context_line":"                     \u0027resources being consumed, at every report_interval.\u0027"},{"line_number":48,"context_line":"                     \u0027It is worth noting that this must be consistent across\u0027"},{"line_number":49,"context_line":"                     \u0027all the agents of the same category (dhcp, L3, etc).\u0027)),"},{"line_number":50,"context_line":"]"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"INTERFACE_DRIVER_OPTS \u003d ["}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_93681a23","line":49,"in_reply_to":"da86d52c_7d01b605","updated":"2015-02-15 07:16:08.000000000","message":"Currently, only dhcp supports load type. But, subsequently all agents will be supported. Till then, we can remove it from help message, I think.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"fe8a1f417f5e207015165aa8cfe526d795a8090e","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                        \u0027should be less than agent_down_time, best if it \u0027"},{"line_number":40,"context_line":"                        \u0027is half or less than agent_down_time.\u0027)),"},{"line_number":41,"context_line":"    cfg.StrOpt(\u0027load_type\u0027, default\u003dNone,"},{"line_number":42,"context_line":"              help\u003d_(\u0027StrOpt representing the resource type whose load is\u0027"},{"line_number":43,"context_line":"                     \u0027being tracked by the agent.\u0027"},{"line_number":44,"context_line":"                     \u0027This can be \"networks\", \"namespaces\", etc.\u0027"},{"line_number":45,"context_line":"                     \u0027When specified (Default is None), the agent will report,\u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_1c7d17e8","line":42,"updated":"2015-02-15 13:47:49.000000000","message":"We should not write stropt in help msg,\n\n\nhelp\u003d_(Representing ..... )","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                        \u0027should be less than agent_down_time, best if it \u0027"},{"line_number":40,"context_line":"                        \u0027is half or less than agent_down_time.\u0027)),"},{"line_number":41,"context_line":"    cfg.StrOpt(\u0027load_type\u0027, default\u003dNone,"},{"line_number":42,"context_line":"              help\u003d_(\u0027StrOpt representing the resource type whose load is\u0027"},{"line_number":43,"context_line":"                     \u0027being tracked by the agent.\u0027"},{"line_number":44,"context_line":"                     \u0027This can be \"networks\", \"namespaces\", etc.\u0027"},{"line_number":45,"context_line":"                     \u0027When specified (Default is None), the agent will report,\u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_07c060df","line":42,"in_reply_to":"da86d52c_1c7d17e8","updated":"2015-02-15 17:25:39.000000000","message":"Agreed","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c4f880bde082bc798cf3979c502823081f69208b","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    cfg.StrOpt(\u0027load_type\u0027, default\u003dNone,"},{"line_number":42,"context_line":"              help\u003d_(\u0027Representing the resource type whose load is being\u0027"},{"line_number":43,"context_line":"                     \u0027tracked by the agent.\u0027"},{"line_number":44,"context_line":"                     \u0027This can be \"networks\", \"namespaces\", etc.\u0027"},{"line_number":45,"context_line":"                     \u0027When specified (Default is None), the agent will report,\u0027"},{"line_number":46,"context_line":"                     \u0027as part of its configuration object, the number of\u0027"},{"line_number":47,"context_line":"                     \u0027resources being consumed, at every report_interval.\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_537f1917","line":44,"updated":"2015-02-18 09:50:02.000000000","message":"How can we know a list of available keywords for \"load_type\"? Who defines the list? Is it defined by each agent? For exmaple, for dhcp-agent, networks, namespaces, subnets? For l3-agent, routers, FIPs, namespaces, interfaces?\n\nThis sentence is used for the configuration guide and operators refer to the document, so this description should be clearer for operators (not for developers).","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bfc23729ba16cd5fdb83992947b27c33b78d8d5b","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    cfg.StrOpt(\u0027load_type\u0027, default\u003dNone,"},{"line_number":42,"context_line":"              help\u003d_(\u0027Representing the resource type whose load is being\u0027"},{"line_number":43,"context_line":"                     \u0027tracked by the agent.\u0027"},{"line_number":44,"context_line":"                     \u0027This can be \"networks\", \"namespaces\", etc.\u0027"},{"line_number":45,"context_line":"                     \u0027When specified (Default is None), the agent will report,\u0027"},{"line_number":46,"context_line":"                     \u0027as part of its configuration object, the number of\u0027"},{"line_number":47,"context_line":"                     \u0027resources being consumed, at every report_interval.\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba7be1f8_37492dd1","line":44,"in_reply_to":"da86d52c_2c4a24ad","updated":"2015-02-20 15:15:54.000000000","message":"I agree. If we have better scheduler, we will use only that scheduler. At now almost all use nova filter scheduler.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5a33674315cf4f5d02ecceda110cc1969031199","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    cfg.StrOpt(\u0027load_type\u0027, default\u003dNone,"},{"line_number":42,"context_line":"              help\u003d_(\u0027Representing the resource type whose load is being\u0027"},{"line_number":43,"context_line":"                     \u0027tracked by the agent.\u0027"},{"line_number":44,"context_line":"                     \u0027This can be \"networks\", \"namespaces\", etc.\u0027"},{"line_number":45,"context_line":"                     \u0027When specified (Default is None), the agent will report,\u0027"},{"line_number":46,"context_line":"                     \u0027as part of its configuration object, the number of\u0027"},{"line_number":47,"context_line":"                     \u0027resources being consumed, at every report_interval.\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_2c4a24ad","line":44,"in_reply_to":"da86d52c_35da854b","updated":"2015-02-18 20:51:22.000000000","message":"The way I see it is that this option controls what resource the WeightScheduler is going to act on. In the long term I personally see only a single WeightScheduler, and based on the load type determined here agents will report the specific load (for instance router count, or network count). This means that the WeightScheduler *is* actually a LeastRouters or a LeastNetworks respectively.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"75694cc2eff2d05b439af4198bd678614e56a323","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    cfg.StrOpt(\u0027load_type\u0027, default\u003dNone,"},{"line_number":42,"context_line":"              help\u003d_(\u0027Representing the resource type whose load is being\u0027"},{"line_number":43,"context_line":"                     \u0027tracked by the agent.\u0027"},{"line_number":44,"context_line":"                     \u0027This can be \"networks\", \"namespaces\", etc.\u0027"},{"line_number":45,"context_line":"                     \u0027When specified (Default is None), the agent will report,\u0027"},{"line_number":46,"context_line":"                     \u0027as part of its configuration object, the number of\u0027"},{"line_number":47,"context_line":"                     \u0027resources being consumed, at every report_interval.\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_35da854b","line":44,"in_reply_to":"da86d52c_537f1917","updated":"2015-02-18 12:17:02.000000000","message":"Agreed, We have to modify the description.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c4f880bde082bc798cf3979c502823081f69208b","unresolved":false,"context_lines":[{"line_number":42,"context_line":"              help\u003d_(\u0027Representing the resource type whose load is being\u0027"},{"line_number":43,"context_line":"                     \u0027tracked by the agent.\u0027"},{"line_number":44,"context_line":"                     \u0027This can be \"networks\", \"namespaces\", etc.\u0027"},{"line_number":45,"context_line":"                     \u0027When specified (Default is None), the agent will report,\u0027"},{"line_number":46,"context_line":"                     \u0027as part of its configuration object, the number of\u0027"},{"line_number":47,"context_line":"                     \u0027resources being consumed, at every report_interval.\u0027"},{"line_number":48,"context_line":"                     \u0027It is worth noting that this must be consistent across\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_33954533","line":45,"updated":"2015-02-18 09:50:02.000000000","message":"If this option is NOT specified, how does the scheduler behave?","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"75694cc2eff2d05b439af4198bd678614e56a323","unresolved":false,"context_lines":[{"line_number":42,"context_line":"              help\u003d_(\u0027Representing the resource type whose load is being\u0027"},{"line_number":43,"context_line":"                     \u0027tracked by the agent.\u0027"},{"line_number":44,"context_line":"                     \u0027This can be \"networks\", \"namespaces\", etc.\u0027"},{"line_number":45,"context_line":"                     \u0027When specified (Default is None), the agent will report,\u0027"},{"line_number":46,"context_line":"                     \u0027as part of its configuration object, the number of\u0027"},{"line_number":47,"context_line":"                     \u0027resources being consumed, at every report_interval.\u0027"},{"line_number":48,"context_line":"                     \u0027It is worth noting that this must be consistent across\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_d565a9af","line":45,"in_reply_to":"da86d52c_33954533","updated":"2015-02-18 12:17:02.000000000","message":"ChanceScheduler will work without any issue, but WeightScheduler will not work as load column will be 0.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5a33674315cf4f5d02ecceda110cc1969031199","unresolved":false,"context_lines":[{"line_number":42,"context_line":"              help\u003d_(\u0027Representing the resource type whose load is being\u0027"},{"line_number":43,"context_line":"                     \u0027tracked by the agent.\u0027"},{"line_number":44,"context_line":"                     \u0027This can be \"networks\", \"namespaces\", etc.\u0027"},{"line_number":45,"context_line":"                     \u0027When specified (Default is None), the agent will report,\u0027"},{"line_number":46,"context_line":"                     \u0027as part of its configuration object, the number of\u0027"},{"line_number":47,"context_line":"                     \u0027resources being consumed, at every report_interval.\u0027"},{"line_number":48,"context_line":"                     \u0027It is worth noting that this must be consistent across\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_ec880cc8","line":45,"in_reply_to":"da86d52c_33954533","updated":"2015-02-18 20:51:22.000000000","message":"I think this option make sense only when the scheduler is a WeightScheduler as specified here:\n\nhttps://github.com/openstack/neutron/blob/master/etc/neutron.conf#L155","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"bb1b898b1c53655249a08e6ee4faa7d4f905c637","unresolved":false,"context_lines":[{"line_number":43,"context_line":"DHCP_LOAD_TYPE_OPTS \u003d ["},{"line_number":44,"context_line":"    cfg.StrOpt(\u0027dhcp_load_type\u0027, default\u003d\u0027networks\u0027,"},{"line_number":45,"context_line":"               help\u003d_(\u0027Representing the resource type whose load is being \u0027"},{"line_number":46,"context_line":"                      \u0027obtained by the agent. This can be \"networks\".\u0027"},{"line_number":47,"context_line":"                      \u0027When specified (Default is networks), the server will \u0027"},{"line_number":48,"context_line":"                      \u0027extract particular load sent as part of its agent \u0027"},{"line_number":49,"context_line":"                      \u0027configuration object from the agent report state, \u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_93a2a949","line":46,"updated":"2015-03-02 08:10:21.000000000","message":"obtained -\u003e reported","commit_id":"1ee0a3ccb9516e9dcbdad3584aa897d5ba36e6de"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"40f7c2188a653eebe5970ef1acfc5ca36fa9901d","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    conf.register_opts(INTERFACE_DRIVER_OPTS)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"def register_dhcp_load_type_opts_helper(conf):"},{"line_number":126,"context_line":"    conf.register_opts(DHCP_LOAD_TYPE_OPTS)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_21d8d97e","line":125,"updated":"2015-02-28 18:06:09.000000000","message":"you\u0027re explicitly registering the opt only from the agent file; I believe the server won\u0027t be able to see any other value rather than the default. I think this should be registered via module import, like the scheduler_driver config. I am unsure as to the best location for this though.","commit_id":"1ee0a3ccb9516e9dcbdad3584aa897d5ba36e6de"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"1c1d105ba94b2b861b3bf4c97f80956893f29a84","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    conf.register_opts(INTERFACE_DRIVER_OPTS)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"def register_dhcp_load_type_opts_helper(conf):"},{"line_number":126,"context_line":"    conf.register_opts(DHCP_LOAD_TYPE_OPTS)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_883e05d9","line":125,"in_reply_to":"ba7be1f8_21d8d97e","updated":"2015-03-01 09:49:07.000000000","message":"I have implemented this by taking reference of report_interval parameter. I will test this and try to make changes suggested by you.","commit_id":"1ee0a3ccb9516e9dcbdad3584aa897d5ba36e6de"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"32b24f1ce6efc0099e66c6d9a6ccba28465491b0","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    conf.register_opts(INTERFACE_DRIVER_OPTS)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"def register_dhcp_load_type_opts_helper(conf):"},{"line_number":126,"context_line":"    conf.register_opts(DHCP_LOAD_TYPE_OPTS)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_fdfbb644","line":125,"in_reply_to":"ba7be1f8_21d8d97e","updated":"2015-03-02 06:48:16.000000000","message":"dhcp_load_type  is assigned to load_type which is added in configurations dict of agent report status. Hence we are currently using this parameter only in agent side. So we are not sure how this parameter will be useful in server side. Please help us to understand.","commit_id":"1ee0a3ccb9516e9dcbdad3584aa897d5ba36e6de"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"bb1b898b1c53655249a08e6ee4faa7d4f905c637","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    conf.register_opts(INTERFACE_DRIVER_OPTS)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"def register_dhcp_load_type_opts_helper(conf):"},{"line_number":126,"context_line":"    conf.register_opts(DHCP_LOAD_TYPE_OPTS)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_5398311b","line":125,"in_reply_to":"ba7be1f8_fdfbb644","updated":"2015-03-02 08:10:21.000000000","message":"You\u0027re right, it was a brainfart of mine. Please disregard my last comment.","commit_id":"1ee0a3ccb9516e9dcbdad3584aa897d5ba36e6de"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"53026be3d0ebf1d4e9720277ba4222e310aad174","unresolved":false,"context_lines":[{"line_number":43,"context_line":"DHCP_LOAD_TYPE_OPTS \u003d ["},{"line_number":44,"context_line":"    cfg.StrOpt(\u0027dhcp_load_type\u0027, default\u003d\u0027networks\u0027,"},{"line_number":45,"context_line":"               help\u003d_(\u0027Representing the resource type whose load is being \u0027"},{"line_number":46,"context_line":"                      \u0027reported by the agent. This can be \"networks\".\u0027"},{"line_number":47,"context_line":"                      \u0027When specified (Default is networks), the server will \u0027"},{"line_number":48,"context_line":"                      \u0027extract particular load sent as part of its agent \u0027"},{"line_number":49,"context_line":"                      \u0027configuration object from the agent report state, \u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_6de21105","line":46,"updated":"2015-03-04 07:37:53.000000000","message":"There must be a space after the trailing period.","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"44a929472be94f88ccc6569b95225e13c87b699e","unresolved":false,"context_lines":[{"line_number":43,"context_line":"DHCP_LOAD_TYPE_OPTS \u003d ["},{"line_number":44,"context_line":"    cfg.StrOpt(\u0027dhcp_load_type\u0027, default\u003d\u0027networks\u0027,"},{"line_number":45,"context_line":"               help\u003d_(\u0027Representing the resource type whose load is being \u0027"},{"line_number":46,"context_line":"                      \u0027reported by the agent. This can be \"networks\".\u0027"},{"line_number":47,"context_line":"                      \u0027When specified (Default is networks), the server will \u0027"},{"line_number":48,"context_line":"                      \u0027extract particular load sent as part of its agent \u0027"},{"line_number":49,"context_line":"                      \u0027configuration object from the agent report state, \u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_93cf5fb0","line":46,"in_reply_to":"9a80dd14_6de21105","updated":"2015-03-04 10:19:49.000000000","message":"We referred AGENT_STATE_OPTS however we can modify this if it is not correct.","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"53026be3d0ebf1d4e9720277ba4222e310aad174","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                      \u0027extract particular load sent as part of its agent \u0027"},{"line_number":49,"context_line":"                      \u0027configuration object from the agent report state, \u0027"},{"line_number":50,"context_line":"                      \u0027which is the number of resources being consumed, at \u0027"},{"line_number":51,"context_line":"                      \u0027every report_interval.\u0027"},{"line_number":52,"context_line":"                      \u0027dhcp_load_type can be used in combination with \u0027"},{"line_number":53,"context_line":"                      \u0027network_scheduler_driver \u003d neutron.scheduler.\u0027"},{"line_number":54,"context_line":"                      \u0027dhcp_agent_scheduler.WeightScheduler \u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_cdf05dcc","line":51,"updated":"2015-03-04 07:37:53.000000000","message":"ditto\n\nAlso for L.53 and L.57.","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"1dd62bb0dfab5e2a255eb08176dd9883faf38fe6","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                      \u0027extract particular load sent as part of its agent \u0027"},{"line_number":49,"context_line":"                      \u0027configuration object from the agent report state, \u0027"},{"line_number":50,"context_line":"                      \u0027which is the number of resources being consumed, at \u0027"},{"line_number":51,"context_line":"                      \u0027every report_interval.\u0027"},{"line_number":52,"context_line":"                      \u0027dhcp_load_type can be used in combination with \u0027"},{"line_number":53,"context_line":"                      \u0027network_scheduler_driver \u003d neutron.scheduler.\u0027"},{"line_number":54,"context_line":"                      \u0027dhcp_agent_scheduler.WeightScheduler \u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_f5bf68fa","line":51,"in_reply_to":"9a80dd14_3304f37d","updated":"2015-03-05 10:33:36.000000000","message":"Done","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"02858dd5baa16051e27d1c10dbd438e46c00a0bc","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                      \u0027extract particular load sent as part of its agent \u0027"},{"line_number":49,"context_line":"                      \u0027configuration object from the agent report state, \u0027"},{"line_number":50,"context_line":"                      \u0027which is the number of resources being consumed, at \u0027"},{"line_number":51,"context_line":"                      \u0027every report_interval.\u0027"},{"line_number":52,"context_line":"                      \u0027dhcp_load_type can be used in combination with \u0027"},{"line_number":53,"context_line":"                      \u0027network_scheduler_driver \u003d neutron.scheduler.\u0027"},{"line_number":54,"context_line":"                      \u0027dhcp_agent_scheduler.WeightScheduler \u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_3304f37d","line":51,"in_reply_to":"9a80dd14_533c0794","updated":"2015-03-04 10:23:34.000000000","message":"So prefer to wrap the line after \u003d","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"44a929472be94f88ccc6569b95225e13c87b699e","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                      \u0027extract particular load sent as part of its agent \u0027"},{"line_number":49,"context_line":"                      \u0027configuration object from the agent report state, \u0027"},{"line_number":50,"context_line":"                      \u0027which is the number of resources being consumed, at \u0027"},{"line_number":51,"context_line":"                      \u0027every report_interval.\u0027"},{"line_number":52,"context_line":"                      \u0027dhcp_load_type can be used in combination with \u0027"},{"line_number":53,"context_line":"                      \u0027network_scheduler_driver \u003d neutron.scheduler.\u0027"},{"line_number":54,"context_line":"                      \u0027dhcp_agent_scheduler.WeightScheduler \u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_533c0794","line":51,"in_reply_to":"9a80dd14_cdf05dcc","updated":"2015-03-04 10:19:49.000000000","message":"L53 and L54 together is a single line so not sure whether we need to add space for L53.","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"4ee435112ee9a3fddface63bc0f675567d144156","unresolved":false,"context_lines":[{"line_number":41,"context_line":"]"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"DHCP_LOAD_TYPE_OPTS \u003d ["},{"line_number":44,"context_line":"    cfg.StrOpt(\u0027dhcp_load_type\u0027, default\u003d\u0027networks\u0027,"},{"line_number":45,"context_line":"               help\u003d_(\u0027Representing the resource type whose load is being \u0027"},{"line_number":46,"context_line":"                      \u0027reported by the agent. This can be \"networks\". \u0027"},{"line_number":47,"context_line":"                      \u0027When specified (Default is networks), the server will \u0027"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_b446dbbd","line":44,"updated":"2015-03-05 07:38:05.000000000","message":"are there limited choices, if so we should have choices\u003d(\u0027networks\u0027, \u0027foo\u0027, \u0027bar\u0027),","commit_id":"e6707cdd8325cc4be3d92995709e43af09bf1fb0"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"8d21aa868b5422a7bd0277fa630f04478773eca1","unresolved":false,"context_lines":[{"line_number":41,"context_line":"]"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"DHCP_LOAD_TYPE_OPTS \u003d ["},{"line_number":44,"context_line":"    cfg.StrOpt(\u0027dhcp_load_type\u0027, default\u003d\u0027networks\u0027,"},{"line_number":45,"context_line":"               help\u003d_(\u0027Representing the resource type whose load is being \u0027"},{"line_number":46,"context_line":"                      \u0027reported by the agent. This can be \"networks\". \u0027"},{"line_number":47,"context_line":"                      \u0027When specified (Default is networks), the server will \u0027"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_b55c10ef","line":44,"in_reply_to":"9a80dd14_b446dbbd","updated":"2015-03-05 10:34:03.000000000","message":"Done","commit_id":"e6707cdd8325cc4be3d92995709e43af09bf1fb0"}],"neutron/agent/dhcp/agent.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"4ee435112ee9a3fddface63bc0f675567d144156","unresolved":false,"context_lines":[{"line_number":534,"context_line":"            \u0027host\u0027: host,"},{"line_number":535,"context_line":"            \u0027topic\u0027: topics.DHCP_AGENT,"},{"line_number":536,"context_line":"            \u0027configurations\u0027: {"},{"line_number":537,"context_line":"                \u0027load_type\u0027: cfg.CONF.dhcp_load_type,"},{"line_number":538,"context_line":"                \u0027dhcp_driver\u0027: cfg.CONF.dhcp_driver,"},{"line_number":539,"context_line":"                \u0027use_namespaces\u0027: cfg.CONF.use_namespaces,"},{"line_number":540,"context_line":"                \u0027dhcp_lease_duration\u0027: cfg.CONF.dhcp_lease_duration},"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_b41dfbbf","line":537,"updated":"2015-03-05 07:38:05.000000000","message":"what if there are conflicting load types? that is agent 1 has networks, agent 2 has subnets?","commit_id":"e6707cdd8325cc4be3d92995709e43af09bf1fb0"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"8d21aa868b5422a7bd0277fa630f04478773eca1","unresolved":false,"context_lines":[{"line_number":534,"context_line":"            \u0027host\u0027: host,"},{"line_number":535,"context_line":"            \u0027topic\u0027: topics.DHCP_AGENT,"},{"line_number":536,"context_line":"            \u0027configurations\u0027: {"},{"line_number":537,"context_line":"                \u0027load_type\u0027: cfg.CONF.dhcp_load_type,"},{"line_number":538,"context_line":"                \u0027dhcp_driver\u0027: cfg.CONF.dhcp_driver,"},{"line_number":539,"context_line":"                \u0027use_namespaces\u0027: cfg.CONF.use_namespaces,"},{"line_number":540,"context_line":"                \u0027dhcp_lease_duration\u0027: cfg.CONF.dhcp_lease_duration},"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_f5ccc863","line":537,"in_reply_to":"9a80dd14_b41dfbbf","updated":"2015-03-05 10:34:03.000000000","message":"dhcp_load_type config needs to be same across all reporting dhcp agents. Else, it would to result in improper distribution of networks.","commit_id":"e6707cdd8325cc4be3d92995709e43af09bf1fb0"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"79b3291e8f37739fd29f7750fb570eee520150b4","unresolved":false,"context_lines":[{"line_number":534,"context_line":"            \u0027host\u0027: host,"},{"line_number":535,"context_line":"            \u0027topic\u0027: topics.DHCP_AGENT,"},{"line_number":536,"context_line":"            \u0027configurations\u0027: {"},{"line_number":537,"context_line":"                \u0027load_type\u0027: cfg.CONF.dhcp_load_type,"},{"line_number":538,"context_line":"                \u0027dhcp_driver\u0027: cfg.CONF.dhcp_driver,"},{"line_number":539,"context_line":"                \u0027use_namespaces\u0027: cfg.CONF.use_namespaces,"},{"line_number":540,"context_line":"                \u0027dhcp_lease_duration\u0027: cfg.CONF.dhcp_lease_duration},"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_3439b941","line":537,"updated":"2015-03-06 14:33:08.000000000","message":"I just wonder why dhcp-agent needs to report load_type.\ndhcp-agent already sends all information on the load (networks, subnets, ports), so I think we don\u0027t need to send load_type from dhcp-agent. Can we move dhcp_load_type to neutron-server configuration?\n\nIf dhcp_load_type is reported from dhcp-agent, when we want to change load_type from one to another on a working deployment, neutron-server will see different load_types during configuraiton updates for agents. if we have load_type config on the server side, I think things become easier.","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"b65bc67804685ac50e2ba83d4645868fabd10eef","unresolved":false,"context_lines":[{"line_number":534,"context_line":"            \u0027host\u0027: host,"},{"line_number":535,"context_line":"            \u0027topic\u0027: topics.DHCP_AGENT,"},{"line_number":536,"context_line":"            \u0027configurations\u0027: {"},{"line_number":537,"context_line":"                \u0027load_type\u0027: cfg.CONF.dhcp_load_type,"},{"line_number":538,"context_line":"                \u0027dhcp_driver\u0027: cfg.CONF.dhcp_driver,"},{"line_number":539,"context_line":"                \u0027use_namespaces\u0027: cfg.CONF.use_namespaces,"},{"line_number":540,"context_line":"                \u0027dhcp_lease_duration\u0027: cfg.CONF.dhcp_lease_duration},"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_191a5cc6","line":537,"in_reply_to":"9a80dd14_1625d0ad","updated":"2015-03-18 09:43:43.000000000","message":"This proposal will duplicate the information which is already present in configurations dict sent by agent report status.\nAlso it will increase the computation on the server side .i,e server needs to fetch the values from load_info dict and sort it.\n\nBut the current implemented design will just take load_type and populate the load column by reusing values in configurations dict.\nAnd sorting is also straight forward because of direct sorting on load column.","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0b0703b7023117588a73352ce7ccfdfd7ca2c92c","unresolved":false,"context_lines":[{"line_number":534,"context_line":"            \u0027host\u0027: host,"},{"line_number":535,"context_line":"            \u0027topic\u0027: topics.DHCP_AGENT,"},{"line_number":536,"context_line":"            \u0027configurations\u0027: {"},{"line_number":537,"context_line":"                \u0027load_type\u0027: cfg.CONF.dhcp_load_type,"},{"line_number":538,"context_line":"                \u0027dhcp_driver\u0027: cfg.CONF.dhcp_driver,"},{"line_number":539,"context_line":"                \u0027use_namespaces\u0027: cfg.CONF.use_namespaces,"},{"line_number":540,"context_line":"                \u0027dhcp_lease_duration\u0027: cfg.CONF.dhcp_lease_duration},"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_fda8dd8e","line":537,"in_reply_to":"9a80dd14_3439b941","updated":"2015-03-06 16:52:03.000000000","message":"If we don\u0027t make the agent report a \u0027load_type\u0027 we\u0027d need to make the agent_db\u0027s logic polluted by either we\u0027re reporting dhcp\u0027s load type or anything else. See:\n\nhttps://review.openstack.org/#/c/137017/30/neutron/db/agents_db.py\n\nIf we load_type was a server-side configuration, how would we be able to be agnostic of the agent type? If we change the load type on the agent on a working deployment, when the agents restart they will report a new load. The server does not need to know what weight it\u0027s scheduling on, to be honest.","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"dc7424cf3f740970a8449c8f6d5f6d19266c4af7","unresolved":false,"context_lines":[{"line_number":534,"context_line":"            \u0027host\u0027: host,"},{"line_number":535,"context_line":"            \u0027topic\u0027: topics.DHCP_AGENT,"},{"line_number":536,"context_line":"            \u0027configurations\u0027: {"},{"line_number":537,"context_line":"                \u0027load_type\u0027: cfg.CONF.dhcp_load_type,"},{"line_number":538,"context_line":"                \u0027dhcp_driver\u0027: cfg.CONF.dhcp_driver,"},{"line_number":539,"context_line":"                \u0027use_namespaces\u0027: cfg.CONF.use_namespaces,"},{"line_number":540,"context_line":"                \u0027dhcp_lease_duration\u0027: cfg.CONF.dhcp_lease_duration},"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_b994f044","line":537,"in_reply_to":"9a80dd14_55253d5a","updated":"2015-03-12 05:09:24.000000000","message":"why not to have agents report a dict, say, load_info \u003d {\"networks\":xxx, \"some_load_type\",yyy, ...} ?\n\nthe info can be stored in a separate table which has columns\nlike (agent_id, load_type, load).\nalternatively it can be json-serialized and stored in a column\nin agent db.\n\neither ways load_type can be a server-side option. (as it should be, IMO)","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"7090e612b1b79397e1b9a3e32b9bcca5eb17e6d4","unresolved":false,"context_lines":[{"line_number":534,"context_line":"            \u0027host\u0027: host,"},{"line_number":535,"context_line":"            \u0027topic\u0027: topics.DHCP_AGENT,"},{"line_number":536,"context_line":"            \u0027configurations\u0027: {"},{"line_number":537,"context_line":"                \u0027load_type\u0027: cfg.CONF.dhcp_load_type,"},{"line_number":538,"context_line":"                \u0027dhcp_driver\u0027: cfg.CONF.dhcp_driver,"},{"line_number":539,"context_line":"                \u0027use_namespaces\u0027: cfg.CONF.use_namespaces,"},{"line_number":540,"context_line":"                \u0027dhcp_lease_duration\u0027: cfg.CONF.dhcp_lease_duration},"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_1625d0ad","line":537,"in_reply_to":"9a80dd14_8f443e1c","updated":"2015-03-18 06:24:59.000000000","message":"my proposal is\n\n1. make the agent report something like the following. the keys and values available are agent type dependent.\n\n    \"load_info\": {\n        \"networks\": xxx,\n        \"subnets\": yyy,\n        \"ports\": zzz,\n    }\n\n2. agents_db stores the whole info in the database as-is. at this point no need to know which load_type will be used by a scheduler.\n\n3. a network scheduler can pick numbers from the database according to its conf (load_type)","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ceb14756fa4a84c9eda5a2ae793822e3b030009f","unresolved":false,"context_lines":[{"line_number":534,"context_line":"            \u0027host\u0027: host,"},{"line_number":535,"context_line":"            \u0027topic\u0027: topics.DHCP_AGENT,"},{"line_number":536,"context_line":"            \u0027configurations\u0027: {"},{"line_number":537,"context_line":"                \u0027load_type\u0027: cfg.CONF.dhcp_load_type,"},{"line_number":538,"context_line":"                \u0027dhcp_driver\u0027: cfg.CONF.dhcp_driver,"},{"line_number":539,"context_line":"                \u0027use_namespaces\u0027: cfg.CONF.use_namespaces,"},{"line_number":540,"context_line":"                \u0027dhcp_lease_duration\u0027: cfg.CONF.dhcp_lease_duration},"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_8f443e1c","line":537,"in_reply_to":"9a80dd14_b994f044","updated":"2015-03-12 06:19:25.000000000","message":"Not sure I understand your proposal. Anyway, I believe I may have been misunderstood, so let me try to explain again:\n\nThe load_type specifies the type of weight chosen by the weight scheduler, and it seems obvious that load_type be a server-side configuration. \n\nThat said, it is worth noting that we have two scheduler driver config options. In order to discern between the load for the network_scheduler_driver vs the load for router_scheduler_driver, we need to be distinctive about the type of load, and one config variable capturing the load needs to be introduced per driver: hence we have dhcp_load_type here, and potentially a l3_load_type (to be introduced in the future).\n\nWith two server-side load options, we\u0027ll end up polluting the agent logic with something like:\n\n[1] # while I capture the load in agent_db\n  if agent_type \u003d\u003d dhcp:\n    load_type \u003d cfg.CONF.dhcp_load_type\n  elif agent_type \u003d\u003d l3:\n    load_type \u003d cfg.conf.l3_load_type\n  elif:\n    # shoot, what do I do? Raise?\n  # extract the load from config dict\n\nWith this logic we can extract the right load type from the configuration dict being reported by the agent.\n\nSnippet [1] is certainly doable, but I thought it was a lot cleaner if we had the agent report the load type itself, and avoid the if-logic altogether and the potential error condition. After all, who is in the best position to report the load type if not the agent? At the end of the day, the load type and the agent type are directly related.\n\nIf we think that from an operator point of view, changing the scheduler and/or the load type is something that happens that often that a restart of the server(s) as well as the affected agents is a big deal, then snippet [1] is worth the price. If not, I think we can probably live with this change.\n\nI am really not that much swayed one way or another.","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"f3735adc00b81bdd163bb425ddef31bb8b64ad51","unresolved":false,"context_lines":[{"line_number":534,"context_line":"            \u0027host\u0027: host,"},{"line_number":535,"context_line":"            \u0027topic\u0027: topics.DHCP_AGENT,"},{"line_number":536,"context_line":"            \u0027configurations\u0027: {"},{"line_number":537,"context_line":"                \u0027load_type\u0027: cfg.CONF.dhcp_load_type,"},{"line_number":538,"context_line":"                \u0027dhcp_driver\u0027: cfg.CONF.dhcp_driver,"},{"line_number":539,"context_line":"                \u0027use_namespaces\u0027: cfg.CONF.use_namespaces,"},{"line_number":540,"context_line":"                \u0027dhcp_lease_duration\u0027: cfg.CONF.dhcp_lease_duration},"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_55253d5a","line":537,"in_reply_to":"9a80dd14_fda8dd8e","updated":"2015-03-06 18:49:43.000000000","message":"Okay, I understand it is a good balance and let\u0027s keep it.\n\nIt is a kind of dilemma. \"load_type\" itself is a configuration for scheduling. From this point of view, it is a server side (scheduler) option. On the other hand, from the perspective of agent_db implementation, it is not a good idea to add agent-specific configuration in agent_db. This is the reason we have the config in the agent side. Keeping it in the agent side sounds a good balance after reading your comment.\n\nFor config change I mentioned in the above comment, it is not a problem on a second thought. The number of agents related to scheduling is relatively small . Such config change and agent restart are usually triggered by some configuration tool, so changes in almost all agents will be done at the same time (in a minute).","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"}],"neutron/agent/dhcp/config.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":30,"context_line":"                       \"enable_isolated_metadata \u003d True\")),"},{"line_number":31,"context_line":"    cfg.IntOpt(\u0027num_sync_threads\u0027, default\u003d4,"},{"line_number":32,"context_line":"               help\u003d_(\u0027Number of threads to use during sync process.\u0027)),"},{"line_number":33,"context_line":"    cfg.StrOpt(\u0027dhcp_load_type\u0027, default\u003d\u0027networks\u0027,"},{"line_number":34,"context_line":"               help\u003d_(\"Allows scheduler to schedule dhcp namespaces \""},{"line_number":35,"context_line":"                      \"based on dhcp load type.\")),"},{"line_number":36,"context_line":"    cfg.StrOpt(\u0027metadata_proxy_socket\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_b86bb3b7","line":33,"updated":"2015-02-11 21:41:04.000000000","message":"this does not need to be dhcp specific.\n\nCall it load_type, default it to None and move it to somewhere common to the agent.","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":30,"context_line":"                       \"enable_isolated_metadata \u003d True\")),"},{"line_number":31,"context_line":"    cfg.IntOpt(\u0027num_sync_threads\u0027, default\u003d4,"},{"line_number":32,"context_line":"               help\u003d_(\u0027Number of threads to use during sync process.\u0027)),"},{"line_number":33,"context_line":"    cfg.StrOpt(\u0027dhcp_load_type\u0027, default\u003d\u0027networks\u0027,"},{"line_number":34,"context_line":"               help\u003d_(\"Allows scheduler to schedule dhcp namespaces \""},{"line_number":35,"context_line":"                      \"based on dhcp load type.\")),"},{"line_number":36,"context_line":"    cfg.StrOpt(\u0027metadata_proxy_socket\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_ec06ed20","line":33,"in_reply_to":"da86d52c_b86bb3b7","updated":"2015-02-13 18:00:45.000000000","message":"We will register load_type config in agent/comma/config.","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"}],"neutron/db/agents_db.py":[{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5c4f18ed682871552432f2e806b02bcaad6f876f","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":69,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":70,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":71,"context_line":"    load \u003d sa.Column(sa.String(4095), nullable\u003dTrue)"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    @property"},{"line_number":74,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_9bcb1b1d","line":71,"updated":"2015-01-08 13:28:05.000000000","message":"you don\u0027t need, and actually, you don\u0027t use this field, see line 176.\n\nSo i think even migration is not needed.\nconfigurations field may store amount of networks.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e71f9fe104ca4e0d8f6f5f0dc8c995cee8742539","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":69,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":70,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":71,"context_line":"    load \u003d sa.Column(sa.String(4095), nullable\u003dTrue)"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    @property"},{"line_number":74,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_656b13b9","line":71,"in_reply_to":"3a961159_33c5e35b","updated":"2015-01-09 09:51:00.000000000","message":"We will make this as numeric field.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e71f9fe104ca4e0d8f6f5f0dc8c995cee8742539","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":69,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":70,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":71,"context_line":"    load \u003d sa.Column(sa.String(4095), nullable\u003dTrue)"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    @property"},{"line_number":74,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_e5baa309","line":71,"in_reply_to":"3a961159_9bcb1b1d","updated":"2015-01-09 09:51:00.000000000","message":"@enikanorov : load column has been introduced to generalize the scheduler implementation for dhcp and l3 schedulers going forward.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0263996e5d0f871ff2a12f455e77656cfb1ba840","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":69,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":70,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":71,"context_line":"    load \u003d sa.Column(sa.String(4095), nullable\u003dTrue)"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    @property"},{"line_number":74,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_33c5e35b","line":71,"in_reply_to":"3a961159_9bcb1b1d","updated":"2015-01-08 19:10:44.000000000","message":"Eugene is right, unless we store this load as a numeric field, in which case it makes sense to have it here.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5c4f18ed682871552432f2e806b02bcaad6f876f","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        attr \u003d ext_agent.RESOURCE_ATTRIBUTE_MAP.get("},{"line_number":123,"context_line":"            ext_agent.RESOURCE_NAME + \u0027s\u0027)"},{"line_number":124,"context_line":"        res \u003d dict((k, agent[k]) for k in attr"},{"line_number":125,"context_line":"                   if k not in [\u0027alive\u0027, \u0027configurations\u0027])"},{"line_number":126,"context_line":"        res[\u0027alive\u0027] \u003d not AgentDbMixin.is_agent_down("},{"line_number":127,"context_line":"            res[\u0027heartbeat_timestamp\u0027])"},{"line_number":128,"context_line":"        res[\u0027configurations\u0027] \u003d self.get_configuration_dict(agent)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_1bd72bc0","line":125,"updated":"2015-01-08 13:28:05.000000000","message":"need to add res[\u0027load\u0027] here","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0263996e5d0f871ff2a12f455e77656cfb1ba840","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"            configurations_dict \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":175,"context_line":"            res[\u0027configurations\u0027] \u003d jsonutils.dumps(configurations_dict)"},{"line_number":176,"context_line":"            res[\u0027load\u0027] \u003d configurations_dict.get(\u0027networks\u0027, -1)"},{"line_number":177,"context_line":"            current_time \u003d timeutils.utcnow()"},{"line_number":178,"context_line":"            try:"},{"line_number":179,"context_line":"                agent_db \u003d self._get_agent_by_type_and_host("}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_d3abbf85","line":176,"updated":"2015-01-08 19:10:44.000000000","message":"this is common code, why are you hardcoding res[\u0027load\u0027] to be the number of networks?","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e71f9fe104ca4e0d8f6f5f0dc8c995cee8742539","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"            configurations_dict \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":175,"context_line":"            res[\u0027configurations\u0027] \u003d jsonutils.dumps(configurations_dict)"},{"line_number":176,"context_line":"            res[\u0027load\u0027] \u003d configurations_dict.get(\u0027networks\u0027, -1)"},{"line_number":177,"context_line":"            current_time \u003d timeutils.utcnow()"},{"line_number":178,"context_line":"            try:"},{"line_number":179,"context_line":"                agent_db \u003d self._get_agent_by_type_and_host("}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_85ab9f86","line":176,"in_reply_to":"3a961159_d3abbf85","updated":"2015-01-09 09:51:00.000000000","message":"We will refactor the code to read the load type from the configuration file.\n\nPlease let us know your suggestions.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"864aa9f8e12b362fa87c428561ab8371635c9349","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from eventlet import greenthread"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":"from oslo.db import exception as db_exc"},{"line_number":20,"context_line":"from oslo import messaging"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_bf05a17b","side":"PARENT","line":17,"updated":"2015-01-29 19:02:30.000000000","message":"this change should not appear here.","commit_id":"910470de36a58f9742e8c2163ebdfa100d5b2795"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ebfb0e27efb849b4578d3e6781beebc44e255227","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from eventlet import greenthread"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":"from oslo.db import exception as db_exc"},{"line_number":20,"context_line":"from oslo import messaging"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_4b9523e3","side":"PARENT","line":17,"in_reply_to":"fa81d914_bf05a17b","updated":"2015-02-01 05:48:07.000000000","message":"Done","commit_id":"910470de36a58f9742e8c2163ebdfa100d5b2795"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"864aa9f8e12b362fa87c428561ab8371635c9349","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from sqlalchemy.orm import exc"},{"line_number":24,"context_line":"from sqlalchemy import sql"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from neutron.api.v2 import attributes"},{"line_number":28,"context_line":"from neutron.common import constants"},{"line_number":29,"context_line":"from neutron.db import model_base"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_df089593","line":26,"updated":"2015-01-29 19:02:30.000000000","message":"please avoid adding this new line","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ebfb0e27efb849b4578d3e6781beebc44e255227","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from sqlalchemy.orm import exc"},{"line_number":24,"context_line":"from sqlalchemy import sql"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from neutron.api.v2 import attributes"},{"line_number":28,"context_line":"from neutron.common import constants"},{"line_number":29,"context_line":"from neutron.db import model_base"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_6b9ae715","line":26,"in_reply_to":"fa81d914_df089593","updated":"2015-02-01 05:48:07.000000000","message":"Done","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"864aa9f8e12b362fa87c428561ab8371635c9349","unresolved":false,"context_lines":[{"line_number":41,"context_line":"                      \"agent is down for good.\")))"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"cfg.CONF.register_opt("},{"line_number":44,"context_line":"    cfg.StrOpt(\u0027dhcp_load_type\u0027, default\u003d\u0027networks\u0027,"},{"line_number":45,"context_line":"               help\u003d_(\u0027The Parameter which decides dhcp load type\u0027)))"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_1f3a2d36","line":44,"updated":"2015-01-29 19:02:30.000000000","message":"This option does not belong to this file, but I think it\u0027s best located in: \n\nneutron/scheduler/dhcp_agent_scheduler.py\n\nUnless you just called it: \u0027load_type\u0027, in which case it sort of fit in here, but I don\u0027t understand why we even worry about the type of load we\u0027re tracking. Ultimately we want to do weight-based scheduling. It doesn\u0027t matter whether that weight is potatoes, apples, or networks....all I care about is a the weight, regardless of its type.\n\nThe type can be informational but it should play any role in the scheduling decision.","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ebfb0e27efb849b4578d3e6781beebc44e255227","unresolved":false,"context_lines":[{"line_number":41,"context_line":"                      \"agent is down for good.\")))"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"cfg.CONF.register_opt("},{"line_number":44,"context_line":"    cfg.StrOpt(\u0027dhcp_load_type\u0027, default\u003d\u0027networks\u0027,"},{"line_number":45,"context_line":"               help\u003d_(\u0027The Parameter which decides dhcp load type\u0027)))"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_cb8833c9","line":44,"in_reply_to":"fa81d914_1f3a2d36","updated":"2015-02-01 05:48:07.000000000","message":"Agreed, scheduler will schedule only based on load column, regardless of what it is.","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"864aa9f8e12b362fa87c428561ab8371635c9349","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            res[\u0027heartbeat_timestamp\u0027])"},{"line_number":133,"context_line":"        configs \u003d self.get_configuration_dict(agent)"},{"line_number":134,"context_line":"        res[\u0027configurations\u0027] \u003d configs"},{"line_number":135,"context_line":"        if (agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":136,"context_line":"            load_type \u003d cfg.CONF.dhcp_load_type"},{"line_number":137,"context_line":"            if load_type \u003d\u003d \u0027networks\u0027 and \u0027networks\u0027 in configs:"},{"line_number":138,"context_line":"                res[\u0027load\u0027] \u003d configs[\u0027networks\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_4214c843","line":135,"updated":"2015-01-29 19:02:30.000000000","message":"This logic is messy, if we add more load types over time this method will bloat. If you see my comment above, this should only capture the load and that\u0027s it.","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ebfb0e27efb849b4578d3e6781beebc44e255227","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            res[\u0027heartbeat_timestamp\u0027])"},{"line_number":133,"context_line":"        configs \u003d self.get_configuration_dict(agent)"},{"line_number":134,"context_line":"        res[\u0027configurations\u0027] \u003d configs"},{"line_number":135,"context_line":"        if (agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":136,"context_line":"            load_type \u003d cfg.CONF.dhcp_load_type"},{"line_number":137,"context_line":"            if load_type \u003d\u003d \u0027networks\u0027 and \u0027networks\u0027 in configs:"},{"line_number":138,"context_line":"                res[\u0027load\u0027] \u003d configs[\u0027networks\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_2b90efeb","line":135,"in_reply_to":"fa81d914_4214c843","updated":"2015-02-01 05:48:07.000000000","message":"Agreed, we will simplify it just to capture load sent from agents in report status.","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"864aa9f8e12b362fa87c428561ab8371635c9349","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":"            configurations_dict \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":195,"context_line":"            res[\u0027configurations\u0027] \u003d jsonutils.dumps(configurations_dict)"},{"line_number":196,"context_line":"            if (agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":197,"context_line":"                load_type \u003d cfg.CONF.dhcp_load_type"},{"line_number":198,"context_line":"                if (load_type \u003d\u003d \u0027networks\u0027 and"},{"line_number":199,"context_line":"                        \u0027networks\u0027 in configurations_dict):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_821ec061","line":196,"updated":"2015-01-29 19:02:30.000000000","message":"ditto","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ebfb0e27efb849b4578d3e6781beebc44e255227","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":"            configurations_dict \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":195,"context_line":"            res[\u0027configurations\u0027] \u003d jsonutils.dumps(configurations_dict)"},{"line_number":196,"context_line":"            if (agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":197,"context_line":"                load_type \u003d cfg.CONF.dhcp_load_type"},{"line_number":198,"context_line":"                if (load_type \u003d\u003d \u0027networks\u0027 and"},{"line_number":199,"context_line":"                        \u0027networks\u0027 in configurations_dict):"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_4bbc436d","line":196,"in_reply_to":"fa81d914_821ec061","updated":"2015-02-01 05:48:07.000000000","message":"Done","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c46eadf2cf3e1ec9e6cfca9fe4ced1512ce406ec","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from sqlalchemy.orm import exc"},{"line_number":25,"context_line":"from sqlalchemy import sql"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"from neutron.api.v2 import attributes"},{"line_number":29,"context_line":"from neutron.common import constants"},{"line_number":30,"context_line":"from neutron.db import model_base"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_24a8998c","line":27,"updated":"2015-02-11 12:50:28.000000000","message":"unrelated. please delete this","commit_id":"10cd81e5de1d4470016f29af22ff4b61b3e9eea8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"35af4cb0fdbf76cdfaeebf58d2e58e18c86e599f","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from sqlalchemy.orm import exc"},{"line_number":25,"context_line":"from sqlalchemy import sql"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"from neutron.api.v2 import attributes"},{"line_number":29,"context_line":"from neutron.common import constants"},{"line_number":30,"context_line":"from neutron.db import model_base"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_95c25183","line":27,"in_reply_to":"da86d52c_24a8998c","updated":"2015-02-11 13:53:06.000000000","message":"Agreed.","commit_id":"10cd81e5de1d4470016f29af22ff4b61b3e9eea8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c46eadf2cf3e1ec9e6cfca9fe4ced1512ce406ec","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        configs \u003d self.get_configuration_dict(agent)"},{"line_number":132,"context_line":"        res[\u0027configurations\u0027] \u003d configs"},{"line_number":133,"context_line":"        if (agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":134,"context_line":"            res[\u0027load\u0027] \u003d int(agent[\u0027load\u0027])"},{"line_number":135,"context_line":"        else:"},{"line_number":136,"context_line":"            res[\u0027load\u0027] \u003d -1"},{"line_number":137,"context_line":"        return self._fields(res, fields)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_648611dd","line":134,"updated":"2015-02-11 12:50:28.000000000","message":"this is very confusing. only fater rereading the patch did i understand that load can differ. is this always an integer? what if we want to use say capacity and response time? how will that fit into this model?","commit_id":"10cd81e5de1d4470016f29af22ff4b61b3e9eea8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"35af4cb0fdbf76cdfaeebf58d2e58e18c86e599f","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        configs \u003d self.get_configuration_dict(agent)"},{"line_number":132,"context_line":"        res[\u0027configurations\u0027] \u003d configs"},{"line_number":133,"context_line":"        if (agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":134,"context_line":"            res[\u0027load\u0027] \u003d int(agent[\u0027load\u0027])"},{"line_number":135,"context_line":"        else:"},{"line_number":136,"context_line":"            res[\u0027load\u0027] \u003d -1"},{"line_number":137,"context_line":"        return self._fields(res, fields)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_b573d54c","line":134,"in_reply_to":"da86d52c_648611dd","updated":"2015-02-11 13:53:06.000000000","message":"We will add comments here to make it more clear.\nYes this is always integer.\nload needs to be calculated as integer value from agent side and passed in report status.\n\nWe need to think about the pros and cons of making the \u0027load\u0027 as float type.","commit_id":"10cd81e5de1d4470016f29af22ff4b61b3e9eea8"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"91715eb4699db39ff91050be8cfb321c14a4777c","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from sqlalchemy.orm import exc"},{"line_number":25,"context_line":"from sqlalchemy import sql"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"from neutron.api.v2 import attributes"},{"line_number":29,"context_line":"from neutron.common import constants"},{"line_number":30,"context_line":"from neutron.db import model_base"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_350604cf","line":27,"updated":"2015-02-11 14:54:34.000000000","message":"extra line still to remove","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from sqlalchemy.orm import exc"},{"line_number":25,"context_line":"from sqlalchemy import sql"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"from neutron.api.v2 import attributes"},{"line_number":29,"context_line":"from neutron.common import constants"},{"line_number":30,"context_line":"from neutron.db import model_base"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_2c01e506","line":27,"in_reply_to":"da86d52c_350604cf","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"91715eb4699db39ff91050be8cfb321c14a4777c","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                   if k not in [\u0027alive\u0027, \u0027configurations\u0027])"},{"line_number":129,"context_line":"        res[\u0027alive\u0027] \u003d not AgentDbMixin.is_agent_down("},{"line_number":130,"context_line":"            res[\u0027heartbeat_timestamp\u0027])"},{"line_number":131,"context_line":"        configs \u003d self.get_configuration_dict(agent)"},{"line_number":132,"context_line":"        res[\u0027configurations\u0027] \u003d configs"},{"line_number":133,"context_line":"        if (agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":134,"context_line":"            res[\u0027load\u0027] \u003d int(agent[\u0027load\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_98d365d4","line":131,"updated":"2015-02-11 14:54:34.000000000","message":"L131-132: unrelated change","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                   if k not in [\u0027alive\u0027, \u0027configurations\u0027])"},{"line_number":129,"context_line":"        res[\u0027alive\u0027] \u003d not AgentDbMixin.is_agent_down("},{"line_number":130,"context_line":"            res[\u0027heartbeat_timestamp\u0027])"},{"line_number":131,"context_line":"        configs \u003d self.get_configuration_dict(agent)"},{"line_number":132,"context_line":"        res[\u0027configurations\u0027] \u003d configs"},{"line_number":133,"context_line":"        if (agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":134,"context_line":"            res[\u0027load\u0027] \u003d int(agent[\u0027load\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_dd9bf963","line":131,"updated":"2015-02-11 21:41:04.000000000","message":"Let me re-elaborate my comment on PS5. You don\u0027t have to tie any DHCP specific logic in here. You don\u0027t even have to capture the load separately as it is going to appear in the configurations object and displayed with the rest of the object. In a nutshell: you don\u0027t have to change the presentation logic at all, so get rid of these changes in 131-134","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                   if k not in [\u0027alive\u0027, \u0027configurations\u0027])"},{"line_number":129,"context_line":"        res[\u0027alive\u0027] \u003d not AgentDbMixin.is_agent_down("},{"line_number":130,"context_line":"            res[\u0027heartbeat_timestamp\u0027])"},{"line_number":131,"context_line":"        configs \u003d self.get_configuration_dict(agent)"},{"line_number":132,"context_line":"        res[\u0027configurations\u0027] \u003d configs"},{"line_number":133,"context_line":"        if (agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":134,"context_line":"            res[\u0027load\u0027] \u003d int(agent[\u0027load\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_c0072d17","line":131,"in_reply_to":"da86d52c_dd9bf963","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"91715eb4699db39ff91050be8cfb321c14a4777c","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        configs \u003d self.get_configuration_dict(agent)"},{"line_number":132,"context_line":"        res[\u0027configurations\u0027] \u003d configs"},{"line_number":133,"context_line":"        if (agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":134,"context_line":"            res[\u0027load\u0027] \u003d int(agent[\u0027load\u0027])"},{"line_number":135,"context_line":"        else:"},{"line_number":136,"context_line":"            res[\u0027load\u0027] \u003d -1"},{"line_number":137,"context_line":"        return self._fields(res, fields)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_d86a3d19","line":134,"updated":"2015-02-11 14:54:34.000000000","message":"load computation can be moved to a specific method to avoid code duplication","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        configs \u003d self.get_configuration_dict(agent)"},{"line_number":132,"context_line":"        res[\u0027configurations\u0027] \u003d configs"},{"line_number":133,"context_line":"        if (agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":134,"context_line":"            res[\u0027load\u0027] \u003d int(agent[\u0027load\u0027])"},{"line_number":135,"context_line":"        else:"},{"line_number":136,"context_line":"            res[\u0027load\u0027] \u003d -1"},{"line_number":137,"context_line":"        return self._fields(res, fields)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_c0a3adfe","line":134,"in_reply_to":"da86d52c_d86a3d19","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":"            configurations_dict \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":189,"context_line":"            res[\u0027configurations\u0027] \u003d jsonutils.dumps(configurations_dict)"},{"line_number":190,"context_line":"            if (agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":191,"context_line":"                res[\u0027load\u0027] \u003d int(agent[\u0027load\u0027])"},{"line_number":192,"context_line":"            else:"},{"line_number":193,"context_line":"                res[\u0027load\u0027] \u003d -1"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_1da11194","line":190,"updated":"2015-02-11 21:41:04.000000000","message":"So here, we just have to extract the load from the configuration dict and move it to the load column, so that the scheduler, or any other component, can inspect quickly, and do clever things with it. This is basically what you have to do:\n\n  load_type \u003d agent.get(\u0027load_type\u0027)\n  if load_type:\n      res[\u0027load\u0027] \u003d int(res[\u0027configurations\u0027][load_type])\n  else:\n      res[\u0027load\u0027] \u003d 0\n\nBear in mind that L3 and DHCP agents already reports stuff like networks, routers, interfaces, floating_ips, etc. So it\u0027s just a matter to of knowing what information to extract from the configurations dict, based on the agent\u0027s configuration.","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":"            configurations_dict \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":189,"context_line":"            res[\u0027configurations\u0027] \u003d jsonutils.dumps(configurations_dict)"},{"line_number":190,"context_line":"            if (agent[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"},{"line_number":191,"context_line":"                res[\u0027load\u0027] \u003d int(agent[\u0027load\u0027])"},{"line_number":192,"context_line":"            else:"},{"line_number":193,"context_line":"                res[\u0027load\u0027] \u003d -1"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_e05a7129","line":190,"in_reply_to":"da86d52c_1da11194","updated":"2015-02-13 18:00:45.000000000","message":"Done, will modify agent side to send load_type in its report state, and will extract specific load according to load_type.","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":71,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":72,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":73,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    @property"},{"line_number":76,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_d87ab076","line":73,"updated":"2015-02-14 22:07:53.000000000","message":"Although the scheduler itself works, what type of load are stored in this column depends on the agent configuration. It means this column does not have a wrong value when the agent configuration is changed. In the transient time, it can be confusing. I think it is natural to store resource usage information in more consistent way (e.g, with resource types).","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":71,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":72,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":73,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    @property"},{"line_number":76,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_933ada32","line":73,"in_reply_to":"da86d52c_d87ab076","updated":"2015-02-15 07:16:08.000000000","message":"You mean to say, we should have an extra dict in report state \"resource usage\"..? And, extract load from that dict..?","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"94738f216988434c9d09a5abebfb7f42ff5a008e","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_agent_load(self, agent, res):"},{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027)"},{"line_number":125,"context_line":"        if load_type:"},{"line_number":126,"context_line":"            res[\u0027load\u0027] \u003d int(res[\u0027configurations\u0027][load_type])"},{"line_number":127,"context_line":"        else:"},{"line_number":128,"context_line":"            res[\u0027load\u0027] \u003d 0"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_bd2fae3d","line":125,"updated":"2015-02-14 19:23:56.000000000","message":"configurations[load_type] is never populated by the agent? This patch \u0027implements\u0027 the blueprint so I\u0027m assuming there\u0027s no follow up?","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_agent_load(self, agent, res):"},{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027)"},{"line_number":125,"context_line":"        if load_type:"},{"line_number":126,"context_line":"            res[\u0027load\u0027] \u003d int(res[\u0027configurations\u0027][load_type])"},{"line_number":127,"context_line":"        else:"},{"line_number":128,"context_line":"            res[\u0027load\u0027] \u003d 0"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_f31076ad","line":125,"in_reply_to":"da86d52c_78b46435","updated":"2015-02-15 07:16:08.000000000","message":"In this blue print we are trying to implement generic scheduler logic ,  which will be common across dhcp and l3 schedulers , current implementation also concentrates only on dhcp changes but follow up will be there as part of different dependent bp to address l3 logic also.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_agent_load(self, agent, res):"},{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027)"},{"line_number":125,"context_line":"        if load_type:"},{"line_number":126,"context_line":"            res[\u0027load\u0027] \u003d int(res[\u0027configurations\u0027][load_type])"},{"line_number":127,"context_line":"        else:"},{"line_number":128,"context_line":"            res[\u0027load\u0027] \u003d 0"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_78b46435","line":125,"in_reply_to":"da86d52c_bd2fae3d","updated":"2015-02-14 22:07:53.000000000","message":"In addition to Assaf\u0027s comment, please consider cases where an agent is not upgraded but a neutron-server has been upgrade, or \"load\" column is not populated yet.\n\nMoreover, it seems odd to me that \"configuration\" field is used to report the current usage of resources on an agent. It may be a good chance to add a new dict field (\"usages\"?) to report the current resource usage on the agent side.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fbcc1fce85ef077f829f0f93529483db3ed4180b","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_agent_load(self, agent, res):"},{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027)"},{"line_number":125,"context_line":"        if load_type:"},{"line_number":126,"context_line":"            res[\u0027load\u0027] \u003d int(res[\u0027configurations\u0027][load_type])"},{"line_number":127,"context_line":"        else:"},{"line_number":128,"context_line":"            res[\u0027load\u0027] \u003d 0"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_073b009d","line":125,"updated":"2015-02-15 15:05:39.000000000","message":"I still don\u0027t get this. The agent is not putting anything in the configuration dict.","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_agent_load(self, agent, res):"},{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027)"},{"line_number":125,"context_line":"        if load_type:"},{"line_number":126,"context_line":"            res[\u0027load\u0027] \u003d int(res[\u0027configurations\u0027][load_type])"},{"line_number":127,"context_line":"        else:"},{"line_number":128,"context_line":"            res[\u0027load\u0027] \u003d 0"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_276c8408","line":125,"in_reply_to":"da86d52c_073b009d","updated":"2015-02-15 17:25:39.000000000","message":"Consider load_type\u003dnetworks , as networks is present in configuration dict it is working","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6e14ba56bad7efbf3d30fede34f3341ebf55cbc0","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_agent_load(self, agent, res):"},{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027)"},{"line_number":125,"context_line":"        if load_type:"},{"line_number":126,"context_line":"            res[\u0027load\u0027] \u003d int(res[\u0027configurations\u0027][load_type])"},{"line_number":127,"context_line":"        else:"},{"line_number":128,"context_line":"            res[\u0027load\u0027] \u003d 0"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_2743a46d","line":125,"in_reply_to":"da86d52c_073b009d","updated":"2015-02-15 16:58:29.000000000","message":"I think this util method is useful to extract the resource load out of the config dict so that it can be saved in the load attribute on the agent model. However I don\u0027t think it needs to be called on line 139.","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"f4ef4cd34085576b0a33cdcb0734a2248ed4d168","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_agent_load(self, agent, res):"},{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027)"},{"line_number":125,"context_line":"        if load_type:"},{"line_number":126,"context_line":"            res[\u0027load\u0027] \u003d int(res[\u0027configurations\u0027][load_type])"},{"line_number":127,"context_line":"        else:"},{"line_number":128,"context_line":"            res[\u0027load\u0027] \u003d 0"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_08d4ed45","line":125,"in_reply_to":"da86d52c_276c8408","updated":"2015-02-15 23:45:23.000000000","message":"Oops, I\u0027m stupid, ignore me.\n\nBy the way you could write:\nres[\u0027load\u0027] \u003d res[\u0027configurations\u0027][load_type] if load_type else 0\n\nI think I\u0027m going to need examples of other types of metrics you\u0027d like the agent to report in the future. Otherwise I\u0027m not sure persisting the information as an integer is necessarily generic enough.","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6e14ba56bad7efbf3d30fede34f3341ebf55cbc0","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        res[\u0027alive\u0027] \u003d not AgentDbMixin.is_agent_down("},{"line_number":137,"context_line":"            res[\u0027heartbeat_timestamp\u0027])"},{"line_number":138,"context_line":"        res[\u0027configurations\u0027] \u003d self.get_configuration_dict(agent)"},{"line_number":139,"context_line":"        res \u003d self._get_agent_load(agent, res)"},{"line_number":140,"context_line":"        return self._fields(res, fields)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def delete_agent(self, context, id):"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_47489887","line":139,"updated":"2015-02-15 16:58:29.000000000","message":"please remove.","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        res[\u0027alive\u0027] \u003d not AgentDbMixin.is_agent_down("},{"line_number":137,"context_line":"            res[\u0027heartbeat_timestamp\u0027])"},{"line_number":138,"context_line":"        res[\u0027configurations\u0027] \u003d self.get_configuration_dict(agent)"},{"line_number":139,"context_line":"        res \u003d self._get_agent_load(agent, res)"},{"line_number":140,"context_line":"        return self._fields(res, fields)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def delete_agent(self, context, id):"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_a28ea277","line":139,"in_reply_to":"da86d52c_47489887","updated":"2015-02-15 17:25:39.000000000","message":"Agreed","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c4f880bde082bc798cf3979c502823081f69208b","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":71,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":72,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":73,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    @property"},{"line_number":76,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_26efc11f","line":73,"updated":"2015-02-18 09:50:02.000000000","message":"What happens if load_type specified in dhcp-agent config file is changed to another type? The data here becomes meaningless and an agent is selected based on wrong information.\n\nI would suggest to store \"load_type\" along with actual load data.\nThis is the other reason that I prefer to report load for all resource types.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"75694cc2eff2d05b439af4198bd678614e56a323","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":71,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":72,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":73,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    @property"},{"line_number":76,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_d5d4c9ea","line":73,"in_reply_to":"da86d52c_26efc11f","updated":"2015-02-18 12:17:02.000000000","message":"This has been implemented with the assumption that load_type is same across all agents.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5a33674315cf4f5d02ecceda110cc1969031199","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":71,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":72,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":73,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    @property"},{"line_number":76,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_4cff5802","line":73,"in_reply_to":"da86d52c_26efc11f","updated":"2015-02-18 20:51:22.000000000","message":"do you mean that we\u0027ll have different dhcp agents report different load types?\n\nIf this is a danger (which I think it\u0027s pretty slim in actual deployments where the dhcp config is automatically pushed to hosts and it won\u0027t change across hosts), then we\u0027d need to have the load-type be specified server-side. But then again, the danger here is that in multi-server deployments we could have different schedulers for different hosts, which is less than ideal too :)","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c4f880bde082bc798cf3979c502823081f69208b","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027, None)"},{"line_number":125,"context_line":"        if load_type:"},{"line_number":126,"context_line":"            configs \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":127,"context_line":"            res[\u0027load\u0027] \u003d int(configs[load_type])"},{"line_number":128,"context_line":"        else:"},{"line_number":129,"context_line":"            res[\u0027load\u0027] \u003d 0"},{"line_number":130,"context_line":"        return res"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_26a181f8","line":127,"updated":"2015-02-18 09:50:02.000000000","message":"dhcp-agent does not populate \"load_type\" in this patch. You need to take care of a case where there is no key whose name is load_type.\n\nI still think it is good that an agent reports loads for various available resource types and store them in agent dbs. It allows us to support more intelligent filters (e.g. which consider two load types).\n\nIn addition, \"configuration\" is assumed to be static and \"load\" information is dynamic. It is better to introduce a new field to report actual \"load\".","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5a33674315cf4f5d02ecceda110cc1969031199","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027, None)"},{"line_number":125,"context_line":"        if load_type:"},{"line_number":126,"context_line":"            configs \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":127,"context_line":"            res[\u0027load\u0027] \u003d int(configs[load_type])"},{"line_number":128,"context_line":"        else:"},{"line_number":129,"context_line":"            res[\u0027load\u0027] \u003d 0"},{"line_number":130,"context_line":"        return res"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_cfa6da0e","line":127,"in_reply_to":"da86d52c_26a181f8","updated":"2015-02-18 20:51:22.000000000","message":"the dhcp agent already reports things like \u0027networks\u0027, etc:\n\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/dhcp/agent.py#L530\n\nAnd it is both static and dynamic data. The only reason load is extracted out of the config dict is to make sure a performant DB query can be done on the load column rather than inspect the blob per row.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bfc23729ba16cd5fdb83992947b27c33b78d8d5b","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027, None)"},{"line_number":125,"context_line":"        if load_type:"},{"line_number":126,"context_line":"            configs \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":127,"context_line":"            res[\u0027load\u0027] \u003d int(configs[load_type])"},{"line_number":128,"context_line":"        else:"},{"line_number":129,"context_line":"            res[\u0027load\u0027] \u003d 0"},{"line_number":130,"context_line":"        return res"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba7be1f8_978d7934","line":127,"in_reply_to":"da86d52c_cfa6da0e","updated":"2015-02-20 15:15:54.000000000","message":"Reasonable reason unless agent config \"load_type\" is not changed.\nI am a bit afraid what happens when \"load_type\" in agent config is changed.\n\nThe last point on \"configuration\" vs \"load\" is about RPC interface. We already use \"configuration\" field to report resource usage in RPC interface, but it looks a bit odd to me. It can be improved later.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"26cc8e2210ee8a3be4eeaa87c66a53e14a286101","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        return conf"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_agent_load(self, agent, res):"},{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027, None)"},{"line_number":125,"context_line":"        if load_type:"},{"line_number":126,"context_line":"            configs \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":127,"context_line":"            res[\u0027load\u0027] \u003d int(configs[load_type])"}],"source_content_type":"text/x-python","patch_set":14,"id":"da86d52c_3563641b","line":124,"updated":"2015-02-18 12:42:33.000000000","message":", None is not needed as it\u0027s the implicit default value","commit_id":"97ac0256adb7a00b3a837a5b91225501b4a9c7a9"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"92e50d19b1c8fbb6712a0b25c9d0f09dd74d7242","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        return conf"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_agent_load(self, agent, res):"},{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027, None)"},{"line_number":125,"context_line":"        if load_type:"},{"line_number":126,"context_line":"            configs \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":127,"context_line":"            res[\u0027load\u0027] \u003d int(configs[load_type])"}],"source_content_type":"text/x-python","patch_set":14,"id":"da86d52c_efe3b102","line":124,"in_reply_to":"da86d52c_3563641b","updated":"2015-02-18 14:32:58.000000000","message":"Done","commit_id":"97ac0256adb7a00b3a837a5b91225501b4a9c7a9"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"af972aadc251a222eb82acbd9b3de339b1073768","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                           \u0027host\u0027: agent_db.host})"},{"line_number":120,"context_line":"            conf \u003d {}"},{"line_number":121,"context_line":"        return conf"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_agent_load(self, agent, res):"},{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027, None)"},{"line_number":125,"context_line":"        if load_type:"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba7be1f8_eda50105","line":122,"updated":"2015-02-20 17:13:14.000000000","message":"My concern about using \u0027load\u0027 reported from agent is this information is updated periodically (default: 30sec).\nIf we request/create several number of resources (e.g. 10 or more), there is possibility that all resources are scheduled into one agent because information is not updated when the scheduler is called.\n\nIn a case where we have thousands of resources, this may not be a problem, but let me discuss.","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6212fc10fe00a0778f37bb8d53b46cd6cb763519","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                           \u0027host\u0027: agent_db.host})"},{"line_number":120,"context_line":"            conf \u003d {}"},{"line_number":121,"context_line":"        return conf"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_agent_load(self, agent, res):"},{"line_number":124,"context_line":"        load_type \u003d agent.get(\u0027load_type\u0027, None)"},{"line_number":125,"context_line":"        if load_type:"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba7be1f8_830af823","line":122,"in_reply_to":"ba7be1f8_eda50105","updated":"2015-02-25 16:06:50.000000000","message":"This is problem that I would call \u0027instability or unfairness of the scheduler\u0027, because the scheduler makes a decision based on a \u0027stale\u0027 state of the world. However, how likely is this to happen?\n\nFor dhcp this unbalance can occur when you have (net-create, port-create) in sequence and in burst, and that doesn\u0027t seem very typical.","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"ada766fcb5332d7d441d15a629576d7991ee9d71","unresolved":false,"context_lines":[{"line_number":203,"context_line":""},{"line_number":204,"context_line":"            configurations_dict \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":205,"context_line":"            res[\u0027configurations\u0027] \u003d jsonutils.dumps(configurations_dict)"},{"line_number":206,"context_line":"            res \u003d self._get_agent_load(agent, res)"},{"line_number":207,"context_line":"            current_time \u003d timeutils.utcnow()"},{"line_number":208,"context_line":"            try:"},{"line_number":209,"context_line":"                agent_db \u003d self._get_agent_by_type_and_host("}],"source_content_type":"text/x-python","patch_set":18,"id":"ba7be1f8_3d5ffc73","line":206,"updated":"2015-02-24 01:30:52.000000000","message":"nit: The line looks like res is replaced. It\u0027s better to follow a precedent. If so, _get_agent_load should return res[\u0027load\u0027].\n\nres[\u0027load\u0027] \u003d self._get_agent_load(agent, res)","commit_id":"0588aeb53d304341115763b087582660b560df1a"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"8e03b12af9f2cc8858f495c2b30ba3ef7547c5f2","unresolved":false,"context_lines":[{"line_number":203,"context_line":""},{"line_number":204,"context_line":"            configurations_dict \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":205,"context_line":"            res[\u0027configurations\u0027] \u003d jsonutils.dumps(configurations_dict)"},{"line_number":206,"context_line":"            res \u003d self._get_agent_load(agent, res)"},{"line_number":207,"context_line":"            current_time \u003d timeutils.utcnow()"},{"line_number":208,"context_line":"            try:"},{"line_number":209,"context_line":"                agent_db \u003d self._get_agent_by_type_and_host("}],"source_content_type":"text/x-python","patch_set":18,"id":"ba7be1f8_92c44e60","line":206,"in_reply_to":"ba7be1f8_3d5ffc73","updated":"2015-02-24 05:54:41.000000000","message":"Done","commit_id":"0588aeb53d304341115763b087582660b560df1a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3136ead8546744cc82a5ecc37f19eaf53a4230b2","unresolved":false,"context_lines":[{"line_number":40,"context_line":"               help\u003d_(\"Seconds to regard the agent is down; should be at \""},{"line_number":41,"context_line":"                      \"least twice report_interval, to be sure the \""},{"line_number":42,"context_line":"                      \"agent is down for good.\")),"},{"line_number":43,"context_line":"    cfg.StrOpt(\u0027dhcp_load_type\u0027, default\u003d\u0027networks\u0027,"},{"line_number":44,"context_line":"              help\u003d_(\u0027Representing the resource type whose load is being\u0027"},{"line_number":45,"context_line":"                     \u0027obtained by the agent. This can be \"networks\"\u0027"},{"line_number":46,"context_line":"                     \u0027When specified (Default is None), the server will\u0027"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_5728bd85","line":43,"updated":"2015-02-25 16:25:19.000000000","message":"um um...help is not inline with the actual default value.","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"312bcd5ebd8ad6cc6dee81ad7617f955618f60b1","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":83,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":84,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":85,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @property"},{"line_number":88,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_a9e44fe1","line":85,"updated":"2015-02-25 10:35:05.000000000","message":"Why to store something that can be calculated?\n\nAs far as I see right now, current logic allows to schedule infinite number of  networks to one agent without any distribution just because this field is updated in L205, e.g. received from agent and now calculated on the fly at the point of scheduling.\n\nSo basically default behavior will be even worse then with ChanceScheduler.","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"217e8f448ba7b95509d57492d18185edc385a14d","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":83,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":84,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":85,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @property"},{"line_number":88,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_5c00c101","line":85,"in_reply_to":"ba7be1f8_3c76ad06","updated":"2015-02-26 07:30:54.000000000","message":"that\u0027s a fair point, it\u0027s all about how current the scheduler\u0027s view of the world is. I would say that if we look at how generally schedulers operate, there\u0027s always a chance that they make a decision based on a stale view of the infrastructure; making the scheduling more precise is a trade-off between scalability and reliability.\n\nGranted the other approach would be to follow what the LeastRouterScheduler does, and compute the load on the fly by looking at the DB. That also has shortcomings: a) it\u0027s more computationally intensive, because we need to run more complex queries to select the least loaded agent, and b) it can still make \u0027bad\u0027 decisions, because the DB state may not be in sync with the agent state (e.g. the agent is facing errors and it ends up not creating the resources the way it\u0027s supposed to).\n\nSo ultimately it\u0027s not the transitionary phase that counts but the steady state. The real question is: does the algorithm eventually converge? I think this does.","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a7a562eabadb636dc2d8c530e463793b71bb14b2","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":83,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":84,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":85,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @property"},{"line_number":88,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_70364bb6","line":85,"in_reply_to":"ba7be1f8_49628f17","updated":"2015-02-27 09:48:28.000000000","message":"Yup, I think this makes sense.\n\nIf we assume that the scheduler bumps up the load as it makes schedule calls (at the cost of an extra DB call), this ensures that the algorithm is stable even in the transitionary state. This feedback loop makes a lot of sense to me.","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"75717c0293b754c25d546dd92e4882c473bb7472","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":83,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":84,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":85,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @property"},{"line_number":88,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_ff4de73e","line":85,"in_reply_to":"ba7be1f8_5c00c101","updated":"2015-02-26 07:39:44.000000000","message":"One of the reasons a brought this case up is that in case one dhcp agent dies we may get a bunch of networks that need rescheduling. All of them are going to one agent. This is not happening to often, of course, but i think it\u0027s undesirable. \nimo we can do better at low cost: just by updating load field on the fly (by incrementing, not calculating with query). It\u0027s not very accurate solution in case of concurrent scheduling, but at least that will make scheduler fair in case of serial scheduling.","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3136ead8546744cc82a5ecc37f19eaf53a4230b2","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":83,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":84,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":85,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @property"},{"line_number":88,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_f200df35","line":85,"in_reply_to":"ba7be1f8_a9e44fe1","updated":"2015-02-25 16:25:19.000000000","message":"Eugene: I think you\u0027re looking at this from the wrong angle. If the network_scheduler_driver is ChangeScheduler, load is not even considered; the \u0027load\u0027 column is only used to hold resource information extracted from the \u0027configurations\u0027 blob, e.g. networks.\n\nThis helps making load-based decisions without inspecting the configuration blob","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"50f213befe6fa521aea65f8c52cd5ea30db343e9","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":83,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":84,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":85,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @property"},{"line_number":88,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_4d011805","line":85,"in_reply_to":"ba7be1f8_a9e44fe1","updated":"2015-02-25 13:24:12.000000000","message":"The advantage of load column is, server need not perform computations again and again whenever resource is created.\nThe load will be supplied by the agents as part of report status.\nServer just need to sort the load column and pick as many agents as needed to schedule resources on them.\n\nPlease refer to class BaseWeightScheduler(BaseScheduler): in the file base_scheduler.py where the agent selection logic is present.","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"e6b46e4879ace4bec549a44ce9f6c6595f4b037f","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":83,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":84,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":85,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @property"},{"line_number":88,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_ef7fd2a9","line":85,"in_reply_to":"ba7be1f8_ebd369d2","updated":"2015-02-26 22:54:37.000000000","message":"I have the same concern as Eugene\u0027s. I commented the problem on burst scheduling request in past patch set.\n\nThe proposed scheduler is based on the load reported from agents, so when burst scheduling request occurs all networks will be assigned to one agent. One case where burst scheduling request occurs is dhcp-agent auto rescheduling. The other is a simple burst network creation.\n\nScheduling with less computation is good of course, but I think it is not a good idea that we completely reply on the load reported from agents because it can lead to very uneven resource assignment.\n\nLeastRouterScheduler has a good behavior, and as long as the computation cost becomes a problem I think the least scheduler with db query is still a good candidate. \n\nEven if we don\u0027t make this the default scheduler, we need to make this scheduler behave well with dhcp auto-rescheudling.","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a7a562eabadb636dc2d8c530e463793b71bb14b2","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":83,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":84,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":85,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @property"},{"line_number":88,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_01122b58","line":85,"in_reply_to":"ba7be1f8_ef7fd2a9","updated":"2015-02-27 09:48:28.000000000","message":"Agreed, but it seems to me that the problem arises whether you rely solely on load reported by the agent or whether you rely solely on load as indicated by the DB. We can certainly combine the two.","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"65f94f0a7978ef29107f42aff5b70c9cc503d4f1","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":83,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":84,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":85,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @property"},{"line_number":88,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_49628f17","line":85,"in_reply_to":"ba7be1f8_ef7fd2a9","updated":"2015-02-27 06:35:33.000000000","message":"To clarify the example: \n\nwe have 2+ agents, hosting N and M networks, N \u003c M, then either burst scheduling occurs, or some other agent dies and we get a bunch of networks to reschedule (say, K networks). \n\nAll of these networks go to agent hosting N networks, and it is now hosting K+N.\n\nMy suggestion was just to update load field with each scheduling call, so once N+i reaches M, networks start to be distributed between these two agents. I don\u0027t think we need accuracy here (e.g. protection against concurrent \u0027load\u0027 field update), so this could be fairly simple, and not involving db query to count networks.","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"bcab44032a1c82f49b2ca2c26fdfe426fa31f300","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":83,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":84,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":85,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @property"},{"line_number":88,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_fc7ed517","line":85,"in_reply_to":"ba7be1f8_f200df35","updated":"2015-02-26 07:08:41.000000000","message":"\u003e  If the network_scheduler_driver is ChangeScheduler, load is not even considered\nRight, but with current approach, as far as I can see, load is not considered just because load field is not changing with each scheduling.\n\nSay you have 2 agents: one with 1 network and another without any.\nThen there are 100 requests to schedule a network coming in. During scheduling all of those networks will go to the second agent, because it has 0 networks. Only after a while load field is updated and taken into consideration.\nAm I missing anything?","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"265e25be7e3f71c6d4d4626f90f53a44147f52ef","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":83,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":84,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":85,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @property"},{"line_number":88,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_3c76ad06","line":85,"in_reply_to":"ba7be1f8_fc7ed517","updated":"2015-02-26 07:17:31.000000000","message":"ChanceScheduler works based on selecting agents in random fashion. Hence with this change ChanceScheduler is not affected.\nRegarding report status interval please refer to below comments from Armando.\n\nPatch Set 15:\n\n(1 comment)\n\nhttps://review.openstack.org/#/c/137017/15/neutron/db/agents_db.py\nFile neutron/db/agents_db.py:\n\nLine 122:","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"698053f71006a85c09d0dc6337a9c58c984bdd47","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    # configurations: a json dict string, I think 4095 is enough"},{"line_number":83,"context_line":"    configurations \u003d sa.Column(sa.String(4095), nullable\u003dFalse)"},{"line_number":84,"context_line":"    # load - number of resources hosted by the agent"},{"line_number":85,"context_line":"    load \u003d sa.Column(sa.Integer, nullable\u003dTrue)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @property"},{"line_number":88,"context_line":"    def is_active(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_ebd369d2","line":85,"in_reply_to":"ba7be1f8_ff4de73e","updated":"2015-02-26 09:44:04.000000000","message":"Let me see if I understand your case correctly: I assume we have more than one agent (let\u0027s say two), otherwise, the point is really moot.\n\n - Agent A and Agent B.\n - At a given point in time Agent A hosts Na networks, Agent B hosts Nb ones;\n - Agent A dies;\n - If I have auto-rescheduling, all networks will move to Agent B;\n   - when agent B reports state we\u0027ll have load \u003d Na+Nb;\n - with or without auto-rescheduling, new networks will be scheduled to the host available.\n\nI am not sure I understand where the problem lies.\n\nI think the issue may arise if we get a burst of scheduling within the report-interval, and we have a highly uneven distribution of networks, but this means that the scheduling algorithm is not stable, which I don\u0027t think it\u0027s the case.\n\nWe definitely need to explore/think on this a bit more...but we\u0027re not proposing this scheduler to become the default one right now, so I\u0027d be happy to leave this as is and start playing with it once it merges.","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3136ead8546744cc82a5ecc37f19eaf53a4230b2","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        return conf"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _get_agent_load(self, agent, res):"},{"line_number":136,"context_line":"        load_type \u003d cfg.CONF.dhcp_load_type"},{"line_number":137,"context_line":"        if load_type:"},{"line_number":138,"context_line":"            load_type \u003d load_type.strip()"},{"line_number":139,"context_line":"            configs \u003d agent.get(\u0027configurations\u0027, {})"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_86dbe67a","line":136,"updated":"2015-02-25 16:25:19.000000000","message":"This reference to dhcp_load_type here is wrong. The load_type should be reported in the configuration dictionary. So this method becomes:\n\n  def _get_agent_load(self, agent, res):\n    configs \u003d agent.get(\u0027configurations\u0027, {})\n    load_type \u003d configs.get(\u0027load_type\u0027)\n    load \u003d 0\n    if load_type:\n       load \u003d int(configs.get(load_type, 0))\n    return load\n\nThen the (dhcp) agent needs to be extended so that it reads the cfg.CONF.dhcp_load_type and reports it in the configuration dict here:\n\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/dhcp/agent.py#L549\n\nlike this:\n\n  \u0027load_type\u0027: cfg.CONF.dhcp_load_type\n\nSo, I still see missing changes in the dhcp agent file. I keep bringing this up and you keep ignoring me...at one point I am gonna fed up and give you -2 :)","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"312bcd5ebd8ad6cc6dee81ad7617f955618f60b1","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"            configurations_dict \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":204,"context_line":"            res[\u0027configurations\u0027] \u003d jsonutils.dumps(configurations_dict)"},{"line_number":205,"context_line":"            res[\u0027load\u0027] \u003d self._get_agent_load(agent, res)"},{"line_number":206,"context_line":"            current_time \u003d timeutils.utcnow()"},{"line_number":207,"context_line":"            try:"},{"line_number":208,"context_line":"                agent_db \u003d self._get_agent_by_type_and_host("}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_e912c707","line":205,"updated":"2015-02-25 10:35:05.000000000","message":"this doesn\u0027t seem correct. load_type is dhcp-specific now, but this is applied to L3 agent as well.","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"50f213befe6fa521aea65f8c52cd5ea30db343e9","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"            configurations_dict \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":204,"context_line":"            res[\u0027configurations\u0027] \u003d jsonutils.dumps(configurations_dict)"},{"line_number":205,"context_line":"            res[\u0027load\u0027] \u003d self._get_agent_load(agent, res)"},{"line_number":206,"context_line":"            current_time \u003d timeutils.utcnow()"},{"line_number":207,"context_line":"            try:"},{"line_number":208,"context_line":"                agent_db \u003d self._get_agent_by_type_and_host("}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_ed7d6c1d","line":205,"in_reply_to":"ba7be1f8_e912c707","updated":"2015-02-25 13:24:12.000000000","message":"Currently for loads other than dhcp load this value will be set to zero.\nIn future we will consider populating L3 load also however that will be another dependent BP.","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3136ead8546744cc82a5ecc37f19eaf53a4230b2","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"            configurations_dict \u003d agent.get(\u0027configurations\u0027, {})"},{"line_number":204,"context_line":"            res[\u0027configurations\u0027] \u003d jsonutils.dumps(configurations_dict)"},{"line_number":205,"context_line":"            res[\u0027load\u0027] \u003d self._get_agent_load(agent, res)"},{"line_number":206,"context_line":"            current_time \u003d timeutils.utcnow()"},{"line_number":207,"context_line":"            try:"},{"line_number":208,"context_line":"                agent_db \u003d self._get_agent_by_type_and_host("}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_c6c23e52","line":205,"in_reply_to":"ba7be1f8_e912c707","updated":"2015-02-25 16:25:19.000000000","message":"I believe that if you follow my suggestion in line 136, then Eugene\u0027s concern is addressed","commit_id":"a2a7987601b451c8e0c0cdfacd216dc37057c5b6"}],"neutron/db/agentschedulers_db.py":[{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"91c88b77612b7ba58955c88fa695bca2a091307e","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if self.network_scheduler:"},{"line_number":226,"context_line":"            self.network_scheduler.auto_schedule_networks(self, context, host)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def get_dhcp_agents_with_min_networks(self, context, active_agent_ids,"},{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agent with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agents_objs \u003d self.get_agents(context,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_ff26cbcc","line":228,"updated":"2014-11-25 20:50:14.000000000","message":"from code design stand point i wonder why logic of some advanced scheduler is a responsibility of agentschedulers_db.py?","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"51a56f9c946790ef2d9354f7f0b20f39a39cd805","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if self.network_scheduler:"},{"line_number":226,"context_line":"            self.network_scheduler.auto_schedule_networks(self, context, host)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def get_dhcp_agents_with_min_networks(self, context, active_agent_ids,"},{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agent with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agents_objs \u003d self.get_agents(context,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_42c976ab","line":228,"in_reply_to":"5a890539_216584ae","updated":"2014-11-28 10:02:30.000000000","message":"To maintain consistency with l3_agentschedulers_db.py. But, yes this can be inside Scheduler class iteslf.","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"054cb142a6d9c8002973c98ef5f13fa7d0f39af3","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if self.network_scheduler:"},{"line_number":226,"context_line":"            self.network_scheduler.auto_schedule_networks(self, context, host)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def get_dhcp_agents_with_min_networks(self, context, active_agent_ids,"},{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agent with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agents_objs \u003d self.get_agents(context,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_216584ae","line":228,"in_reply_to":"5a890539_ff26cbcc","updated":"2014-11-26 10:47:57.000000000","message":"At least for consistency I guess. get_l3_agent_with_min_routers is also in l3_agentschedulers_db.py","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"d72aaaeeae15312296c9e2d9b7b5c11aa5465886","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    def get_dhcp_agents_with_min_networks(self, context, active_agent_ids,"},{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agent with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agents_objs \u003d self.get_agents(context,"},{"line_number":232,"context_line":"                                          filters\u003d{\u0027id\u0027: active_agent_ids})"},{"line_number":233,"context_line":"        dhcp_agent_dicts \u003d {}"},{"line_number":234,"context_line":"        for dhcp_agent in dhcp_agents_objs:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_0860bbff","line":231,"updated":"2014-11-25 22:46:27.000000000","message":"see my comment in next file. This DB call can be spared if you pass the active agents as parameters in this function","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"51a56f9c946790ef2d9354f7f0b20f39a39cd805","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    def get_dhcp_agents_with_min_networks(self, context, active_agent_ids,"},{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agent with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agents_objs \u003d self.get_agents(context,"},{"line_number":232,"context_line":"                                          filters\u003d{\u0027id\u0027: active_agent_ids})"},{"line_number":233,"context_line":"        dhcp_agent_dicts \u003d {}"},{"line_number":234,"context_line":"        for dhcp_agent in dhcp_agents_objs:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_42409607","line":231,"in_reply_to":"5a890539_0860bbff","updated":"2014-11-28 10:02:30.000000000","message":"We cant spare above db call, since get_agents() method retrieves agents in dict format, which is very much necessary to extract agent[\u0027configurations\u0027][\u0027networks\u0027] parameter.","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"d72aaaeeae15312296c9e2d9b7b5c11aa5465886","unresolved":false,"context_lines":[{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agent with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agents_objs \u003d self.get_agents(context,"},{"line_number":232,"context_line":"                                          filters\u003d{\u0027id\u0027: active_agent_ids})"},{"line_number":233,"context_line":"        dhcp_agent_dicts \u003d {}"},{"line_number":234,"context_line":"        for dhcp_agent in dhcp_agents_objs:"},{"line_number":235,"context_line":"            dhcp_agent_dicts[dhcp_agent[\u0027id\u0027]] \u003d \\"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_88910b49","line":232,"updated":"2014-11-25 22:46:27.000000000","message":"indentation","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"51a56f9c946790ef2d9354f7f0b20f39a39cd805","unresolved":false,"context_lines":[{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agent with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agents_objs \u003d self.get_agents(context,"},{"line_number":232,"context_line":"                                          filters\u003d{\u0027id\u0027: active_agent_ids})"},{"line_number":233,"context_line":"        dhcp_agent_dicts \u003d {}"},{"line_number":234,"context_line":"        for dhcp_agent in dhcp_agents_objs:"},{"line_number":235,"context_line":"            dhcp_agent_dicts[dhcp_agent[\u0027id\u0027]] \u003d \\"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_82499e34","line":232,"in_reply_to":"5a890539_88910b49","updated":"2014-11-28 10:02:30.000000000","message":"Done","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"91c88b77612b7ba58955c88fa695bca2a091307e","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                                          filters\u003d{\u0027id\u0027: active_agent_ids})"},{"line_number":233,"context_line":"        dhcp_agent_dicts \u003d {}"},{"line_number":234,"context_line":"        for dhcp_agent in dhcp_agents_objs:"},{"line_number":235,"context_line":"            dhcp_agent_dicts[dhcp_agent[\u0027id\u0027]] \u003d \\"},{"line_number":236,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":237,"context_line":"        sorted_dhcp_agents \u003d sorted(dhcp_agent_dicts.items(),"},{"line_number":238,"context_line":"                                    key\u003dlambda x: x[1])"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_bf10c359","line":235,"updated":"2014-11-25 20:50:14.000000000","message":"style nit: prefer shorter names to avoid backslashes","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"51a56f9c946790ef2d9354f7f0b20f39a39cd805","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                                          filters\u003d{\u0027id\u0027: active_agent_ids})"},{"line_number":233,"context_line":"        dhcp_agent_dicts \u003d {}"},{"line_number":234,"context_line":"        for dhcp_agent in dhcp_agents_objs:"},{"line_number":235,"context_line":"            dhcp_agent_dicts[dhcp_agent[\u0027id\u0027]] \u003d \\"},{"line_number":236,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":237,"context_line":"        sorted_dhcp_agents \u003d sorted(dhcp_agent_dicts.items(),"},{"line_number":238,"context_line":"                                    key\u003dlambda x: x[1])"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_c7e58fdd","line":235,"in_reply_to":"5a890539_087efb18","updated":"2014-11-28 10:02:30.000000000","message":"ok, will incorporate.","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"d72aaaeeae15312296c9e2d9b7b5c11aa5465886","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                                          filters\u003d{\u0027id\u0027: active_agent_ids})"},{"line_number":233,"context_line":"        dhcp_agent_dicts \u003d {}"},{"line_number":234,"context_line":"        for dhcp_agent in dhcp_agents_objs:"},{"line_number":235,"context_line":"            dhcp_agent_dicts[dhcp_agent[\u0027id\u0027]] \u003d \\"},{"line_number":236,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":237,"context_line":"        sorted_dhcp_agents \u003d sorted(dhcp_agent_dicts.items(),"},{"line_number":238,"context_line":"                                    key\u003dlambda x: x[1])"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_087efb18","line":235,"in_reply_to":"5a890539_bf10c359","updated":"2014-11-25 22:46:27.000000000","message":"or per hacking guide use parenthesis instead of backslashes","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"d72aaaeeae15312296c9e2d9b7b5c11aa5465886","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":237,"context_line":"        sorted_dhcp_agents \u003d sorted(dhcp_agent_dicts.items(),"},{"line_number":238,"context_line":"                                    key\u003dlambda x: x[1])"},{"line_number":239,"context_line":"        sorted_dhcp_agent_ids \u003d \\"},{"line_number":240,"context_line":"            [agent[0] for agent in sorted_dhcp_agents][0: agents_needed]"},{"line_number":241,"context_line":"        dhcp_agents \u003d self.get_agents_db(context,"},{"line_number":242,"context_line":"                                         filters\u003d{\u0027id\u0027: sorted_dhcp_agent_ids})"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_73e05426","line":239,"updated":"2014-11-25 22:46:27.000000000","message":"nit: renaming this to \"chosen_dhcp_agent_ids\" would make the code more clear","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"91c88b77612b7ba58955c88fa695bca2a091307e","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":237,"context_line":"        sorted_dhcp_agents \u003d sorted(dhcp_agent_dicts.items(),"},{"line_number":238,"context_line":"                                    key\u003dlambda x: x[1])"},{"line_number":239,"context_line":"        sorted_dhcp_agent_ids \u003d \\"},{"line_number":240,"context_line":"            [agent[0] for agent in sorted_dhcp_agents][0: agents_needed]"},{"line_number":241,"context_line":"        dhcp_agents \u003d self.get_agents_db(context,"},{"line_number":242,"context_line":"                                         filters\u003d{\u0027id\u0027: sorted_dhcp_agent_ids})"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_ff0deb3e","line":239,"updated":"2014-11-25 20:50:14.000000000","message":"same as above","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"51a56f9c946790ef2d9354f7f0b20f39a39cd805","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":237,"context_line":"        sorted_dhcp_agents \u003d sorted(dhcp_agent_dicts.items(),"},{"line_number":238,"context_line":"                                    key\u003dlambda x: x[1])"},{"line_number":239,"context_line":"        sorted_dhcp_agent_ids \u003d \\"},{"line_number":240,"context_line":"            [agent[0] for agent in sorted_dhcp_agents][0: agents_needed]"},{"line_number":241,"context_line":"        dhcp_agents \u003d self.get_agents_db(context,"},{"line_number":242,"context_line":"                                         filters\u003d{\u0027id\u0027: sorted_dhcp_agent_ids})"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_025daeec","line":239,"in_reply_to":"5a890539_73e05426","updated":"2014-11-28 10:02:30.000000000","message":"Done","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"d72aaaeeae15312296c9e2d9b7b5c11aa5465886","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                                    key\u003dlambda x: x[1])"},{"line_number":239,"context_line":"        sorted_dhcp_agent_ids \u003d \\"},{"line_number":240,"context_line":"            [agent[0] for agent in sorted_dhcp_agents][0: agents_needed]"},{"line_number":241,"context_line":"        dhcp_agents \u003d self.get_agents_db(context,"},{"line_number":242,"context_line":"                                         filters\u003d{\u0027id\u0027: sorted_dhcp_agent_ids})"},{"line_number":243,"context_line":"        return dhcp_agents"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_732db48e","line":241,"updated":"2014-11-25 22:46:27.000000000","message":"this DB call can also be avoided. You got all the agents at line 231 or if you follow my previous suggestion you have them passed to this function as param. You can just filter the collection using sorted_dhcp_agent_ids instead of getting the agent data again from the DB","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"51a56f9c946790ef2d9354f7f0b20f39a39cd805","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                                    key\u003dlambda x: x[1])"},{"line_number":239,"context_line":"        sorted_dhcp_agent_ids \u003d \\"},{"line_number":240,"context_line":"            [agent[0] for agent in sorted_dhcp_agents][0: agents_needed]"},{"line_number":241,"context_line":"        dhcp_agents \u003d self.get_agents_db(context,"},{"line_number":242,"context_line":"                                         filters\u003d{\u0027id\u0027: sorted_dhcp_agent_ids})"},{"line_number":243,"context_line":"        return dhcp_agents"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_a26dba9b","line":241,"in_reply_to":"5a890539_732db48e","updated":"2014-11-28 10:02:30.000000000","message":"Yes, this DB call can be removed, if we pass all active agent objects to this method as parameter.","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"9a97ce32afd21bba362209f80a48a567cc2c6211","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if self.network_scheduler:"},{"line_number":226,"context_line":"            self.network_scheduler.auto_schedule_networks(self, context, host)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def get_dhcp_agents_with_min_networks(self, context, active_dhcp_agents,"},{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agents with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agent_ids \u003d [cndt[\u0027id\u0027] for cndt in active_dhcp_agents]"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_0007bd18","line":228,"updated":"2014-12-04 07:30:16.000000000","message":"+1, this type of sorting is great to offload to the database.\n\nonly thing to add is the slice for agents_needed\n\n...\nreturn [item[0] for item in res][0:agents_needed]","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":8940,"name":"Sourabh Patwardhan","email":"sopatwar@gmail.com","username":"sopatwar"},"change_message_id":"567a4d72db47daa24babecc97ba2c60a0e90c230","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if self.network_scheduler:"},{"line_number":226,"context_line":"            self.network_scheduler.auto_schedule_networks(self, context, host)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def get_dhcp_agents_with_min_networks(self, context, active_dhcp_agents,"},{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agents with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agent_ids \u003d [cndt[\u0027id\u0027] for cndt in active_dhcp_agents]"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_d2b3d497","line":228,"updated":"2014-12-04 02:23:03.000000000","message":"Consider the following implementation:\n\n    def get_dhcp_agents_with_min_networks(self, context, agent_ids):\n        \"\"\"Return list of DHCP agents ordered by least number of networks.\"\"\"\n        query \u003d context.session.query(\n            agents_db.Agent,\n            func.count(\n                NetworkDhcpAgentBinding.network_id\n            ).label(\u0027count\u0027)).outerjoin(NetworkDhcpAgentBinding).group_by(\n                NetworkDhcpAgentBinding.dhcp_agent_id).order_by(\u0027count\u0027)\n        res \u003d query.filter(agents_db.Agent.id.in_(agent_ids))\n        return [item[0] for item in res]\n\nThis implementation is based on the method get_l3_agent_with_min_routers() in L3AgentSchedulerDbMixin","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"c66a266515afd1d0c68a117c89104fca9ddad4da","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if self.network_scheduler:"},{"line_number":226,"context_line":"            self.network_scheduler.auto_schedule_networks(self, context, host)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def get_dhcp_agents_with_min_networks(self, context, active_dhcp_agents,"},{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agents with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agent_ids \u003d [cndt[\u0027id\u0027] for cndt in active_dhcp_agents]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_5053e138","line":228,"in_reply_to":"3a961159_be9ce15e","updated":"2014-12-17 16:54:46.000000000","message":"The slice can be done by the db?\n \n  res\u003d query.filter(...).limit(agents_needed)","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"c7ebc978a1b4f17224a82eafe1c1179ec6085745","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if self.network_scheduler:"},{"line_number":226,"context_line":"            self.network_scheduler.auto_schedule_networks(self, context, host)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def get_dhcp_agents_with_min_networks(self, context, active_dhcp_agents,"},{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agents with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agent_ids \u003d [cndt[\u0027id\u0027] for cndt in active_dhcp_agents]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_be9ce15e","line":228,"in_reply_to":"5a890539_0007bd18","updated":"2014-12-17 12:13:14.000000000","message":"+1 to Kevin\u0027s suggestion","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if self.network_scheduler:"},{"line_number":226,"context_line":"            self.network_scheduler.auto_schedule_networks(self, context, host)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def get_dhcp_agents_with_min_networks(self, context, active_dhcp_agents,"},{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agents with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agent_ids \u003d [cndt[\u0027id\u0027] for cndt in active_dhcp_agents]"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_9fd4e747","line":228,"in_reply_to":"5a890539_0007bd18","updated":"2014-12-18 09:33:53.000000000","message":"From blueprint feedbacks, we have thought of adding a new column \u0027load\u0027 to agents table which contains number of networks hosted by the agent. So, we can sort agents based on load and pick first \u0027n\u0027 agents from the query.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":12255,"name":"Benjamin GRASSART","email":"benjamin.grassart@thalesgroup.com","username":"benjamin.grassart"},"change_message_id":"58433e91489f4a2d536c48391b6c774178adcb75","unresolved":false,"context_lines":[{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agents with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agent_ids \u003d [cndt[\u0027id\u0027] for cndt in active_dhcp_agents]"},{"line_number":232,"context_line":"        dhcp_agent_objs \u003d self.get_agents(context,"},{"line_number":233,"context_line":"                                          filters\u003d{\u0027id\u0027: dhcp_agent_ids})"},{"line_number":234,"context_line":"        dhcp_agent_dict \u003d {}"},{"line_number":235,"context_line":"        for dhcp_agent in dhcp_agent_objs:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_4fd75fee","line":232,"updated":"2014-12-03 14:56:04.000000000","message":"Do you really need to re-query all agent froms ids ? \n\nDoesn\u0027t \"active_dhcp_agents\" already is a list composed of \"full\" dhcp agent object, so you would have all informations in there ?","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":229,"context_line":"                                          agents_needed):"},{"line_number":230,"context_line":"        \"\"\"Return dhcp agents with the least number of networks.\"\"\""},{"line_number":231,"context_line":"        dhcp_agent_ids \u003d [cndt[\u0027id\u0027] for cndt in active_dhcp_agents]"},{"line_number":232,"context_line":"        dhcp_agent_objs \u003d self.get_agents(context,"},{"line_number":233,"context_line":"                                          filters\u003d{\u0027id\u0027: dhcp_agent_ids})"},{"line_number":234,"context_line":"        dhcp_agent_dict \u003d {}"},{"line_number":235,"context_line":"        for dhcp_agent in dhcp_agent_objs:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_bfad2386","line":232,"in_reply_to":"5a890539_4fd75fee","updated":"2014-12-18 09:33:53.000000000","message":"Based on the approved design, we will update the code.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"6f3ba1bcffc9ee4c272a1a48fc782ccef8f4acc1","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        dhcp_agent_dict \u003d {}"},{"line_number":235,"context_line":"        for dhcp_agent in dhcp_agent_objs:"},{"line_number":236,"context_line":"            dhcp_agent_dict[dhcp_agent[\u0027id\u0027]] \u003d \\"},{"line_number":237,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":238,"context_line":"        chosen_agent_dict \u003d sorted(dhcp_agent_dict.items(), key\u003dlambda x: x[1])"},{"line_number":239,"context_line":"        chosen_agent_ids \u003d [agent[0] for agent in chosen_agent_dict]"},{"line_number":240,"context_line":"        chosen_agent_ids \u003d chosen_agent_ids[0: agents_needed]"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_ed446174","line":237,"updated":"2014-12-04 12:41:51.000000000","message":"Do we need to define a dictionary? If just after we transform it in a list of 2-uplets. And both are stored in the same variable (sick).\n\nWe can directly compute the list of 2-uplets if dhcp_agent_ids is a set:\n\n  dhcp_agent_ids \u003d {cndt[\u0027id\u0027] for cndt in active_dhcp_agents}\n  ...\n  dhcp_agent_loads \u003d [(x[\u0027configurations\u0027][\u0027networks\u0027], x[\u0027id\u0027]) for x in ...]\n  dhcp_agent_loads.sort()\n\nIt seems clearer than l234-238","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        dhcp_agent_dict \u003d {}"},{"line_number":235,"context_line":"        for dhcp_agent in dhcp_agent_objs:"},{"line_number":236,"context_line":"            dhcp_agent_dict[dhcp_agent[\u0027id\u0027]] \u003d \\"},{"line_number":237,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":238,"context_line":"        chosen_agent_dict \u003d sorted(dhcp_agent_dict.items(), key\u003dlambda x: x[1])"},{"line_number":239,"context_line":"        chosen_agent_ids \u003d [agent[0] for agent in chosen_agent_dict]"},{"line_number":240,"context_line":"        chosen_agent_ids \u003d chosen_agent_ids[0: agents_needed]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_cfdd5a16","line":237,"in_reply_to":"5a890539_ed446174","updated":"2014-12-18 09:33:53.000000000","message":"Thank you for simplified expression. \nBased on the approved design, we will update the code.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":12255,"name":"Benjamin GRASSART","email":"benjamin.grassart@thalesgroup.com","username":"benjamin.grassart"},"change_message_id":"58433e91489f4a2d536c48391b6c774178adcb75","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        for dhcp_agent in dhcp_agent_objs:"},{"line_number":236,"context_line":"            dhcp_agent_dict[dhcp_agent[\u0027id\u0027]] \u003d \\"},{"line_number":237,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":238,"context_line":"        chosen_agent_dict \u003d sorted(dhcp_agent_dict.items(), key\u003dlambda x: x[1])"},{"line_number":239,"context_line":"        chosen_agent_ids \u003d [agent[0] for agent in chosen_agent_dict]"},{"line_number":240,"context_line":"        chosen_agent_ids \u003d chosen_agent_ids[0: agents_needed]"},{"line_number":241,"context_line":"        for agent in active_dhcp_agents:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_0faf17e4","line":238,"updated":"2014-12-03 14:56:04.000000000","message":"\"chosen_agent_dict\" is an ordered list, I think it should be named differently, because it is not a dict !","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"6f3ba1bcffc9ee4c272a1a48fc782ccef8f4acc1","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        for dhcp_agent in dhcp_agent_objs:"},{"line_number":236,"context_line":"            dhcp_agent_dict[dhcp_agent[\u0027id\u0027]] \u003d \\"},{"line_number":237,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":238,"context_line":"        chosen_agent_dict \u003d sorted(dhcp_agent_dict.items(), key\u003dlambda x: x[1])"},{"line_number":239,"context_line":"        chosen_agent_ids \u003d [agent[0] for agent in chosen_agent_dict]"},{"line_number":240,"context_line":"        chosen_agent_ids \u003d chosen_agent_ids[0: agents_needed]"},{"line_number":241,"context_line":"        for agent in active_dhcp_agents:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_cd416564","line":238,"updated":"2014-12-04 12:41:51.000000000","message":"you should use:\n\n  operator.itemgetter(1)\n\ninstead of:\n\n  lambda x:x[1]","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        for dhcp_agent in dhcp_agent_objs:"},{"line_number":236,"context_line":"            dhcp_agent_dict[dhcp_agent[\u0027id\u0027]] \u003d \\"},{"line_number":237,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":238,"context_line":"        chosen_agent_dict \u003d sorted(dhcp_agent_dict.items(), key\u003dlambda x: x[1])"},{"line_number":239,"context_line":"        chosen_agent_ids \u003d [agent[0] for agent in chosen_agent_dict]"},{"line_number":240,"context_line":"        chosen_agent_ids \u003d chosen_agent_ids[0: agents_needed]"},{"line_number":241,"context_line":"        for agent in active_dhcp_agents:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_df202f9c","line":238,"in_reply_to":"5a890539_0faf17e4","updated":"2014-12-18 09:33:53.000000000","message":"Based on the approved design, we will update the code.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        for dhcp_agent in dhcp_agent_objs:"},{"line_number":236,"context_line":"            dhcp_agent_dict[dhcp_agent[\u0027id\u0027]] \u003d \\"},{"line_number":237,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":238,"context_line":"        chosen_agent_dict \u003d sorted(dhcp_agent_dict.items(), key\u003dlambda x: x[1])"},{"line_number":239,"context_line":"        chosen_agent_ids \u003d [agent[0] for agent in chosen_agent_dict]"},{"line_number":240,"context_line":"        chosen_agent_ids \u003d chosen_agent_ids[0: agents_needed]"},{"line_number":241,"context_line":"        for agent in active_dhcp_agents:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_2079f2fc","line":238,"in_reply_to":"5a890539_cd416564","updated":"2014-12-18 09:33:53.000000000","message":"Done","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":12255,"name":"Benjamin GRASSART","email":"benjamin.grassart@thalesgroup.com","username":"benjamin.grassart"},"change_message_id":"58433e91489f4a2d536c48391b6c774178adcb75","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":238,"context_line":"        chosen_agent_dict \u003d sorted(dhcp_agent_dict.items(), key\u003dlambda x: x[1])"},{"line_number":239,"context_line":"        chosen_agent_ids \u003d [agent[0] for agent in chosen_agent_dict]"},{"line_number":240,"context_line":"        chosen_agent_ids \u003d chosen_agent_ids[0: agents_needed]"},{"line_number":241,"context_line":"        for agent in active_dhcp_agents:"},{"line_number":242,"context_line":"            if agent[\u0027id\u0027] not in chosen_agent_ids:"},{"line_number":243,"context_line":"                active_dhcp_agents.remove(agent)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_5530d2e8","line":240,"updated":"2014-12-03 14:56:04.000000000","message":"The four lines below can be sum up in 2 lines, with an algoritm which seems clearer to me: \n\nreturn [ agent for agent in active_dhcp_agents \n\t\tif agent[\u0027id\u0027] in chosen_agent_ids ]","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                dhcp_agent[\u0027configurations\u0027][\u0027networks\u0027]"},{"line_number":238,"context_line":"        chosen_agent_dict \u003d sorted(dhcp_agent_dict.items(), key\u003dlambda x: x[1])"},{"line_number":239,"context_line":"        chosen_agent_ids \u003d [agent[0] for agent in chosen_agent_dict]"},{"line_number":240,"context_line":"        chosen_agent_ids \u003d chosen_agent_ids[0: agents_needed]"},{"line_number":241,"context_line":"        for agent in active_dhcp_agents:"},{"line_number":242,"context_line":"            if agent[\u0027id\u0027] not in chosen_agent_ids:"},{"line_number":243,"context_line":"                active_dhcp_agents.remove(agent)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_fc0c1944","line":240,"in_reply_to":"5a890539_5530d2e8","updated":"2014-12-18 09:33:53.000000000","message":"Thanks for simplified list comprehension.\nBased on the approved design, we will update the code.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"4d16530a03c98b8dbd2d64a11aa33f4f80b53c68","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        for agent in active_dhcp_agents:"},{"line_number":242,"context_line":"            if agent[\u0027id\u0027] not in chosen_agent_ids:"},{"line_number":243,"context_line":"                active_dhcp_agents.remove(agent)"},{"line_number":244,"context_line":"        return active_dhcp_agents"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_0e4c4341","line":244,"updated":"2014-12-04 13:35:37.000000000","message":"Using a specific column for loads would allow to delegate the agent order and truncate","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        for agent in active_dhcp_agents:"},{"line_number":242,"context_line":"            if agent[\u0027id\u0027] not in chosen_agent_ids:"},{"line_number":243,"context_line":"                active_dhcp_agents.remove(agent)"},{"line_number":244,"context_line":"        return active_dhcp_agents"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_c022ee00","line":244,"in_reply_to":"5a890539_0e4c4341","updated":"2014-12-18 09:33:53.000000000","message":"Based on the approved design, we will be adding extra column to agents table, and sorting agents based on it.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6e14ba56bad7efbf3d30fede34f3341ebf55cbc0","unresolved":false,"context_lines":[{"line_number":41,"context_line":"AGENTS_SCHEDULER_OPTS \u003d ["},{"line_number":42,"context_line":"    cfg.StrOpt(\u0027network_scheduler_driver\u0027,"},{"line_number":43,"context_line":"               default\u003d\u0027neutron.scheduler.\u0027"},{"line_number":44,"context_line":"                       \u0027base_scheduler.ChanceScheduler\u0027,"},{"line_number":45,"context_line":"               help\u003d_(\u0027Driver to use for scheduling network to DHCP agent\u0027)),"},{"line_number":46,"context_line":"    cfg.BoolOpt(\u0027network_auto_schedule\u0027, default\u003dTrue,"},{"line_number":47,"context_line":"                help\u003d_(\u0027Allow auto scheduling networks to DHCP agent.\u0027)),"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_675cbc4d","line":44,"updated":"2015-02-15 16:58:29.000000000","message":"your changes must be backward compatible. Please make sure you can do so.","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":41,"context_line":"AGENTS_SCHEDULER_OPTS \u003d ["},{"line_number":42,"context_line":"    cfg.StrOpt(\u0027network_scheduler_driver\u0027,"},{"line_number":43,"context_line":"               default\u003d\u0027neutron.scheduler.\u0027"},{"line_number":44,"context_line":"                       \u0027base_scheduler.ChanceScheduler\u0027,"},{"line_number":45,"context_line":"               help\u003d_(\u0027Driver to use for scheduling network to DHCP agent\u0027)),"},{"line_number":46,"context_line":"    cfg.BoolOpt(\u0027network_auto_schedule\u0027, default\u003dTrue,"},{"line_number":47,"context_line":"                help\u003d_(\u0027Allow auto scheduling networks to DHCP agent.\u0027)),"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_82919e9c","line":44,"in_reply_to":"da86d52c_675cbc4d","updated":"2015-02-15 17:25:39.000000000","message":"Agreed","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f8082aea7b7f287bb18a72ef8ab8f13a099edf5f","unresolved":false,"context_lines":[{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    def auto_schedule_networks(self, context, host):"},{"line_number":391,"context_line":"        if self.network_scheduler:"},{"line_number":392,"context_line":"            self.network_scheduler.resource_filter.auto_schedule_networks(self,"},{"line_number":393,"context_line":"                                                                 context, host)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_eaa1f5a9","line":392,"updated":"2015-02-18 03:11:04.000000000","message":"I think the auto_schedule_networks will need to continue to be a wart of the dhcp scheduler, so I\u0027d rather keep it on the dhcp scheduler class.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"75694cc2eff2d05b439af4198bd678614e56a323","unresolved":false,"context_lines":[{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    def auto_schedule_networks(self, context, host):"},{"line_number":391,"context_line":"        if self.network_scheduler:"},{"line_number":392,"context_line":"            self.network_scheduler.resource_filter.auto_schedule_networks(self,"},{"line_number":393,"context_line":"                                                                 context, host)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_f560ed36","line":392,"in_reply_to":"da86d52c_9341913b","updated":"2015-02-18 12:17:02.000000000","message":"Done","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c4f880bde082bc798cf3979c502823081f69208b","unresolved":false,"context_lines":[{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    def auto_schedule_networks(self, context, host):"},{"line_number":391,"context_line":"        if self.network_scheduler:"},{"line_number":392,"context_line":"            self.network_scheduler.resource_filter.auto_schedule_networks(self,"},{"line_number":393,"context_line":"                                                                 context, host)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_9341913b","line":392,"in_reply_to":"da86d52c_eaa1f5a9","updated":"2015-02-18 09:50:02.000000000","message":"Agree with Armando.\nIMHO filters narrows candidates based on their policy and a scheduler allocates a resource to a specific worker from the candidates (allocates a network to an agent in this case), so I think it is better to have auto_scheduler_networks in the DHCP scheduler.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"}],"neutron/db/migration/alembic_migrations/versions/16b59ee91668_weight_scheduler.py":[{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"fe8a1f417f5e207015165aa8cfe526d795a8090e","unresolved":false,"context_lines":[{"line_number":18,"context_line":"Revision ID: 16b59ee91668"},{"line_number":19,"context_line":"Revises: 2d2a8a565438"},{"line_number":20,"context_line":"Create Date: 2015-02-13 14:27:55.641533"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"# revision identifiers, used by Alembic."}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_5c878fd7","line":21,"updated":"2015-02-15 13:47:49.000000000","message":"Remove this blank line.","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":18,"context_line":"Revision ID: 16b59ee91668"},{"line_number":19,"context_line":"Revises: 2d2a8a565438"},{"line_number":20,"context_line":"Create Date: 2015-02-13 14:27:55.641533"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"# revision identifiers, used by Alembic."}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_877290e1","line":21,"in_reply_to":"da86d52c_5c878fd7","updated":"2015-02-15 17:25:39.000000000","message":"Agreed","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"fe8a1f417f5e207015165aa8cfe526d795a8090e","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"# revision identifiers, used by Alembic."},{"line_number":25,"context_line":"revision \u003d \u002716b59ee91668\u0027"},{"line_number":26,"context_line":"down_revision \u003d \u00272d2a8a565438\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"from alembic import op"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_7c6b731f","line":26,"updated":"2015-02-15 13:47:49.000000000","message":"ditto","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"# revision identifiers, used by Alembic."},{"line_number":25,"context_line":"revision \u003d \u002716b59ee91668\u0027"},{"line_number":26,"context_line":"down_revision \u003d \u00272d2a8a565438\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"from alembic import op"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_a77f94aa","line":26,"in_reply_to":"da86d52c_7c6b731f","updated":"2015-02-15 17:25:39.000000000","message":"Agreed","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"}],"neutron/db/migration/alembic_migrations/versions/4e2c53c8a461_least_networks_scheduler.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0263996e5d0f871ff2a12f455e77656cfb1ba840","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def downgrade():"},{"line_number":44,"context_line":"    pass"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_339c036a","line":44,"updated":"2015-01-08 19:10:44.000000000","message":"we should drop the column here","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e71f9fe104ca4e0d8f6f5f0dc8c995cee8742539","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def downgrade():"},{"line_number":44,"context_line":"    pass"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_a595fb40","line":44,"in_reply_to":"3a961159_339c036a","updated":"2015-01-09 09:51:00.000000000","message":"Agreed.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"}],"neutron/db/migration/alembic_migrations/versions/514569be2d18_least_loaded_scheduler.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"864aa9f8e12b362fa87c428561ab8371635c9349","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 OpenStack Foundation"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_423be8d0","line":1,"updated":"2015-01-29 19:02:30.000000000","message":"please rename this file \u0027514569be2d18_weight_scheduler.py\u0027","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ebfb0e27efb849b4578d3e6781beebc44e255227","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 OpenStack Foundation"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_6bc107e4","line":1,"in_reply_to":"fa81d914_423be8d0","updated":"2015-02-01 05:48:07.000000000","message":"Done","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"bdcd7dd37d6c06320c4df5a5575c11ef5b1b0d67","unresolved":false,"context_lines":[{"line_number":33,"context_line":"def upgrade():"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    if not migration.schema_has_table(\u0027agents\u0027):"},{"line_number":36,"context_line":"        return"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    op.add_column(\u0027agents\u0027,"},{"line_number":39,"context_line":"                  sa.Column(\u0027load\u0027, sa.Integer()))"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a930d6b_ce3251a6","line":36,"updated":"2015-01-27 09:19:01.000000000","message":"Why do we need this condition there? What is the case when table agents is not in db scheme?","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"3382b43d4e61c95fac17954d6739337486eeb4af","unresolved":false,"context_lines":[{"line_number":33,"context_line":"def upgrade():"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    if not migration.schema_has_table(\u0027agents\u0027):"},{"line_number":36,"context_line":"        return"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    op.add_column(\u0027agents\u0027,"},{"line_number":39,"context_line":"                  sa.Column(\u0027load\u0027, sa.Integer()))"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_72365a05","line":36,"in_reply_to":"1a930d6b_ce3251a6","updated":"2015-01-28 05:17:38.000000000","message":"We wanted to make sure agents table to be present always, hence this check has been added. If not required we will remove this check.","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"864aa9f8e12b362fa87c428561ab8371635c9349","unresolved":false,"context_lines":[{"line_number":33,"context_line":"def upgrade():"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    if not migration.schema_has_table(\u0027agents\u0027):"},{"line_number":36,"context_line":"        return"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    op.add_column(\u0027agents\u0027,"},{"line_number":39,"context_line":"                  sa.Column(\u0027load\u0027, sa.Integer()))"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_ffe8f9b5","line":36,"in_reply_to":"fa81d914_72365a05","updated":"2015-01-29 19:02:30.000000000","message":"please remove this check as Ann suggested, this is not necessary.","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ebfb0e27efb849b4578d3e6781beebc44e255227","unresolved":false,"context_lines":[{"line_number":33,"context_line":"def upgrade():"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    if not migration.schema_has_table(\u0027agents\u0027):"},{"line_number":36,"context_line":"        return"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    op.add_column(\u0027agents\u0027,"},{"line_number":39,"context_line":"                  sa.Column(\u0027load\u0027, sa.Integer()))"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_8bb63b89","line":36,"in_reply_to":"fa81d914_ffe8f9b5","updated":"2015-02-01 05:48:07.000000000","message":"Done","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"}],"neutron/plugins/bigswitch/plugin.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":493,"context_line":"        self.network_scheduler \u003d importutils.import_object("},{"line_number":494,"context_line":"            cfg.CONF.network_scheduler_driver"},{"line_number":495,"context_line":"        )"},{"line_number":496,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":497,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":498,"context_line":"        )"},{"line_number":499,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_98d98f59","line":496,"updated":"2015-02-11 21:41:04.000000000","message":"yuk, get rid of these.","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":493,"context_line":"        self.network_scheduler \u003d importutils.import_object("},{"line_number":494,"context_line":"            cfg.CONF.network_scheduler_driver"},{"line_number":495,"context_line":"        )"},{"line_number":496,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":497,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":498,"context_line":"        )"},{"line_number":499,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_a085d95a","line":496,"in_reply_to":"da86d52c_98d98f59","updated":"2015-02-13 18:00:45.000000000","message":"Will remove import statement, instead will call add_filter method passing a string with specific filter name.","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":493,"context_line":"        self.network_scheduler \u003d importutils.import_object("},{"line_number":494,"context_line":"            cfg.CONF.network_scheduler_driver"},{"line_number":495,"context_line":"        )"},{"line_number":496,"context_line":"        self.network_scheduler.add_filter(\u0027DhcpFilter\u0027)"},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"        # setup rpc for security and DHCP agents"},{"line_number":499,"context_line":"        self._setup_rpc()"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_d83f1086","line":496,"updated":"2015-02-14 22:07:53.000000000","message":"As I commented in base_scheduler.py, I believe add_filter should be done as a part of the initialization process of a network scheduler.\nIt is not a plugin-dependent parameter.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":493,"context_line":"        self.network_scheduler \u003d importutils.import_object("},{"line_number":494,"context_line":"            cfg.CONF.network_scheduler_driver"},{"line_number":495,"context_line":"        )"},{"line_number":496,"context_line":"        self.network_scheduler.add_filter(\u0027DhcpFilter\u0027)"},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"        # setup rpc for security and DHCP agents"},{"line_number":499,"context_line":"        self._setup_rpc()"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_132fcaf7","line":496,"in_reply_to":"da86d52c_d83f1086","updated":"2015-02-15 07:16:08.000000000","message":"Will think about your suggestion.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"}],"neutron/plugins/brocade/NeutronPlugin.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":236,"context_line":"            cfg.CONF.network_scheduler_driver"},{"line_number":237,"context_line":"        )"},{"line_number":238,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":239,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":240,"context_line":"        )"},{"line_number":241,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"},{"line_number":242,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_f8e7eb0f","line":239,"updated":"2015-02-11 21:41:04.000000000","message":"and this","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":236,"context_line":"            cfg.CONF.network_scheduler_driver"},{"line_number":237,"context_line":"        )"},{"line_number":238,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":239,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":240,"context_line":"        )"},{"line_number":241,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"},{"line_number":242,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_a0ecf92a","line":239,"in_reply_to":"da86d52c_f8e7eb0f","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"}],"neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        self.network_scheduler \u003d importutils.import_object("},{"line_number":103,"context_line":"            q_conf.CONF.network_scheduler_driver"},{"line_number":104,"context_line":"        )"},{"line_number":105,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":106,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":107,"context_line":"        )"},{"line_number":108,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_18e59f08","line":105,"updated":"2015-02-11 21:41:04.000000000","message":"and this","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        self.network_scheduler \u003d importutils.import_object("},{"line_number":103,"context_line":"            q_conf.CONF.network_scheduler_driver"},{"line_number":104,"context_line":"        )"},{"line_number":105,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":106,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":107,"context_line":"        )"},{"line_number":108,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_c0f1ed02","line":105,"in_reply_to":"da86d52c_18e59f08","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        self.network_scheduler \u003d importutils.import_object("},{"line_number":134,"context_line":"            cfg.CONF.network_scheduler_driver"},{"line_number":135,"context_line":"        )"},{"line_number":136,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":137,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":138,"context_line":"        )"},{"line_number":139,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_58eb97db","line":136,"updated":"2015-02-11 21:41:04.000000000","message":"and this","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        self.network_scheduler \u003d importutils.import_object("},{"line_number":134,"context_line":"            cfg.CONF.network_scheduler_driver"},{"line_number":135,"context_line":"        )"},{"line_number":136,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":137,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":138,"context_line":"        )"},{"line_number":139,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_e0f6f1f8","line":136,"in_reply_to":"da86d52c_58eb97db","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"}],"neutron/plugins/nec/nec_plugin.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":129,"context_line":"            config.CONF.network_scheduler_driver"},{"line_number":130,"context_line":"        )"},{"line_number":131,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":132,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":133,"context_line":"        )"},{"line_number":134,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"},{"line_number":135,"context_line":"        self.router_scheduler \u003d importutils.import_object("}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_98c0af51","line":132,"updated":"2015-02-11 21:41:04.000000000","message":"and this","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":129,"context_line":"            config.CONF.network_scheduler_driver"},{"line_number":130,"context_line":"        )"},{"line_number":131,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":132,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":133,"context_line":"        )"},{"line_number":134,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"},{"line_number":135,"context_line":"        self.router_scheduler \u003d importutils.import_object("}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_00db057e","line":132,"in_reply_to":"da86d52c_98c0af51","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"}],"neutron/plugins/oneconvergence/plugin.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        self.network_scheduler \u003d importutils.import_object("},{"line_number":136,"context_line":"            cfg.CONF.network_scheduler_driver)"},{"line_number":137,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":138,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":139,"context_line":"        )"},{"line_number":140,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"},{"line_number":141,"context_line":"        self.router_scheduler \u003d importutils.import_object("}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_b8b1f302","line":138,"updated":"2015-02-11 21:41:04.000000000","message":"and this","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        self.network_scheduler \u003d importutils.import_object("},{"line_number":136,"context_line":"            cfg.CONF.network_scheduler_driver)"},{"line_number":137,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":138,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":139,"context_line":"        )"},{"line_number":140,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"},{"line_number":141,"context_line":"        self.router_scheduler \u003d importutils.import_object("}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_40e5fd36","line":138,"in_reply_to":"da86d52c_b8b1f302","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"}],"neutron/plugins/vmware/dhcpmeta_modes.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":85,"context_line":"            cfg.CONF.network_scheduler_driver"},{"line_number":86,"context_line":"        )"},{"line_number":87,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":88,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":89,"context_line":"        )"},{"line_number":90,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"},{"line_number":91,"context_line":"        self.supported_extension_aliases.extend("}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_d8b6a7f8","line":88,"updated":"2015-02-11 21:41:04.000000000","message":"and this","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":85,"context_line":"            cfg.CONF.network_scheduler_driver"},{"line_number":86,"context_line":"        )"},{"line_number":87,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":88,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":89,"context_line":"        )"},{"line_number":90,"context_line":"        self.network_scheduler.add_filter(dhcp_filter)"},{"line_number":91,"context_line":"        self.supported_extension_aliases.extend("}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_80ce15b6","line":88,"in_reply_to":"da86d52c_d8b6a7f8","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"}],"neutron/scheduler/base_resource_filter.py":[{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"ada766fcb5332d7d441d15a629576d7991ee9d71","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 OpenStack Foundation."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":18,"id":"ba7be1f8_fd080493","line":1,"updated":"2015-02-24 01:30:52.000000000","message":"2013 -\u003e 2015","commit_id":"0588aeb53d304341115763b087582660b560df1a"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"8e03b12af9f2cc8858f495c2b30ba3ef7547c5f2","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 OpenStack Foundation."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":18,"id":"ba7be1f8_d2a5e6b5","line":1,"in_reply_to":"ba7be1f8_fd080493","updated":"2015-02-24 05:54:41.000000000","message":"Done","commit_id":"0588aeb53d304341115763b087582660b560df1a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"56ad9967290ffb095419760b49bc14d200394f63","unresolved":false,"context_lines":[{"line_number":22,"context_line":"    def filter_agents(self, plugin, context, resource):"},{"line_number":23,"context_line":"        \"\"\"Return the agents that can host the resource.\"\"\""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    @abc.abstractmethod"},{"line_number":26,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":27,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""}],"source_content_type":"text/x-python","patch_set":23,"id":"ba7be1f8_902f3ff6","line":25,"updated":"2015-02-27 09:56:58.000000000","message":"Taken the latest suggestions into account, we can make this method a non abstract one: in fact here we could implement the query that bumps the load for the agents that are going to be bound to the resource.","commit_id":"226c296e62f50d21cd145fb37faeebe4d65a5fed"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"40f7c2188a653eebe5970ef1acfc5ca36fa9901d","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        plugin \u003d NeutronManager.get_plugin()"},{"line_number":30,"context_line":"        for agent in agents:"},{"line_number":31,"context_line":"            if agent.load:"},{"line_number":32,"context_line":"                agent.load +\u003d 1"},{"line_number":33,"context_line":"                plugin.update_agent(context, agent.id, {\u0027agent\u0027: agent})"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_81826550","line":32,"updated":"2015-02-28 18:06:09.000000000","message":"have you considered performing a direct DB query rather than going through the plugin interface? This looks clean, but it\u0027s probably an overkill.","commit_id":"1ee0a3ccb9516e9dcbdad3584aa897d5ba36e6de"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"1c1d105ba94b2b861b3bf4c97f80956893f29a84","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        plugin \u003d NeutronManager.get_plugin()"},{"line_number":30,"context_line":"        for agent in agents:"},{"line_number":31,"context_line":"            if agent.load:"},{"line_number":32,"context_line":"                agent.load +\u003d 1"},{"line_number":33,"context_line":"                plugin.update_agent(context, agent.id, {\u0027agent\u0027: agent})"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_c81f1d6f","line":32,"in_reply_to":"ba7be1f8_81826550","updated":"2015-03-01 09:49:07.000000000","message":"Done","commit_id":"1ee0a3ccb9516e9dcbdad3584aa897d5ba36e6de"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ec60ffa7421dbcf77dc9b376d19f273bf658416b","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":28,"context_line":"            res \u003d {}"},{"line_number":29,"context_line":"            for agent in agents:"},{"line_number":30,"context_line":"                if agent.load is not None:"},{"line_number":31,"context_line":"                    res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":32,"context_line":"                    agent.update(res)"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_3778f2c3","line":30,"updated":"2015-03-06 04:45:30.000000000","message":"this can simply be:\n\n  if agent.load:\n    ..","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"79b3291e8f37739fd29f7750fb570eee520150b4","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":28,"context_line":"            res \u003d {}"},{"line_number":29,"context_line":"            for agent in agents:"},{"line_number":30,"context_line":"                if agent.load is not None:"},{"line_number":31,"context_line":"                    res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":32,"context_line":"                    agent.update(res)"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_563e3529","line":30,"in_reply_to":"9a80dd14_322640cf","updated":"2015-03-06 14:33:08.000000000","message":"It makes sense to me.","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"8819a98082c6b5798e76f65012f543af70b1326e","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":28,"context_line":"            res \u003d {}"},{"line_number":29,"context_line":"            for agent in agents:"},{"line_number":30,"context_line":"                if agent.load is not None:"},{"line_number":31,"context_line":"                    res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":32,"context_line":"                    agent.update(res)"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_322640cf","line":30,"in_reply_to":"9a80dd14_3778f2c3","updated":"2015-03-06 05:30:58.000000000","message":"If the agent.load \u003d 0 , then the call will not come inside the if statement.Hence we are explicitly checking only for None case.","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0b0703b7023117588a73352ce7ccfdfd7ca2c92c","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":28,"context_line":"            res \u003d {}"},{"line_number":29,"context_line":"            for agent in agents:"},{"line_number":30,"context_line":"                if agent.load is not None:"},{"line_number":31,"context_line":"                    res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":32,"context_line":"                    agent.update(res)"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_5d4d693d","line":30,"in_reply_to":"9a80dd14_563e3529","updated":"2015-03-06 16:52:03.000000000","message":"Actually load\u0027s default value is 0. So I wonder whether this if is necessary at all. We can increase regardless, or when is it None?","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"f3735adc00b81bdd163bb425ddef31bb8b64ad51","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":28,"context_line":"            res \u003d {}"},{"line_number":29,"context_line":"            for agent in agents:"},{"line_number":30,"context_line":"                if agent.load is not None:"},{"line_number":31,"context_line":"                    res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":32,"context_line":"                    agent.update(res)"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_d5abed72","line":30,"in_reply_to":"9a80dd14_5d4d693d","updated":"2015-03-06 18:49:43.000000000","message":"Armando, you are right. load is an integer column with nullable\u003dFalse and the default value is 0, so there is no case where it is None. I think we can remove this if-clause.","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"483c1da6b77411c392e7aa29010b0ce549c445d8","unresolved":false,"context_lines":[{"line_number":28,"context_line":"            res \u003d {}"},{"line_number":29,"context_line":"            for agent in agents:"},{"line_number":30,"context_line":"                if agent.load is not None:"},{"line_number":31,"context_line":"                    res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":32,"context_line":"                    agent.update(res)"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_9f90d044","line":31,"updated":"2015-03-06 07:53:31.000000000","message":"agent[\u0027load\u0027] will be override by https://review.openstack.org/#/c/137017/30/neutron/db/agents_db.py, why do we need to do here?","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"2d6878fd4576be4599b074f1d2fd36c31b796e6b","unresolved":false,"context_lines":[{"line_number":28,"context_line":"            res \u003d {}"},{"line_number":29,"context_line":"            for agent in agents:"},{"line_number":30,"context_line":"                if agent.load is not None:"},{"line_number":31,"context_line":"                    res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":32,"context_line":"                    agent.update(res)"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_b5a5b5b6","line":31,"in_reply_to":"9a80dd14_9f90d044","updated":"2015-03-06 08:47:58.000000000","message":"Please refer this patch set.\nhttps://review.openstack.org/#/c/137017/22/neutron/db/agents_db.py","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a9ce601c375b19abe750918c5ad9902caf20c0ed","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":27,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":28,"context_line":"            res \u003d {}"},{"line_number":29,"context_line":"            for agent in agents:"},{"line_number":30,"context_line":"                res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":31,"context_line":"                agent.update(res)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_6101a369","line":29,"updated":"2015-03-13 08:33:15.000000000","message":"I chatted with Armando about this a bit so I understand what this does now, but can you add a comment here to clarify that the load is being incremented here server-side to avoid excessively favoring a given agent in between report intervals?\n\nIt\u0027s not immediately obvious to slower people such as myself why the server side would be incrememnting an agent value that will be wiped out by the agent.","commit_id":"b99161ecefa623885311068dc8ca27bc0ec492ab"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"e90d9e131c4e2da7e0a40fd45e573cd37bce5d5b","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":27,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":28,"context_line":"            res \u003d {}"},{"line_number":29,"context_line":"            for agent in agents:"},{"line_number":30,"context_line":"                res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":31,"context_line":"                agent.update(res)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_3c6b4ef2","line":29,"in_reply_to":"9a80dd14_6101a369","updated":"2015-03-13 09:10:08.000000000","message":"Done","commit_id":"b99161ecefa623885311068dc8ca27bc0ec492ab"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"2be1fb2b490d11b52928e693c55403d6681857c9","unresolved":false,"context_lines":[{"line_number":32,"context_line":"                # much necessary when bulk resource creation happens within a"},{"line_number":33,"context_line":"                # agent report interval time."},{"line_number":34,"context_line":"                res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":35,"context_line":"                agent.update(res)"}],"source_content_type":"text/x-python","patch_set":37,"id":"9a80dd14_76b28ce6","line":35,"updated":"2015-03-18 06:27:45.000000000","message":"does this assume load_type\u003dnetworks?","commit_id":"be72b811ecbdfa021ebb94040eb0ac5ea234e797"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"2c7eda63b22cdda7537b2b505d513f54c846b0a9","unresolved":false,"context_lines":[{"line_number":32,"context_line":"                # much necessary when bulk resource creation happens within a"},{"line_number":33,"context_line":"                # agent report interval time."},{"line_number":34,"context_line":"                res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":35,"context_line":"                agent.update(res)"}],"source_content_type":"text/x-python","patch_set":37,"id":"9a80dd14_2b7c2572","line":35,"in_reply_to":"9a80dd14_19489cb2","updated":"2015-03-18 10:34:40.000000000","message":"but not for subnets or ports?","commit_id":"be72b811ecbdfa021ebb94040eb0ac5ea234e797"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"7fafca9753857d657de22aa1660277a51c52f36a","unresolved":false,"context_lines":[{"line_number":32,"context_line":"                # much necessary when bulk resource creation happens within a"},{"line_number":33,"context_line":"                # agent report interval time."},{"line_number":34,"context_line":"                res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":35,"context_line":"                agent.update(res)"}],"source_content_type":"text/x-python","patch_set":37,"id":"9a80dd14_6ba29d9b","line":35,"in_reply_to":"9a80dd14_2b7c2572","updated":"2015-03-18 10:49:23.000000000","message":"It works for subnets and ports as well. It isn\u0027t meant to predict precisely what the load of the agent will be, which is what I think your concern is. This value will be corrected by the agent on the next report_interval.\n\nIt\u0027s just there to make sure that one agent isn\u0027t really heavily favored in between report intervals.","commit_id":"be72b811ecbdfa021ebb94040eb0ac5ea234e797"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"286c0ada32dba1fb6fb57116b6d399b0a914b97e","unresolved":false,"context_lines":[{"line_number":32,"context_line":"                # much necessary when bulk resource creation happens within a"},{"line_number":33,"context_line":"                # agent report interval time."},{"line_number":34,"context_line":"                res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":35,"context_line":"                agent.update(res)"}],"source_content_type":"text/x-python","patch_set":37,"id":"9a80dd14_4bea39ad","line":35,"in_reply_to":"9a80dd14_2b7c2572","updated":"2015-03-18 10:43:56.000000000","message":"Yes this code will not be triggered for subnets and ports as they are not agent bindable resources and if admin configures ports or subnets as load_type then the load will be synched only when the latest agent report status comes.","commit_id":"be72b811ecbdfa021ebb94040eb0ac5ea234e797"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"30f9e5ca46bfb07f3d7dbc53376ab58297187769","unresolved":false,"context_lines":[{"line_number":32,"context_line":"                # much necessary when bulk resource creation happens within a"},{"line_number":33,"context_line":"                # agent report interval time."},{"line_number":34,"context_line":"                res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":35,"context_line":"                agent.update(res)"}],"source_content_type":"text/x-python","patch_set":37,"id":"9a80dd14_3441e20b","line":35,"in_reply_to":"9a80dd14_6ba29d9b","updated":"2015-03-18 11:52:56.000000000","message":"how about having a comment:\n\nNOTE: The resource being bound might or might not be of the same type which is accounted for the load.\nIt isn\u0027t a problem because \"+ 1\" here does not meant to predict precisely what the load of the agent will be.\nThe value will be corrected by the agent on the next report interval.","commit_id":"be72b811ecbdfa021ebb94040eb0ac5ea234e797"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"cc4a5fa2ee0b0831fa374e3b0e756f597e239b00","unresolved":false,"context_lines":[{"line_number":32,"context_line":"                # much necessary when bulk resource creation happens within a"},{"line_number":33,"context_line":"                # agent report interval time."},{"line_number":34,"context_line":"                res[\u0027load\u0027] \u003d agent.load + 1"},{"line_number":35,"context_line":"                agent.update(res)"}],"source_content_type":"text/x-python","patch_set":37,"id":"9a80dd14_19489cb2","line":35,"in_reply_to":"9a80dd14_76b28ce6","updated":"2015-03-18 09:42:31.000000000","message":"This will work for all the resources which will bind to the agent.\nIt can be networks or routers.","commit_id":"be72b811ecbdfa021ebb94040eb0ac5ea234e797"}],"neutron/scheduler/base_scheduler.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    \"\"\"The base scheduler (agnostic to resource type).\"\"\""},{"line_number":30,"context_line":"    def add_filter(self, resource_filter_str):"},{"line_number":31,"context_line":"        resource_filter \u003d None"},{"line_number":32,"context_line":"        if resource_filter_str \u003d\u003d \u0027DhcpFilter\u0027:"},{"line_number":33,"context_line":"            resource_filter \u003d importutils.import_object("},{"line_number":34,"context_line":"                \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027)"},{"line_number":35,"context_line":"        self.resource_filter \u003d resource_filter"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_588ec07a","line":32,"updated":"2015-02-14 22:07:53.000000000","message":"This kind of hard-coding seems not appropriate.\nAvailable filter types depend on resource types (e.g,, dhcp, router, load balancer etc), so I think it is better to prepare a child class per resource type and define available filter definitions in child classes.\n\nadd_filter is called in a plugin __init__ method, but it is better to be done as a part of the scheduler initialization. Filter types can be specified through a configuration parameter as nova does.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    \"\"\"The base scheduler (agnostic to resource type).\"\"\""},{"line_number":30,"context_line":"    def add_filter(self, resource_filter_str):"},{"line_number":31,"context_line":"        resource_filter \u003d None"},{"line_number":32,"context_line":"        if resource_filter_str \u003d\u003d \u0027DhcpFilter\u0027:"},{"line_number":33,"context_line":"            resource_filter \u003d importutils.import_object("},{"line_number":34,"context_line":"                \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027)"},{"line_number":35,"context_line":"        self.resource_filter \u003d resource_filter"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_b3f0be92","line":32,"in_reply_to":"da86d52c_588ec07a","updated":"2015-02-15 07:16:08.000000000","message":"Good suggestion. We are planning to remove changes required in plugin files, and adding an extra config might just ease this problem.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"94738f216988434c9d09a5abebfb7f42ff5a008e","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        \"\"\"Return a subset of agents based on weight.\"\"\""},{"line_number":44,"context_line":"        if not self.resource_filter:"},{"line_number":45,"context_line":"            return"},{"line_number":46,"context_line":"        # filter the agents that can host the resource"},{"line_number":47,"context_line":"        n_agents_needed, resource_hostable_agents \u003d \\"},{"line_number":48,"context_line":"            self.resource_filter.filter_agents(plugin, context, resource)"},{"line_number":49,"context_line":"        chosen_agents \u003d self.select(plugin, context, resource_hostable_agents,"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_5d18721e","line":46,"updated":"2015-02-14 19:23:56.000000000","message":"While we don\u0027t have a hacking rule against this, you should break newlines with parenthesis and not the \u0027\\\u0027 sign.\n\n    n_agents_needed, resource_hostable_agents \u003d (\n        self.resource_filter.filter_agents(plugin, context, resource))","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        \"\"\"Return a subset of agents based on weight.\"\"\""},{"line_number":44,"context_line":"        if not self.resource_filter:"},{"line_number":45,"context_line":"            return"},{"line_number":46,"context_line":"        # filter the agents that can host the resource"},{"line_number":47,"context_line":"        n_agents_needed, resource_hostable_agents \u003d \\"},{"line_number":48,"context_line":"            self.resource_filter.filter_agents(plugin, context, resource)"},{"line_number":49,"context_line":"        chosen_agents \u003d self.select(plugin, context, resource_hostable_agents,"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_73cf2658","line":46,"in_reply_to":"da86d52c_5d18721e","updated":"2015-02-15 07:16:08.000000000","message":"Done","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        return chosen_agents"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"class WeightScheduler(BaseScheduler):"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":59,"context_line":"               n_agents_needed):"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_98e75846","line":56,"updated":"2015-02-14 22:07:53.000000000","message":"Is WeightScheduler different from LeastScheduler? If same, it is better to use the name currently used.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        return chosen_agents"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"class WeightScheduler(BaseScheduler):"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":59,"context_line":"               n_agents_needed):"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_f3db161f","line":56,"in_reply_to":"da86d52c_98e75846","updated":"2015-02-15 07:16:08.000000000","message":"We are selecting agents by sorting based on load of an agent. Hence, we changed it to Weight Scheduler. May be we can use as \"Least Weight Scheduler\".","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":59,"context_line":"               n_agents_needed):"},{"line_number":60,"context_line":"        \"\"\"Choose agents based on load.\"\"\""},{"line_number":61,"context_line":"        # Return agents based on load."},{"line_number":62,"context_line":"        chosen_agents \u003d sorted(resource_hostable_agents,"},{"line_number":63,"context_line":"                           key\u003dattrgetter(\u0027load\u0027))[0:n_agents_needed]"},{"line_number":64,"context_line":"        return chosen_agents"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_788b8468","line":61,"updated":"2015-02-14 22:07:53.000000000","message":"The comment and the docstring are almost duplicated. The comment seems unnecessary.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":59,"context_line":"               n_agents_needed):"},{"line_number":60,"context_line":"        \"\"\"Choose agents based on load.\"\"\""},{"line_number":61,"context_line":"        # Return agents based on load."},{"line_number":62,"context_line":"        chosen_agents \u003d sorted(resource_hostable_agents,"},{"line_number":63,"context_line":"                           key\u003dattrgetter(\u0027load\u0027))[0:n_agents_needed]"},{"line_number":64,"context_line":"        return chosen_agents"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_33e68ee9","line":61,"in_reply_to":"da86d52c_788b8468","updated":"2015-02-15 07:16:08.000000000","message":"Done","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"fe8a1f417f5e207015165aa8cfe526d795a8090e","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 OpenStack Foundation."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_bc75ebfb","line":1,"updated":"2015-02-15 13:47:49.000000000","message":"2015","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 OpenStack Foundation."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_074ea096","line":1,"in_reply_to":"da86d52c_bc75ebfb","updated":"2015-02-15 17:25:39.000000000","message":"Agreed","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6e14ba56bad7efbf3d30fede34f3341ebf55cbc0","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    def __init__(self):"},{"line_number":32,"context_line":"        resource_filter \u003d None"},{"line_number":33,"context_line":"        resource_filter \u003d importutils.import_object("},{"line_number":34,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027)"},{"line_number":35,"context_line":"        self.resource_filter \u003d resource_filter"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def add_filter(self, resource_filter_str):"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_c753a837","line":34,"updated":"2015-02-15 16:58:29.000000000","message":"I don\u0027t think that putting these specific filters here is very clean. It kind of defeat the purpose on the base class.","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    def __init__(self):"},{"line_number":32,"context_line":"        resource_filter \u003d None"},{"line_number":33,"context_line":"        resource_filter \u003d importutils.import_object("},{"line_number":34,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027)"},{"line_number":35,"context_line":"        self.resource_filter \u003d resource_filter"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def add_filter(self, resource_filter_str):"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_a756b428","line":34,"updated":"2015-02-15 17:25:39.000000000","message":"We are planning to introduce scheduler_filter parameter in neutron.conf  to make above decision , please suggest if there are any better options","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"fe8a1f417f5e207015165aa8cfe526d795a8090e","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        if not self.resource_filter:"},{"line_number":52,"context_line":"            return"},{"line_number":53,"context_line":"        # filter the agents that can host the resource"},{"line_number":54,"context_line":"        n_agents_needed, resource_hostable_agents \u003d \\"},{"line_number":55,"context_line":"            self.resource_filter.filter_agents(plugin, context, resource)"},{"line_number":56,"context_line":"        chosen_agents \u003d self.select(plugin, context, resource_hostable_agents,"},{"line_number":57,"context_line":"                                    n_agents_needed)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_fc5e8378","line":54,"updated":"2015-02-15 13:47:49.000000000","message":"Remove \u0027\\\u0027 make use of brackets for new line.","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        if not self.resource_filter:"},{"line_number":52,"context_line":"            return"},{"line_number":53,"context_line":"        # filter the agents that can host the resource"},{"line_number":54,"context_line":"        n_agents_needed, resource_hostable_agents \u003d \\"},{"line_number":55,"context_line":"            self.resource_filter.filter_agents(plugin, context, resource)"},{"line_number":56,"context_line":"        chosen_agents \u003d self.select(plugin, context, resource_hostable_agents,"},{"line_number":57,"context_line":"                                    n_agents_needed)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_e72fcca5","line":54,"in_reply_to":"da86d52c_fc5e8378","updated":"2015-02-15 17:25:39.000000000","message":"Agreed","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f8082aea7b7f287bb18a72ef8ab8f13a099edf5f","unresolved":false,"context_lines":[{"line_number":37,"context_line":"class BaseScheduler(object):"},{"line_number":38,"context_line":"    \"\"\"The base scheduler (agnostic to resource type).\"\"\""},{"line_number":39,"context_line":"    # Initialize the resource filter to be used in order to filter/bind."},{"line_number":40,"context_line":"    def __init__(self):"},{"line_number":41,"context_line":"        resource_filter \u003d None"},{"line_number":42,"context_line":"        if cfg.CONF.scheduler_filter \u003d\u003d \u0027DhcpFilter\u0027:"},{"line_number":43,"context_line":"            resource_filter \u003d importutils.import_object("}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_8a9319a2","line":40,"updated":"2015-02-18 03:11:04.000000000","message":"I still believe this is not required in the base scheduler. I think the filter needs to be configured when the derived scheduler is created. So we don\u0027t need to import in __init__ nor, having a setter like you did here.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c4f880bde082bc798cf3979c502823081f69208b","unresolved":false,"context_lines":[{"line_number":72,"context_line":"class WeightScheduler(BaseScheduler):"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":75,"context_line":"               n_agents_needed):"},{"line_number":76,"context_line":"        \"\"\"Choose agents based on load.\"\"\""},{"line_number":77,"context_line":"        chosen_agents \u003d sorted(resource_hostable_agents,"},{"line_number":78,"context_line":"                           key\u003dattrgetter(\u0027load\u0027))[0:n_agents_needed]"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_93afd1e2","line":75,"updated":"2015-02-18 09:50:02.000000000","message":"I prefer \"num_\" over \"n_\" to clarify its meaning.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"7db4f162b69e6416b8c142c84dabd444a13c03f4","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        return chosen_agents"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class BaseChanceScheduler(BaseScheduler):"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":66,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_78a151f6","line":63,"updated":"2015-02-18 12:49:53.000000000","message":"Not sure to understand why BaseChance/WeightScheduler implement bind method (ie: these classes can be abstract)","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"af972aadc251a222eb82acbd9b3de339b1073768","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        return chosen_agents"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class BaseChanceScheduler(BaseScheduler):"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":66,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"ba7be1f8_4a3c3330","line":63,"in_reply_to":"da86d52c_4f510a2f","updated":"2015-02-20 17:13:14.000000000","message":"I think the point is that \"Filter\" selects agent per resource type. If we have one filter per resource type, it looks good that \"filter\" class has \"bind\" method. Choosing algorithm is defined by \"scheduler\" class.\n\nNote that it is a different point from nova scheduler filters. Now I think this difference is the main reason I did not understand the concept of this \"scheduler\" and \"filter\" is this difference before reading Armando\u0027s detail comments in patch set 13,\n\n\"filter\" might be misleading (especially folks familiar with nova scheduler), but I don\u0027t have good idea on naming so far.....","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"80883de6ab38f85a51cfe296ac9c8c154127d7d3","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        return chosen_agents"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class BaseChanceScheduler(BaseScheduler):"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":66,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_8fc6b59a","line":63,"in_reply_to":"da86d52c_78a151f6","updated":"2015-02-18 14:33:13.000000000","message":"Agreed.","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"093565426764231506b3f1941744263eb67ac84b","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        return chosen_agents"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class BaseChanceScheduler(BaseScheduler):"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":66,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_4f510a2f","line":63,"in_reply_to":"da86d52c_8fc6b59a","updated":"2015-02-18 21:19:22.000000000","message":"I was suggesting a while back this hierarchy:\n\n  class BaseResourceFilter(object):\n    \"\"\"Encapsulate logic that is specific to the resource type.\"\"\"\n \n   @abstractmethod\n    def filter(self, plugin, context, resource):\n        \"\"\"Return the agents that can host the resource.\"\"\"\n\n    @abstractmethod\n    def bind(self, plugin, context, resource, agents):\n        \"\"\"Bind the resource to the agents.\"\"\"\n\n\n  class BaseScheduler(object):\n    \"\"\"The base scheduler (agnostic to resource type).\"\"\"\n\n    # Initialize the resource filter to be used in order to filter/bind.\n    def __init__(self, resource_filter):\n        self.resource_filter \u003d resource_filter\n\n    @abstractmethod\n    def select(self, plugin, context, agents):\n        \"\"\"Return a subset of agents based on the specific scheduling logic.\"\"\"\n\n    def schedule(self, plugin, context, resource):\n        \"\"\"Return a subset of agents based on weight.\"\"\"\n        # filter the agents that can host the resource\n        # call select to determine the agents\n        # bind the resource to the agents\n        # return the agents\n\nI think most of the pieces are there, but not quite. The reason why I think the \u0027bind\u0027 logic (namely how we create the association between the agent and the resource) belongs to the \u0027Filter\u0027 (or whatever we end up calling it) is that we don\u0027t have to duplicate the logic when we create the Scheduler.  See next file","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9ad1a3b37590bece665eaed13f2ce1c215cf55e6","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import abc"},{"line_number":17,"context_line":"import random"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from operator import attrgetter"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from oslo_config import cfg"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_13ab361e","line":18,"updated":"2015-02-22 17:40:45.000000000","message":"The blank line is unnecessary.","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e3e9033f221d91cc820a135577199102b931e076","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import abc"},{"line_number":17,"context_line":"import random"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from operator import attrgetter"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from oslo_config import cfg"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_374c9f70","line":18,"in_reply_to":"ba7be1f8_13ab361e","updated":"2015-02-23 05:07:24.000000000","message":"Done","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9ad1a3b37590bece665eaed13f2ce1c215cf55e6","unresolved":false,"context_lines":[{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"AGENTS_SCHEDULER_OPTS \u003d ["},{"line_number":28,"context_line":"    cfg.StrOpt(\u0027scheduler_filter\u0027,"},{"line_number":29,"context_line":"               default\u003d\u0027DhcpFilter\u0027,"},{"line_number":30,"context_line":"               help\u003d_(\u0027Filter to use for selecting \u0027"},{"line_number":31,"context_line":"                       \u0027agents to host resources.\u0027)),"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_f37222e2","line":28,"updated":"2015-02-22 17:40:45.000000000","message":"StrOpt means this option takes only one filter for all resource types, so it seems odd to me. Who uses this config?","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e3e9033f221d91cc820a135577199102b931e076","unresolved":false,"context_lines":[{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"AGENTS_SCHEDULER_OPTS \u003d ["},{"line_number":28,"context_line":"    cfg.StrOpt(\u0027scheduler_filter\u0027,"},{"line_number":29,"context_line":"               default\u003d\u0027DhcpFilter\u0027,"},{"line_number":30,"context_line":"               help\u003d_(\u0027Filter to use for selecting \u0027"},{"line_number":31,"context_line":"                       \u0027agents to host resources.\u0027)),"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_f76847bc","line":28,"in_reply_to":"ba7be1f8_f37222e2","updated":"2015-02-23 05:07:24.000000000","message":"I will remove this as it is not relevant now.","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9ad1a3b37590bece665eaed13f2ce1c215cf55e6","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class BaseScheduler(object):"},{"line_number":38,"context_line":"    \"\"\"The base scheduler (agnostic to resource type).\"\"\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    @abc.abstractmethod"},{"line_number":41,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_534bee86","line":38,"updated":"2015-02-22 17:40:45.000000000","message":"It is better to mention child classes must define self.resource_filter in the docstring. It clarifies the interface. It may be good to assign self.resource_filter to None in this class:\n\n  class BaseScheduler(object):\n      resource_filter \u003d None","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e3e9033f221d91cc820a135577199102b931e076","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class BaseScheduler(object):"},{"line_number":38,"context_line":"    \"\"\"The base scheduler (agnostic to resource type).\"\"\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    @abc.abstractmethod"},{"line_number":41,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_3763bfdd","line":38,"in_reply_to":"ba7be1f8_534bee86","updated":"2015-02-23 05:07:24.000000000","message":"Done","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9ad1a3b37590bece665eaed13f2ce1c215cf55e6","unresolved":false,"context_lines":[{"line_number":72,"context_line":"               num_agents_needed):"},{"line_number":73,"context_line":"        \"\"\"Choose agents based on load.\"\"\""},{"line_number":74,"context_line":"        chosen_agents \u003d sorted(resource_hostable_agents,"},{"line_number":75,"context_line":"                           key\u003dattrgetter(\u0027load\u0027))[0:num_agents_needed]"},{"line_number":76,"context_line":"        return chosen_agents"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_731c7278","line":75,"updated":"2015-02-22 17:40:45.000000000","message":"As I commented in the previous patch set, \u0027load\u0027 is updated asynchronously. Agents report load information every 30 seconds by default. If we create 20 or more networks in bulk, all networks are assigned to same agents. It might not be a problem when looked in a longer term. What do you think?","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e3e9033f221d91cc820a135577199102b931e076","unresolved":false,"context_lines":[{"line_number":72,"context_line":"               num_agents_needed):"},{"line_number":73,"context_line":"        \"\"\"Choose agents based on load.\"\"\""},{"line_number":74,"context_line":"        chosen_agents \u003d sorted(resource_hostable_agents,"},{"line_number":75,"context_line":"                           key\u003dattrgetter(\u0027load\u0027))[0:num_agents_needed]"},{"line_number":76,"context_line":"        return chosen_agents"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_97ed4b28","line":75,"in_reply_to":"ba7be1f8_731c7278","updated":"2015-02-23 05:07:24.000000000","message":"Yes you are right. We can get exact load of agent only once in every 30 seconds unless Administrator reduces the report interval to lesser value. We may need to document this suggesting configuration of smaller report interval when creating networks at fast rate.","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"4ee435112ee9a3fddface63bc0f675567d144156","unresolved":false,"context_lines":[{"line_number":16,"context_line":"import abc"},{"line_number":17,"context_line":"import random"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":20,"context_line":"from operator import attrgetter"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_f4ccd337","line":19,"updated":"2015-03-05 07:38:05.000000000","message":"this may cause a marge conflict - you may want to base this ont he change to oslo_log. but that is not an issue really","commit_id":"e6707cdd8325cc4be3d92995709e43af09bf1fb0"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"4ee435112ee9a3fddface63bc0f675567d144156","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    @abc.abstractmethod"},{"line_number":34,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":35,"context_line":"               num_agents_needed):"},{"line_number":36,"context_line":"        \"\"\"Return a subset of agents based on the specific scheduling logic.\"\"\""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def schedule(self, plugin, context, resource):"},{"line_number":39,"context_line":"        \"\"\"Return a subset of agents based on weight.\"\"\""}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_d4eeef8a","line":36,"updated":"2015-03-05 07:38:05.000000000","message":"should this return something or be pass?\nor even rais an unimplemented error","commit_id":"e6707cdd8325cc4be3d92995709e43af09bf1fb0"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ec60ffa7421dbcf77dc9b376d19f273bf658416b","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":35,"context_line":"               num_agents_needed):"},{"line_number":36,"context_line":"        \"\"\"Return a subset of agents based on the specific scheduling logic.\"\"\""},{"line_number":37,"context_line":"        raise NotImplementedError()"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def schedule(self, plugin, context, resource):"},{"line_number":40,"context_line":"        \"\"\"Return a subset of agents based on weight.\"\"\""}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_b74b0286","line":37,"updated":"2015-03-06 04:45:30.000000000","message":"an abstract method does not need to return/pass or raise anything, please revert.","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"79b3291e8f37739fd29f7750fb570eee520150b4","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":35,"context_line":"               num_agents_needed):"},{"line_number":36,"context_line":"        \"\"\"Return a subset of agents based on the specific scheduling logic.\"\"\""},{"line_number":37,"context_line":"        raise NotImplementedError()"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def schedule(self, plugin, context, resource):"},{"line_number":40,"context_line":"        \"\"\"Return a subset of agents based on weight.\"\"\""}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_36dd41e1","line":37,"in_reply_to":"9a80dd14_12177c52","updated":"2015-03-06 14:33:08.000000000","message":"In addition, raising NotImplementedError prevents using super() method.","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"8819a98082c6b5798e76f65012f543af70b1326e","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":35,"context_line":"               num_agents_needed):"},{"line_number":36,"context_line":"        \"\"\"Return a subset of agents based on the specific scheduling logic.\"\"\""},{"line_number":37,"context_line":"        raise NotImplementedError()"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def schedule(self, plugin, context, resource):"},{"line_number":40,"context_line":"        \"\"\"Return a subset of agents based on weight.\"\"\""}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_12177c52","line":37,"in_reply_to":"9a80dd14_b74b0286","updated":"2015-03-06 05:30:58.000000000","message":"Done","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"a93edaa0d92946fccf3377ac96b3cf581d210824","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        \"\"\"Return a subset of agents based on the specific scheduling logic.\"\"\""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def schedule(self, plugin, context, resource):"},{"line_number":39,"context_line":"        \"\"\"Return a subset of agents based on weight.\"\"\""},{"line_number":40,"context_line":"        if not self.resource_filter:"},{"line_number":41,"context_line":"            return"},{"line_number":42,"context_line":"        # filter the agents that can host the resource"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_3decdeba","line":39,"updated":"2015-03-10 10:57:23.000000000","message":"\"weight\" is not correct because the base class is agnostic to a selection method. it is better that the docstring describes what this method does. for example,\n\n  Select and bind agents to a given resource.","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e6b55af6f2a0770288f02ba54fb2dbfdeef10da8","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        \"\"\"Return a subset of agents based on the specific scheduling logic.\"\"\""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def schedule(self, plugin, context, resource):"},{"line_number":39,"context_line":"        \"\"\"Return a subset of agents based on weight.\"\"\""},{"line_number":40,"context_line":"        if not self.resource_filter:"},{"line_number":41,"context_line":"            return"},{"line_number":42,"context_line":"        # filter the agents that can host the resource"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_aaf30f9e","line":39,"in_reply_to":"9a80dd14_3decdeba","updated":"2015-03-10 14:39:18.000000000","message":"Done","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"a93edaa0d92946fccf3377ac96b3cf581d210824","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":60,"context_line":"               num_agents_needed):"},{"line_number":61,"context_line":"        \"\"\"Choose agents randomly.\"\"\""},{"line_number":62,"context_line":"        chosen_agents \u003d random.sample(resource_hostable_agents,"},{"line_number":63,"context_line":"                                      num_agents_needed)"},{"line_number":64,"context_line":"        return chosen_agents"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_fd3c0631","line":61,"updated":"2015-03-10 10:57:23.000000000","message":"it seems better to move the docstring to the class level.","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e6b55af6f2a0770288f02ba54fb2dbfdeef10da8","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":60,"context_line":"               num_agents_needed):"},{"line_number":61,"context_line":"        \"\"\"Choose agents randomly.\"\"\""},{"line_number":62,"context_line":"        chosen_agents \u003d random.sample(resource_hostable_agents,"},{"line_number":63,"context_line":"                                      num_agents_needed)"},{"line_number":64,"context_line":"        return chosen_agents"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_0a033b77","line":61,"in_reply_to":"9a80dd14_fd3c0631","updated":"2015-03-10 14:39:18.000000000","message":"Done","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"a93edaa0d92946fccf3377ac96b3cf581d210824","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":73,"context_line":"               num_agents_needed):"},{"line_number":74,"context_line":"        \"\"\"Choose agents based on load.\"\"\""},{"line_number":75,"context_line":"        chosen_agents \u003d sorted(resource_hostable_agents,"},{"line_number":76,"context_line":"                           key\u003dattrgetter(\u0027load\u0027))[0:num_agents_needed]"},{"line_number":77,"context_line":"        return chosen_agents"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_5c698bf7","line":74,"updated":"2015-03-10 10:57:23.000000000","message":"same as the above.","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e6b55af6f2a0770288f02ba54fb2dbfdeef10da8","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":73,"context_line":"               num_agents_needed):"},{"line_number":74,"context_line":"        \"\"\"Choose agents based on load.\"\"\""},{"line_number":75,"context_line":"        chosen_agents \u003d sorted(resource_hostable_agents,"},{"line_number":76,"context_line":"                           key\u003dattrgetter(\u0027load\u0027))[0:num_agents_needed]"},{"line_number":77,"context_line":"        return chosen_agents"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_2a08ff90","line":74,"in_reply_to":"9a80dd14_5c698bf7","updated":"2015-03-10 14:39:18.000000000","message":"Done","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"}],"neutron/scheduler/dhcp_agent_scheduler.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"d72aaaeeae15312296c9e2d9b7b5c11aa5465886","unresolved":false,"context_lines":[{"line_number":136,"context_line":"    def schedule(self, plugin, context, network):"},{"line_number":137,"context_line":"        n_agents, active_dhcp_agents \u003d self.get_active_agents(plugin,"},{"line_number":138,"context_line":"                                                              context, network)"},{"line_number":139,"context_line":"        chosen_agents \u003d random.sample(active_dhcp_agents, n_agents)"},{"line_number":140,"context_line":"        self._schedule_bind_network(context, chosen_agents, network[\u0027id\u0027])"},{"line_number":141,"context_line":"        return chosen_agents"},{"line_number":142,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_6865bfad","line":139,"updated":"2014-11-25 22:46:27.000000000","message":"what happens if active_dhcp_agents \u003d 0? A check should be added here","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"51a56f9c946790ef2d9354f7f0b20f39a39cd805","unresolved":false,"context_lines":[{"line_number":136,"context_line":"    def schedule(self, plugin, context, network):"},{"line_number":137,"context_line":"        n_agents, active_dhcp_agents \u003d self.get_active_agents(plugin,"},{"line_number":138,"context_line":"                                                              context, network)"},{"line_number":139,"context_line":"        chosen_agents \u003d random.sample(active_dhcp_agents, n_agents)"},{"line_number":140,"context_line":"        self._schedule_bind_network(context, chosen_agents, network[\u0027id\u0027])"},{"line_number":141,"context_line":"        return chosen_agents"},{"line_number":142,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_22862a66","line":139,"in_reply_to":"5a890539_6865bfad","updated":"2014-11-28 10:02:30.000000000","message":"Yes, check is to be added to avoid exception as done in LeastNetworksScheduler.","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"d72aaaeeae15312296c9e2d9b7b5c11aa5465886","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        if not active_dhcp_agents:"},{"line_number":150,"context_line":"            return []"},{"line_number":151,"context_line":"        cids \u003d [cndt[\u0027id\u0027] for cndt in active_dhcp_agents]"},{"line_number":152,"context_line":"        chosen_agents \u003d plugin.get_dhcp_agents_with_min_networks(context,"},{"line_number":153,"context_line":"                                                          cids, n_agents)"},{"line_number":154,"context_line":"        self._schedule_bind_network(context, chosen_agents, network[\u0027id\u0027])"},{"line_number":155,"context_line":"        return chosen_agents"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_687a1fbb","line":152,"updated":"2014-11-25 22:46:27.000000000","message":"why don\u0027t you add active_dhcp_agents as param to get_dhcp_agents_with_min_networks ? You\u0027d spare one db call.","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"51a56f9c946790ef2d9354f7f0b20f39a39cd805","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        if not active_dhcp_agents:"},{"line_number":150,"context_line":"            return []"},{"line_number":151,"context_line":"        cids \u003d [cndt[\u0027id\u0027] for cndt in active_dhcp_agents]"},{"line_number":152,"context_line":"        chosen_agents \u003d plugin.get_dhcp_agents_with_min_networks(context,"},{"line_number":153,"context_line":"                                                          cids, n_agents)"},{"line_number":154,"context_line":"        self._schedule_bind_network(context, chosen_agents, network[\u0027id\u0027])"},{"line_number":155,"context_line":"        return chosen_agents"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_c28e4679","line":152,"in_reply_to":"5a890539_687a1fbb","updated":"2014-11-28 10:02:30.000000000","message":"Agree","commit_id":"a0835f5fff55f09b5aab81caef6a6f103696e801"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"cb4cd4a8d75e1f4ea829a38e9e228a17e8bc5a6f","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.db import agentschedulers_db"},{"line_number":25,"context_line":"from neutron.openstack.common.gettextutils import _LI, _LW"},{"line_number":26,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_136aa719","line":27,"updated":"2014-12-24 01:37:52.000000000","message":"please keep these blank lines.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":8940,"name":"Sourabh Patwardhan","email":"sopatwar@gmail.com","username":"sopatwar"},"change_message_id":"9484b5c1fd50e44ea488c9b0df3109db4ce4380d","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    can be introduced later."},{"line_number":35,"context_line":"    \"\"\""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def schedule(self, plugin, context, network):"},{"line_number":38,"context_line":"        pass"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _schedule_bind_network(self, context, agents, network_id):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_5d00d5aa","line":37,"updated":"2014-12-04 02:38:59.000000000","message":"Consider making schedule() an abstract method and the DHCPScheduler class an ABC. This will ensure strict interface checks.\nRefer to the L3Scheduler class.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"6f3ba1bcffc9ee4c272a1a48fc782ccef8f4acc1","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    can be introduced later."},{"line_number":35,"context_line":"    \"\"\""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def schedule(self, plugin, context, network):"},{"line_number":38,"context_line":"        pass"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _schedule_bind_network(self, context, agents, network_id):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_685a1f1f","line":37,"in_reply_to":"5a890539_5d00d5aa","updated":"2014-12-04 12:41:51.000000000","message":"+1","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    can be introduced later."},{"line_number":35,"context_line":"    \"\"\""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def schedule(self, plugin, context, network):"},{"line_number":38,"context_line":"        pass"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _schedule_bind_network(self, context, agents, network_id):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_1cac8534","line":37,"in_reply_to":"5a890539_5d00d5aa","updated":"2014-12-18 09:33:53.000000000","message":"ok. We will make it an abstract method.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"6f3ba1bcffc9ee4c272a1a48fc782ccef8f4acc1","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            if len(dhcp_agents) \u003e\u003d agents_per_network:"},{"line_number":73,"context_line":"                LOG.debug(\u0027Network %s is hosted already\u0027,"},{"line_number":74,"context_line":"                          network[\u0027id\u0027])"},{"line_number":75,"context_line":"                return (0, [])"},{"line_number":76,"context_line":"            n_agents \u003d agents_per_network - len(dhcp_agents)"},{"line_number":77,"context_line":"            enabled_dhcp_agents \u003d plugin.get_agents_db("},{"line_number":78,"context_line":"                context, filters\u003d{"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_8883cb54","line":75,"updated":"2014-12-04 12:41:51.000000000","message":"() are not required.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"a65a853b577bb9129f09d9e8d775c1072b6f2b18","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            if len(dhcp_agents) \u003e\u003d agents_per_network:"},{"line_number":73,"context_line":"                LOG.debug(\u0027Network %s is hosted already\u0027,"},{"line_number":74,"context_line":"                          network[\u0027id\u0027])"},{"line_number":75,"context_line":"                return (0, [])"},{"line_number":76,"context_line":"            n_agents \u003d agents_per_network - len(dhcp_agents)"},{"line_number":77,"context_line":"            enabled_dhcp_agents \u003d plugin.get_agents_db("},{"line_number":78,"context_line":"                context, filters\u003d{"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_fe8ddb7c","line":75,"in_reply_to":"3a961159_0e10c04c","updated":"2014-12-24 08:38:18.000000000","message":"I agree Iwamoto.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"cb4cd4a8d75e1f4ea829a38e9e228a17e8bc5a6f","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            if len(dhcp_agents) \u003e\u003d agents_per_network:"},{"line_number":73,"context_line":"                LOG.debug(\u0027Network %s is hosted already\u0027,"},{"line_number":74,"context_line":"                          network[\u0027id\u0027])"},{"line_number":75,"context_line":"                return (0, [])"},{"line_number":76,"context_line":"            n_agents \u003d agents_per_network - len(dhcp_agents)"},{"line_number":77,"context_line":"            enabled_dhcp_agents \u003d plugin.get_agents_db("},{"line_number":78,"context_line":"                context, filters\u003d{"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_0e10c04c","line":75,"in_reply_to":"3a961159_a025e20b","updated":"2014-12-24 01:37:52.000000000","message":"It seems that the common Neutron coding style doesn\u0027t place such parens.  Please remove them.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ffffe100ef572a4408ef200bd67eb3423470c11f","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            if len(dhcp_agents) \u003e\u003d agents_per_network:"},{"line_number":73,"context_line":"                LOG.debug(\u0027Network %s is hosted already\u0027,"},{"line_number":74,"context_line":"                          network[\u0027id\u0027])"},{"line_number":75,"context_line":"                return (0, [])"},{"line_number":76,"context_line":"            n_agents \u003d agents_per_network - len(dhcp_agents)"},{"line_number":77,"context_line":"            enabled_dhcp_agents \u003d plugin.get_agents_db("},{"line_number":78,"context_line":"                context, filters\u003d{"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_80eaa6aa","line":75,"in_reply_to":"3a961159_fe8ddb7c","updated":"2014-12-25 06:39:51.000000000","message":"Done","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            if len(dhcp_agents) \u003e\u003d agents_per_network:"},{"line_number":73,"context_line":"                LOG.debug(\u0027Network %s is hosted already\u0027,"},{"line_number":74,"context_line":"                          network[\u0027id\u0027])"},{"line_number":75,"context_line":"                return (0, [])"},{"line_number":76,"context_line":"            n_agents \u003d agents_per_network - len(dhcp_agents)"},{"line_number":77,"context_line":"            enabled_dhcp_agents \u003d plugin.get_agents_db("},{"line_number":78,"context_line":"                context, filters\u003d{"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_a025e20b","line":75,"in_reply_to":"5a890539_8883cb54","updated":"2014-12-18 09:33:53.000000000","message":"Just for better understanding.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"6f3ba1bcffc9ee4c272a1a48fc782ccef8f4acc1","unresolved":false,"context_lines":[{"line_number":137,"context_line":"class ChanceScheduler(DHCPScheduler):"},{"line_number":138,"context_line":"    \"\"\"Randomly allocate DHCP agent(s) for a network.\"\"\""},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    def schedule(self, plugin, context, network):"},{"line_number":141,"context_line":"        \"\"\"Schedule the network to active DHCP agent(s)."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        A list of scheduled agents is returned."}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_c896b33d","line":140,"updated":"2014-12-04 12:41:51.000000000","message":"Both schedule implementations look similar, i am not sure it\u0027s the right method to abstract.\n\nBased on both implementations, it seems better to define a common schedule implementation and an abstract choose_agents or get_candidates in parent class.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":137,"context_line":"class ChanceScheduler(DHCPScheduler):"},{"line_number":138,"context_line":"    \"\"\"Randomly allocate DHCP agent(s) for a network.\"\"\""},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    def schedule(self, plugin, context, network):"},{"line_number":141,"context_line":"        \"\"\"Schedule the network to active DHCP agent(s)."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        A list of scheduled agents is returned."}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_600cda95","line":140,"in_reply_to":"5a890539_c896b33d","updated":"2014-12-18 09:33:53.000000000","message":"Thanks for the suggestion. Based on the approved design, we will update the code.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"6f3ba1bcffc9ee4c272a1a48fc782ccef8f4acc1","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                                                              network)"},{"line_number":147,"context_line":"        if not active_dhcp_agents:"},{"line_number":148,"context_line":"            return"},{"line_number":149,"context_line":"        chosen_agents \u003d random.sample(active_dhcp_agents, n_agents)"},{"line_number":150,"context_line":"        self._schedule_bind_network(context, chosen_agents, network[\u0027id\u0027])"},{"line_number":151,"context_line":"        return chosen_agents"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_08735b80","line":149,"updated":"2014-12-04 12:41:51.000000000","message":"An error is raised if n_agents \u003e len(active_dhcp_agents)","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"cb4cd4a8d75e1f4ea829a38e9e228a17e8bc5a6f","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                                                              network)"},{"line_number":147,"context_line":"        if not active_dhcp_agents:"},{"line_number":148,"context_line":"            return"},{"line_number":149,"context_line":"        chosen_agents \u003d random.sample(active_dhcp_agents, n_agents)"},{"line_number":150,"context_line":"        self._schedule_bind_network(context, chosen_agents, network[\u0027id\u0027])"},{"line_number":151,"context_line":"        return chosen_agents"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_939a1712","line":149,"in_reply_to":"5a890539_08735b80","updated":"2014-12-24 01:37:52.000000000","message":"Cedric, I think that case is already handled in L.93.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                                                              network)"},{"line_number":147,"context_line":"        if not active_dhcp_agents:"},{"line_number":148,"context_line":"            return"},{"line_number":149,"context_line":"        chosen_agents \u003d random.sample(active_dhcp_agents, n_agents)"},{"line_number":150,"context_line":"        self._schedule_bind_network(context, chosen_agents, network[\u0027id\u0027])"},{"line_number":151,"context_line":"        return chosen_agents"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_0046b6bf","line":149,"in_reply_to":"5a890539_08735b80","updated":"2014-12-18 09:33:53.000000000","message":"Yes, we will update it.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"c7ebc978a1b4f17224a82eafe1c1179ec6085745","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                                                              network)"},{"line_number":164,"context_line":"        if not active_dhcp_agents:"},{"line_number":165,"context_line":"            return"},{"line_number":166,"context_line":"        chosen_agents \u003d plugin.get_dhcp_agents_with_min_networks(context,"},{"line_number":167,"context_line":"                                                      active_dhcp_agents,"},{"line_number":168,"context_line":"                                                                n_agents)"},{"line_number":169,"context_line":"        self._schedule_bind_network(context, chosen_agents, network[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_7ee0b9cc","line":166,"updated":"2014-12-17 12:13:14.000000000","message":"nit: for this case consider other indentation\n plugin.get_dhcp_agents_with_min_networks(\n     context, active_dhcp_agents,\t n_agents)","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                                                              network)"},{"line_number":164,"context_line":"        if not active_dhcp_agents:"},{"line_number":165,"context_line":"            return"},{"line_number":166,"context_line":"        chosen_agents \u003d plugin.get_dhcp_agents_with_min_networks(context,"},{"line_number":167,"context_line":"                                                      active_dhcp_agents,"},{"line_number":168,"context_line":"                                                                n_agents)"},{"line_number":169,"context_line":"        self._schedule_bind_network(context, chosen_agents, network[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_ef2f763c","line":166,"in_reply_to":"3a961159_7ee0b9cc","updated":"2014-12-18 09:33:53.000000000","message":"Done","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0263996e5d0f871ff2a12f455e77656cfb1ba840","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class DHCPScheduler(object):"},{"line_number":34,"context_line":"    \"\"\""},{"line_number":35,"context_line":"    This is the base scheduler class for DHCP Schedulers"},{"line_number":36,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_b332b35b","line":33,"updated":"2015-01-08 19:10:44.000000000","message":"The theory behind using a load indicator to choose an agent is that we could reuse the same scheduling logic for both L3 agents and DHCP agents.\n\nThe changes below go in the right direction, but I don\u0027t think that this is strictly related to DHCP only. Perhaps you could extract the scheduling logic in its own agent-type-independent module and specialize it for DHCP. Later on, we could make the L3 scheduling to adopt the same approach, but that\u0027s something for another patch.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e71f9fe104ca4e0d8f6f5f0dc8c995cee8742539","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class DHCPScheduler(object):"},{"line_number":34,"context_line":"    \"\"\""},{"line_number":35,"context_line":"    This is the base scheduler class for DHCP Schedulers"},{"line_number":36,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_e572a348","line":33,"in_reply_to":"3a961159_b332b35b","updated":"2015-01-09 09:51:00.000000000","message":"We agree with this suggestion.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0263996e5d0f871ff2a12f455e77656cfb1ba840","unresolved":false,"context_lines":[{"line_number":60,"context_line":"                       \u0027agent_id\u0027: agent})"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def get_active_agents(self, plugin, context, network):"},{"line_number":63,"context_line":"        \"\"\"Schedule the network to active DHCP agent(s)."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        A list of scheduled agents is returned."},{"line_number":66,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_139f0751","line":63,"updated":"2015-01-08 19:10:44.000000000","message":"If you change the method name, you should consider changing the docstring with it!","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e71f9fe104ca4e0d8f6f5f0dc8c995cee8742539","unresolved":false,"context_lines":[{"line_number":60,"context_line":"                       \u0027agent_id\u0027: agent})"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def get_active_agents(self, plugin, context, network):"},{"line_number":63,"context_line":"        \"\"\"Schedule the network to active DHCP agent(s)."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        A list of scheduled agents is returned."},{"line_number":66,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_4593774e","line":63,"in_reply_to":"3a961159_139f0751","updated":"2015-01-09 09:51:00.000000000","message":"Agreed.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0263996e5d0f871ff2a12f455e77656cfb1ba840","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            if len(dhcp_agents) \u003e\u003d agents_per_network:"},{"line_number":75,"context_line":"                LOG.debug(\u0027Network %s is hosted already\u0027,"},{"line_number":76,"context_line":"                          network[\u0027id\u0027])"},{"line_number":77,"context_line":"                return 0, []"},{"line_number":78,"context_line":"            n_agents \u003d agents_per_network - len(dhcp_agents)"},{"line_number":79,"context_line":"            enabled_dhcp_agents \u003d plugin.get_agents_db("},{"line_number":80,"context_line":"                context, filters\u003d{"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_d3357f45","line":77,"updated":"2015-01-08 19:10:44.000000000","message":"I\u0027d rather avoid returning tuples if possible. I don\u0027t think that returning the number of agents is necessary. I think this method is trying to do too much and before we can really restructure the dhcp scheduling logic there is room for breaking this up into more manageable pieces.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e71f9fe104ca4e0d8f6f5f0dc8c995cee8742539","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            if len(dhcp_agents) \u003e\u003d agents_per_network:"},{"line_number":75,"context_line":"                LOG.debug(\u0027Network %s is hosted already\u0027,"},{"line_number":76,"context_line":"                          network[\u0027id\u0027])"},{"line_number":77,"context_line":"                return 0, []"},{"line_number":78,"context_line":"            n_agents \u003d agents_per_network - len(dhcp_agents)"},{"line_number":79,"context_line":"            enabled_dhcp_agents \u003d plugin.get_agents_db("},{"line_number":80,"context_line":"                context, filters\u003d{"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_25b74bd9","line":77,"in_reply_to":"3a961159_d3357f45","updated":"2015-01-09 09:51:00.000000000","message":"Agreed, we will break up this method in to smaller ones.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"06b6be706d5ba7a8c524226617c8eac024171a13","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        return chosen_agents"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"class LeastNetworksScheduler(DHCPScheduler):"},{"line_number":157,"context_line":"    \"\"\"Allocate to DHCP agent(s) with the least number of networks bound.\"\"\""},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def schedule(self, plugin, context, network):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_bf418d3a","line":156,"updated":"2015-01-09 03:06:39.000000000","message":"If you use \"load\" for agent selection, it\u0027s no longer a leastnetworksscheduler.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e71f9fe104ca4e0d8f6f5f0dc8c995cee8742539","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        return chosen_agents"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"class LeastNetworksScheduler(DHCPScheduler):"},{"line_number":157,"context_line":"    \"\"\"Allocate to DHCP agent(s) with the least number of networks bound.\"\"\""},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def schedule(self, plugin, context, network):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_25058b79","line":156,"in_reply_to":"3a961159_bf418d3a","updated":"2015-01-09 09:51:00.000000000","message":"Agreed, we may rename this class as \"LeastLoadedScheduler\" .\n\nPlease suggest.","commit_id":"1bea306b2a10a84340a09311f7325b249382b9b8"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f9dff6e4f5bf0a03b4f26f67e70798ab63f9eb6f","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class DHCPScheduler(resource_scheduler.ResourceScheduler):"},{"line_number":33,"context_line":"    \"\"\""},{"line_number":34,"context_line":"    This is the base scheduler class for DHCP Schedulers"},{"line_number":35,"context_line":"    \"\"\""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def _schedule_bind_network(self, context, agents, network_id):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_719438e2","line":34,"updated":"2015-01-29 19:54:11.000000000","message":"invalid docstring format[1]: docstring first line contains docstring \"title\".\n\n\n[1] Envoyée par son mari qui n’arrive plus à rassasier sa bonne salope de femme","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ebfb0e27efb849b4578d3e6781beebc44e255227","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class DHCPScheduler(resource_scheduler.ResourceScheduler):"},{"line_number":33,"context_line":"    \"\"\""},{"line_number":34,"context_line":"    This is the base scheduler class for DHCP Schedulers"},{"line_number":35,"context_line":"    \"\"\""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def _schedule_bind_network(self, context, agents, network_id):"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_abbbff70","line":34,"in_reply_to":"fa81d914_719438e2","updated":"2015-02-01 05:48:07.000000000","message":"Done","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f9dff6e4f5bf0a03b4f26f67e70798ab63f9eb6f","unresolved":false,"context_lines":[{"line_number":54,"context_line":"                      {\u0027network_id\u0027: network_id,"},{"line_number":55,"context_line":"                       \u0027agent_id\u0027: agent})"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def get_nw_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":58,"context_line":"        \"\"\""},{"line_number":59,"context_line":"        Returns dhcp agents hosting the given network"},{"line_number":60,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_91a60c52","line":57,"updated":"2015-01-29 19:54:11.000000000","message":"what means nw? prefer clearer names","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ebfb0e27efb849b4578d3e6781beebc44e255227","unresolved":false,"context_lines":[{"line_number":54,"context_line":"                      {\u0027network_id\u0027: network_id,"},{"line_number":55,"context_line":"                       \u0027agent_id\u0027: agent})"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def get_nw_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":58,"context_line":"        \"\"\""},{"line_number":59,"context_line":"        Returns dhcp agents hosting the given network"},{"line_number":60,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_ebac1738","line":57,"in_reply_to":"fa81d914_91a60c52","updated":"2015-02-01 05:48:07.000000000","message":"Done","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f9dff6e4f5bf0a03b4f26f67e70798ab63f9eb6f","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def get_nw_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":58,"context_line":"        \"\"\""},{"line_number":59,"context_line":"        Returns dhcp agents hosting the given network"},{"line_number":60,"context_line":"        \"\"\""},{"line_number":61,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":62,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_918feccb","line":59,"updated":"2015-01-29 19:54:11.000000000","message":"itto","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ebfb0e27efb849b4578d3e6781beebc44e255227","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def get_nw_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":58,"context_line":"        \"\"\""},{"line_number":59,"context_line":"        Returns dhcp agents hosting the given network"},{"line_number":60,"context_line":"        \"\"\""},{"line_number":61,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":62,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_0baa4b19","line":59,"in_reply_to":"fa81d914_918feccb","updated":"2015-02-01 05:48:07.000000000","message":"Done","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"864aa9f8e12b362fa87c428561ab8371635c9349","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        return chosen_agents"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"class LeastLoadedDHCPScheduler(DHCPScheduler):"},{"line_number":169,"context_line":"    \"\"\"Allocate to DHCP agent(s) with the least number of networks bound.\"\"\""},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def schedule(self, plugin, context, resource):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_4503f241","line":168,"updated":"2015-01-29 19:02:30.000000000","message":"This is not the right way to go about it, IMO; This way there is no reuse of the weight scheduling logic, because here you made it dhcp specific. We should have a WeightScheduler that can simply schedule based on the load of the agents without having knowledge of the meaning of the load affecting the agents.\n\nThen each agent (whose changes are still missing in this patch, so where are they?), will need to be tuned to track a \u0027configurable\u0027 type of load. Networks, routers, or namespaces, etc. These will need to be captured into the load and send back to the server\u0027s scheduler periodically.\n\nFor instance we should have:\n\n  class BaseResourceFilter(object):\n    \"\"\"Encapsulate logic that is specific to the resource type.\"\"\"\n\n    @abstractmethod\n    def filter(self, plugin, context, resource):\n        \"\"\"Return the agents that can host the resource.\"\"\"\n        pass\n\n    @abstractmethod\n    def bind(self, plugin, context, resource, agents):\n        \"\"\"Bind the resource to the agents.\"\"\"\n        pass\n\n  class BaseScheduler(object):\n    \"\"\"The base scheduler (agnostic to resource type).\"\"\"\n\n    # Initialize the resource filter to be used in order to filter/bind.\n    def __init__(self, resource_filter):\n        self.resource_filter \u003d resource_filter\n\n    @abstractmethod\n    def select(self, plugin, context, agents):\n        \"\"\"Return a subset of agents based on the specific scheduling logic.\"\"\"\n        pass\n\n    def schedule(self, plugin, context, resource):\n        \"\"\"Return a subset of agents based on weight.\"\"\"\n        # filter the agents that can host the resource\n        # call select to determine the agents\n        # bind the resource to the agents\n        # return the agents\n\nYou may need to generalize how you retrieve agents based on the specific resource type, then you can have:\n\n  # These belong to a common module so that there is no name clashing\n  class WeightScheduler(BaseScheduler):\n\n        def select(self, plugin, context, agents):\n            \"\"\"Choose agents based on load.\"\"\"\n            # Return agents based on load.\n\n\n  class ChangeScheduler(BaseScheduler):\n\n        def select(self, plugin, context, agents):\n            \"\"\"Choose agents randomly.\"\"\"\n            # Return agents based on random function.\n\n  # These belong here\n  class DhcpFilter(BaseResourceFilter):\n\n    def filter(self, plugin, context, resource):\n        \"\"\"Return the agents that can host the resource.\"\"\"\n        # customize the filter logic\n\n    def bind(self, plugin, context, resource, agents):\n        \"\"\"Bind the resource to the agents.\"\"\"\n        # customize the bind logic\n\n\n WeightScheduler \u003d WeightScheduler(DhcpFilter())\n ChangeScheduler \u003d ChangeScheduler(DhcpFilter())","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"42c3176406d3cad6d6b61990e82ce66923ad32af","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        return chosen_agents"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"class LeastLoadedDHCPScheduler(DHCPScheduler):"},{"line_number":169,"context_line":"    \"\"\"Allocate to DHCP agent(s) with the least number of networks bound.\"\"\""},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def schedule(self, plugin, context, resource):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_d6787a91","line":168,"in_reply_to":"fa81d914_4503f241","updated":"2015-01-29 19:05:14.000000000","message":"obviously I got the naming wrong, but I hope you got the gist of what I wanted to say.","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f9dff6e4f5bf0a03b4f26f67e70798ab63f9eb6f","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        return chosen_agents"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"class LeastLoadedDHCPScheduler(DHCPScheduler):"},{"line_number":169,"context_line":"    \"\"\"Allocate to DHCP agent(s) with the least number of networks bound.\"\"\""},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def schedule(self, plugin, context, resource):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_e3213ba0","line":168,"in_reply_to":"fa81d914_d6787a91","updated":"2015-01-29 19:54:11.000000000","message":"+1","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ebfb0e27efb849b4578d3e6781beebc44e255227","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        return chosen_agents"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"class LeastLoadedDHCPScheduler(DHCPScheduler):"},{"line_number":169,"context_line":"    \"\"\"Allocate to DHCP agent(s) with the least number of networks bound.\"\"\""},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def schedule(self, plugin, context, resource):"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_6b6827f6","line":168,"in_reply_to":"fa81d914_e3213ba0","updated":"2015-02-01 05:48:07.000000000","message":"Armando, Agreed.\nThe approach you have given seems clearer, which will make weight scheduling logic to be common for all agents.\nWe will have two files with Filtering logic and Scheduling logic separately. \nNow, we can have customised schedulers for DHCP as well as L3.","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f9dff6e4f5bf0a03b4f26f67e70798ab63f9eb6f","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        if not nw_hostable_agents or n_agents_needed \u003c\u003d 0:"},{"line_number":179,"context_line":"            return"},{"line_number":180,"context_line":"        chosen_agents \u003d sorted(nw_hostable_agents,"},{"line_number":181,"context_line":"                               key\u003dlambda k: k[\u0027load\u0027])[0:n_agents_needed]"},{"line_number":182,"context_line":"        self._schedule_bind_network(context, chosen_agents, resource[\u0027id\u0027])"},{"line_number":183,"context_line":"        return chosen_agents"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa81d914_83307fe9","line":181,"updated":"2015-01-29 19:54:11.000000000","message":"use:\n\n  operator.itemgetter(\u0027load\u0027)\n\ninstead of the lambda function","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"ebfb0e27efb849b4578d3e6781beebc44e255227","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        if not nw_hostable_agents or n_agents_needed \u003c\u003d 0:"},{"line_number":179,"context_line":"            return"},{"line_number":180,"context_line":"        chosen_agents \u003d sorted(nw_hostable_agents,"},{"line_number":181,"context_line":"                               key\u003dlambda k: k[\u0027load\u0027])[0:n_agents_needed]"},{"line_number":182,"context_line":"        self._schedule_bind_network(context, chosen_agents, resource[\u0027id\u0027])"},{"line_number":183,"context_line":"        return chosen_agents"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_8b6d5b07","line":181,"in_reply_to":"fa81d914_83307fe9","updated":"2015-02-01 05:48:07.000000000","message":"Done","commit_id":"8f2981af82e910d74f9a70bb8048e58948477835"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c46eadf2cf3e1ec9e6cfca9fe4ced1512ce406ec","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from neutron.db import agents_db"},{"line_number":21,"context_line":"from neutron.i18n import _LW"},{"line_number":22,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":23,"context_line":"from operator import attrgetter"},{"line_number":24,"context_line":"from oslo_config import cfg"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import random"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_44fcad72","line":23,"updated":"2015-02-11 12:50:28.000000000","message":"? why in this section","commit_id":"10cd81e5de1d4470016f29af22ff4b61b3e9eea8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c46eadf2cf3e1ec9e6cfca9fe4ced1512ce406ec","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from neutron.db import agents_db"},{"line_number":21,"context_line":"from neutron.i18n import _LW"},{"line_number":22,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":23,"context_line":"from operator import attrgetter"},{"line_number":24,"context_line":"from oslo_config import cfg"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import random"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_6401b169","line":23,"updated":"2015-02-11 12:50:28.000000000","message":"same comments as before","commit_id":"10cd81e5de1d4470016f29af22ff4b61b3e9eea8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"35af4cb0fdbf76cdfaeebf58d2e58e18c86e599f","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from neutron.db import agents_db"},{"line_number":21,"context_line":"from neutron.i18n import _LW"},{"line_number":22,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":23,"context_line":"from operator import attrgetter"},{"line_number":24,"context_line":"from oslo_config import cfg"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import random"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_d5d5a9e5","line":23,"in_reply_to":"da86d52c_44fcad72","updated":"2015-02-11 13:53:06.000000000","message":"Will address this.","commit_id":"10cd81e5de1d4470016f29af22ff4b61b3e9eea8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"35af4cb0fdbf76cdfaeebf58d2e58e18c86e599f","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from neutron.db import agents_db"},{"line_number":21,"context_line":"from neutron.i18n import _LW"},{"line_number":22,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":23,"context_line":"from operator import attrgetter"},{"line_number":24,"context_line":"from oslo_config import cfg"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import random"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_35fc4572","line":23,"in_reply_to":"da86d52c_6401b169","updated":"2015-02-11 13:53:06.000000000","message":"Will address this.","commit_id":"10cd81e5de1d4470016f29af22ff4b61b3e9eea8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c46eadf2cf3e1ec9e6cfca9fe4ced1512ce406ec","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from neutron.i18n import _LW"},{"line_number":22,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":23,"context_line":"from operator import attrgetter"},{"line_number":24,"context_line":"from oslo_config import cfg"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import random"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_240b398f","line":24,"updated":"2015-02-11 12:50:28.000000000","message":"this is a third party import","commit_id":"10cd81e5de1d4470016f29af22ff4b61b3e9eea8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"35af4cb0fdbf76cdfaeebf58d2e58e18c86e599f","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from neutron.i18n import _LW"},{"line_number":22,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":23,"context_line":"from operator import attrgetter"},{"line_number":24,"context_line":"from oslo_config import cfg"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import random"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_f52c6d04","line":24,"in_reply_to":"da86d52c_240b398f","updated":"2015-02-11 13:53:06.000000000","message":"Will address this.","commit_id":"10cd81e5de1d4470016f29af22ff4b61b3e9eea8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c46eadf2cf3e1ec9e6cfca9fe4ced1512ce406ec","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from operator import attrgetter"},{"line_number":24,"context_line":"from oslo_config import cfg"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import random"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_c4efbdaf","line":26,"updated":"2015-02-11 12:50:28.000000000","message":"this should be in the first section","commit_id":"10cd81e5de1d4470016f29af22ff4b61b3e9eea8"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"35af4cb0fdbf76cdfaeebf58d2e58e18c86e599f","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from operator import attrgetter"},{"line_number":24,"context_line":"from oslo_config import cfg"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import random"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_5538d93c","line":26,"in_reply_to":"da86d52c_c4efbdaf","updated":"2015-02-11 13:53:06.000000000","message":"Agreed.","commit_id":"10cd81e5de1d4470016f29af22ff4b61b3e9eea8"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"91715eb4699db39ff91050be8cfb321c14a4777c","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from operator import attrgetter"},{"line_number":24,"context_line":"from oslo_config import cfg"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import random"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_188db5d3","line":26,"updated":"2015-02-11 14:54:34.000000000","message":"wrong import order","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from operator import attrgetter"},{"line_number":24,"context_line":"from oslo_config import cfg"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import random"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_00c22586","line":26,"in_reply_to":"da86d52c_188db5d3","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class BaseScheduler(object):"},{"line_number":32,"context_line":"    \"\"\"The base scheduler (agnostic to resource type).\"\"\""},{"line_number":33,"context_line":"    def add_filter(self, resource_filter):"},{"line_number":34,"context_line":"        self.resource_filter \u003d resource_filter"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_b8ce532b","line":31,"updated":"2015-02-11 21:41:04.000000000","message":"this is nowhere near to what I suggested. This shouldn\u0027t even be in this module.","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class BaseScheduler(object):"},{"line_number":32,"context_line":"    \"\"\"The base scheduler (agnostic to resource type).\"\"\""},{"line_number":33,"context_line":"    def add_filter(self, resource_filter):"},{"line_number":34,"context_line":"        self.resource_filter \u003d resource_filter"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_00494532","line":31,"in_reply_to":"da86d52c_b8ce532b","updated":"2015-02-13 18:00:45.000000000","message":"Will move all these class definitions to a file base_scheduler.","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"91715eb4699db39ff91050be8cfb321c14a4777c","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    @abc.abstractmethod"},{"line_number":37,"context_line":"    def select(self, plugin, context, agents):"},{"line_number":38,"context_line":"        \"\"\"Return a subset of agents based on the specific scheduling logic.\"\"\""},{"line_number":39,"context_line":"        pass"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def auto_schedule_networks(self, plugin, context, host):"},{"line_number":42,"context_line":"        \"\"\"Schedule non-hosted networks to the DHCP agent on the specified"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_b8b0298c","line":39,"updated":"2015-02-11 14:54:34.000000000","message":"pass is not needed","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    @abc.abstractmethod"},{"line_number":37,"context_line":"    def select(self, plugin, context, agents):"},{"line_number":38,"context_line":"        \"\"\"Return a subset of agents based on the specific scheduling logic.\"\"\""},{"line_number":39,"context_line":"        pass"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def auto_schedule_networks(self, plugin, context, host):"},{"line_number":42,"context_line":"        \"\"\"Schedule non-hosted networks to the DHCP agent on the specified"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_40533de2","line":39,"in_reply_to":"da86d52c_b8b0298c","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"da86d52c_18db687e","side":"PARENT","updated":"2015-02-14 22:07:53.000000000","message":"Can we keep this module for backward compatibility?\nIf operators define network chance scheduler explicitly, the current configuration does not work.\n\n  ChanceScheudler \u003d base_scheduler.ChanceScheduler\n\nNote that as I commented in base_scheduler.py, I think we still need to have scheduler classes specific to network (dhcp) scheduling.","commit_id":"80c9ab86edb922dcd27aaa8c5b99731097e52652"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"da86d52c_939e5a53","side":"PARENT","in_reply_to":"da86d52c_18db687e","updated":"2015-02-15 07:16:08.000000000","message":"As our main intention is to have common scheduler classes for all agents whichever uses it, it is evident to change configuration path for network scheduler. Still we have to think, if we want to make it backward compatible.","commit_id":"80c9ab86edb922dcd27aaa8c5b99731097e52652"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f8082aea7b7f287bb18a72ef8ab8f13a099edf5f","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import random"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.scheduler import base_scheduler"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class ChanceScheduler(base_scheduler.BaseScheduler):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_2a7f8d18","line":18,"updated":"2015-02-18 03:11:04.000000000","message":"what you miss here is the definition of a chance-based Scheduler for DHCP resources.\n\nThis is where you leverage your base behavior and composite with the DHCP resource filter.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f8082aea7b7f287bb18a72ef8ab8f13a099edf5f","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.scheduler import base_scheduler"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class ChanceScheduler(base_scheduler.BaseScheduler):"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    def select(self, plugin, context, resource_hostable_agents,"},{"line_number":24,"context_line":"               n_agents_needed):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_8a923955","line":21,"updated":"2015-02-18 03:11:04.000000000","message":"why is this here instead of base_scheduler.py, where this really belongs?","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"093565426764231506b3f1941744263eb67ac84b","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    def __init__(self):"},{"line_number":35,"context_line":"        self.resource_filter \u003d DhcpFilter()"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":38,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":39,"context_line":"        # customize the bind logic"},{"line_number":40,"context_line":"        for agent in agents:"}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_a2a1bdf8","line":37,"updated":"2015-02-18 21:19:22.000000000","message":"here and line 105 we duplicate the method, I think this should be avoided. See comment in previous file","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"7db4f162b69e6416b8c142c84dabd444a13c03f4","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":39,"context_line":"        # customize the bind logic"},{"line_number":40,"context_line":"        for agent in agents:"},{"line_number":41,"context_line":"            try:"},{"line_number":42,"context_line":"                context.session.begin(subtransactions\u003dTrue)"},{"line_number":43,"context_line":"                binding \u003d agentschedulers_db.NetworkDhcpAgentBinding()"},{"line_number":44,"context_line":"                binding.dhcp_agent \u003d agent"}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_780b11d5","line":41,"updated":"2015-02-18 12:49:53.000000000","message":"we should use \"with session.begin\" when possible it avoids mistakes ... context.session.begin should be called before the try/except.\n\nMoreover as said in a PS7, a DBDuplicateEntry error brakes the subtransaction and ALL parent transactions with session.begin, you should use session.begin_nested in order to brake ONLY the subtransaction[1].\n\n\n[1] https://github.com/openstack/neutron/blob/89025a8dd93918ac2967726ec7bb8ee5aa22d924/neutron/db/db_base_plugin_v2.py#L1302-L1306","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"44d4ca4cca5dc03a7fed025a262e090100a79b15","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":39,"context_line":"        # customize the bind logic"},{"line_number":40,"context_line":"        for agent in agents:"},{"line_number":41,"context_line":"            try:"},{"line_number":42,"context_line":"                context.session.begin(subtransactions\u003dTrue)"},{"line_number":43,"context_line":"                binding \u003d agentschedulers_db.NetworkDhcpAgentBinding()"},{"line_number":44,"context_line":"                binding.dhcp_agent \u003d agent"}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_0a4ab3ac","line":41,"in_reply_to":"da86d52c_6a316fa1","updated":"2015-02-18 14:57:18.000000000","message":"oups, it\u0027s:\n\n  # prefer this one\n  session.begin_nested()\n\nor:\n\n  session.begin(subtransaction(s)\u003dTrue, nested \u003dTrue)\n\nbecause nesting implies a subtransaction!","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"80883de6ab38f85a51cfe296ac9c8c154127d7d3","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":39,"context_line":"        # customize the bind logic"},{"line_number":40,"context_line":"        for agent in agents:"},{"line_number":41,"context_line":"            try:"},{"line_number":42,"context_line":"                context.session.begin(subtransactions\u003dTrue)"},{"line_number":43,"context_line":"                binding \u003d agentschedulers_db.NetworkDhcpAgentBinding()"},{"line_number":44,"context_line":"                binding.dhcp_agent \u003d agent"}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_cfdc2d77","line":41,"in_reply_to":"da86d52c_780b11d5","updated":"2015-02-18 14:33:13.000000000","message":"I am trying with below code but it fails lots of existing test cases \n\ndef bind(self, context, agents, resource_id, nested\u003dFalse):\n        \"\"\"Bind the resource to the agents.\"\"\"\n        # customize the bind logic\n        for agent in agents:\n            try:\n                with context.session.begin(subtransactions\u003dTrue,\n                                           nested\u003dnested):\n                    binding \u003d agentschedulers_db.NetworkDhcpAgentBinding()\n                    binding.dhcp_agent \u003d agent\n                    binding.network_id \u003d resource_id\n                    context.session.add(binding)\n                    # try to actually write the changes and catch integrity\n                    # DBDuplicateEntry\n                    context.session.commit()\n            except db_exc.DBDuplicateEntry:\n                # it\u0027s totally ok, someone just did our job!\n                context.session.rollback()\n                LOG.info(_LI(\u0027Agent %s already present\u0027), agent)\n            LOG.debug(\u0027Resource %(network_id)s is scheduled to be \u0027\n                      \u0027hosted by DHCP agent %(agent_id)s\u0027,\n                      {\u0027resource_id\u0027: resource_id,\n                       \u0027agent_id\u0027: agent})\n\n\nThe test case errors are like below,\n\n2015-02-18 06:22:45,378    ERROR [neutron.api.v2.resource] create failed\n    Traceback (most recent call last):\n      File \"neutron/api/v2/resource.py\", line 83, in resource\n        result \u003d method(request\u003drequest, **args)\n      File \"neutron/api/v2/base.py\", line 456, in create\n        obj)})\n      File \"neutron/api/v2/base.py\", line 428, in notify\n        notifier_method)\n      File \"neutron/api/v2/base.py\", line 300, in _send_dhcp_notification\n        self._dhcp_agent_notifier.notify(context, data, methodname)\n      File \"neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py\", line 185, in notify\n        self._notify_agents(context, method_name, data, network_id)\n      File \"neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py\", line 132, in _notify_agents\n        agents \u003d self._schedule_network(admin_ctx, network, agents)\n      File \"neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py\", line 65, in _schedule_network\n        new_agents \u003d self.plugin.schedule_network(context, network) or []\n      File \"neutron/db/agentschedulers_db.py\", line 388, in schedule_network\n        self, context, created_network)\n      File \"neutron/scheduler/base_scheduler.py\", line 60, in schedule\n        self.bind(context, chosen_agents, resource[\u0027id\u0027])\n      File \"neutron/scheduler/dhcp_agent_scheduler.py\", line 47, in bind\n        context.session.commit()\n      File \"/home/sdn/upstreamcode/neutron-feb14/neutron/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 462, in __exit__\n        self._assert_active(deactive_ok\u003dTrue, prepared_ok\u003dTrue)\n      File \"/home/sdn/upstreamcode/neutron-feb14/neutron/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 223, in _assert_active\n        raise sa_exc.ResourceClosedError(closed_msg)\n    ResourceClosedError: This transaction is closed\n    }}}\n\n    Traceback (most recent call last):\n      File \"neutron/tests/unit/openvswitch/test_agent_scheduler.py\", line 1277, in test_network_ha_port_create_notification\n        net, subnet, port \u003d self._network_port_create(hosts)\n      File \"neutron/tests/unit/openvswitch/test_agent_scheduler.py\", line 1247, in _network_port_create\n        with self.port(subnet\u003dsubnet1) as port:\n      File \"/usr/lib/python2.7/contextlib.py\", line 17, in __enter__\n        return self.gen.next()\n      File \"neutron/tests/unit/test_db_plugin.py\", line 584, in port\n        port \u003d self._make_port(fmt or self.fmt, net_id, **kwargs)\n      File \"neutron/tests/unit/test_db_plugin.py\", line 454, in _make_port\n        raise webob.exc.HTTPClientError(code\u003dres.status_int)\n    HTTPClientError: The server could not comply with the request since it is either malformed or otherwise incorrect.\n\nPlease let me know your inputs.","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"24e578c5c5d7f29108a89d130b391a94df6a2693","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":39,"context_line":"        # customize the bind logic"},{"line_number":40,"context_line":"        for agent in agents:"},{"line_number":41,"context_line":"            try:"},{"line_number":42,"context_line":"                context.session.begin(subtransactions\u003dTrue)"},{"line_number":43,"context_line":"                binding \u003d agentschedulers_db.NetworkDhcpAgentBinding()"},{"line_number":44,"context_line":"                binding.dhcp_agent \u003d agent"}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_6a316fa1","line":41,"in_reply_to":"da86d52c_af6e19fe","updated":"2015-02-18 14:51:41.000000000","message":"Hello,\nWe tried with your changes:\ndef bind(self, context, agents, resource_id, nested\u003dFalse):\n        \"\"\"Bind the resource to the agents.\"\"\"\n        # customize the bind logic\n        for agent in agents:\n            try:\n                with context.session.begin_nested(subtransactions\u003dTrue):\n                    binding \u003d agentschedulers_db.NetworkDhcpAgentBinding()\n                    binding.dhcp_agent \u003d agent\n                    binding.network_id \u003d resource_id\n                    context.session.add(binding)\n                    # try to actually write the changes and catch integrity\n                    # DBDuplicateEntry\n                    context.session.commit()\n            except db_exc.DBDuplicateEntry:\n                # it\u0027s totally ok, someone just did our job!\n                context.session.rollback()\n                LOG.info(_LI(\u0027Agent %s already present\u0027), agent)\n            LOG.debug(\u0027Resource %(network_id)s is scheduled to be \u0027\n                      \u0027hosted by DHCP agent %(agent_id)s\u0027,\n                      {\u0027resource_id\u0027: resource_id,\n                       \u0027agent_id\u0027: agent})\n\n\n\nException caught:\n\nneutron.tests.unit.test_dhcp_scheduler.TestNetworksFailover.test_reschedule_network_from_down_agent_failed\n----------------------------------------------------------------------------------------------------------\n\nCaptured traceback:\n~~~~~~~~~~~~~~~~~~~\n    Traceback (most recent call last):\n    _StringException: Empty attachments:\n      pythonlogging:\u0027\u0027\n      pythonlogging:\u0027neutron.api.extensions\u0027\n      stderr\n      stdout\n\n    Traceback (most recent call last):\n      File \"neutron/tests/unit/test_dhcp_scheduler.py\", line 225, in test_reschedule_network_from_down_agent_failed\n        self._test_schedule_bind_network([agents[0]], self.network_id)\n      File \"neutron/tests/unit/test_dhcp_scheduler.py\", line 85, in _test_schedule_bind_network\n        scheduler.bind(self.ctx, agents, network_id)\n      File \"neutron/scheduler/dhcp_agent_scheduler.py\", line 39, in bind\n        with context.session.begin_nested(subtransactions\u003dTrue):\n    TypeError: begin_nested() got an unexpected keyword argument \u0027subtransactions\u0027\n\n    Traceback (most recent call last):\n    _StringException: Empty attachments:\n      pythonlogging:\u0027\u0027\n      pythonlogging:\u0027neutron.api.extensions\u0027\n      stderr\n      stdout\n\n    Traceback (most recent call last):\n      File \"neutron/tests/unit/test_dhcp_scheduler.py\", line 225, in test_reschedule_network_from_down_agent_failed\n        self._test_schedule_bind_network([agents[0]], self.network_id)\n      File \"neutron/tests/unit/test_dhcp_scheduler.py\", line 85, in _test_schedule_bind_network\n        scheduler.bind(self.ctx, agents, network_id)\n      File \"neutron/scheduler/dhcp_agent_scheduler.py\", line 39, in bind\n        with context.session.begin_nested(subtransactions\u003dTrue):\n    TypeError: begin_nested() got an unexpected keyword argument \u0027subtransactions\u0027","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"45346b509b33d5dedb135dd41233330885a67a36","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":39,"context_line":"        # customize the bind logic"},{"line_number":40,"context_line":"        for agent in agents:"},{"line_number":41,"context_line":"            try:"},{"line_number":42,"context_line":"                context.session.begin(subtransactions\u003dTrue)"},{"line_number":43,"context_line":"                binding \u003d agentschedulers_db.NetworkDhcpAgentBinding()"},{"line_number":44,"context_line":"                binding.dhcp_agent \u003d agent"}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_af6e19fe","line":41,"in_reply_to":"da86d52c_cfdc2d77","updated":"2015-02-18 14:41:52.000000000","message":"The aim of session.begin context is to handle commit/rollback so no need to specify them:\n\n  for agent in agents:\n    try:\n      with context.session.begin_nested(subtransactions\u003dTrue):\n        binding \u003d agentschedulers_db.NetworkDhcpAgentBinding()\n        binding.dhcp_agent \u003d agent\n        binding.network_id \u003d resource_id\n        context.session.add(binding)\n      # The DBDuplicateEntry is raised in session.begin_nested.__exit__ (performing the commit)\n    except db_exc.DBDuplicateEntry:\n        LOG.info(_LI(\u0027Agent %s already present\u0027), agent)","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"7db4f162b69e6416b8c142c84dabd444a13c03f4","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        return True"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"class WeightScheduler(base_scheduler.BaseWeightScheduler):"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def __init__(self):"},{"line_number":103,"context_line":"        self.resource_filter \u003d DhcpFilter()"}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_580acdd2","line":100,"updated":"2015-02-18 12:49:53.000000000","message":"Chance/WeightScheduler seem to have the same bind method. Mixin/Multiple inherence use allows to avoid such duplication","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"80883de6ab38f85a51cfe296ac9c8c154127d7d3","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        return True"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"class WeightScheduler(base_scheduler.BaseWeightScheduler):"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def __init__(self):"},{"line_number":103,"context_line":"        self.resource_filter \u003d DhcpFilter()"}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_8f0b15d4","line":100,"in_reply_to":"da86d52c_580acdd2","updated":"2015-02-18 14:33:13.000000000","message":"Agreed.","commit_id":"c34685ba21baa9dfbe3e0ad0a6a6bfecee3dfdd7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"56ad9967290ffb095419760b49bc14d200394f63","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"class DhcpFilter(base_resource_filter.BaseResourceFilter):"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":90,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":91,"context_line":"        # customize the bind logic"},{"line_number":92,"context_line":"        for agent in agents:"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba7be1f8_5045c7b1","line":89,"updated":"2015-02-27 09:56:58.000000000","message":"here, you will call super(DhcpFilter, self).bind(...)\n\nThat will do the load\u003dload+1 on each agent in agents.","commit_id":"226c296e62f50d21cd145fb37faeebe4d65a5fed"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"40f7c2188a653eebe5970ef1acfc5ca36fa9901d","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":90,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":91,"context_line":"        # customize the bind logic"},{"line_number":92,"context_line":"        super(DhcpFilter, self).bind(context, agents, resource_id)"},{"line_number":93,"context_line":"        for agent in agents:"},{"line_number":94,"context_line":"            try:"},{"line_number":95,"context_line":"                context.session.begin(subtransactions\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_41b94d2d","line":92,"updated":"2015-02-28 18:06:09.000000000","message":"I am thinking that we should call the super after commit, line 103","commit_id":"1ee0a3ccb9516e9dcbdad3584aa897d5ba36e6de"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"1c1d105ba94b2b861b3bf4c97f80956893f29a84","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":90,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":91,"context_line":"        # customize the bind logic"},{"line_number":92,"context_line":"        super(DhcpFilter, self).bind(context, agents, resource_id)"},{"line_number":93,"context_line":"        for agent in agents:"},{"line_number":94,"context_line":"            try:"},{"line_number":95,"context_line":"                context.session.begin(subtransactions\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_c8063d21","line":92,"in_reply_to":"ba7be1f8_41b94d2d","updated":"2015-03-01 09:49:07.000000000","message":"If we move it to line number 103 then we have to add the single agent in a new list and then call bind method, is that ok ?","commit_id":"1ee0a3ccb9516e9dcbdad3584aa897d5ba36e6de"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8c35ec7e160d592d4dd323a1117a4e2ab87ce86f","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":90,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":91,"context_line":"        # customize the bind logic"},{"line_number":92,"context_line":"        super(DhcpFilter, self).bind(context, agents, resource_id)"},{"line_number":93,"context_line":"        for agent in agents:"},{"line_number":94,"context_line":"            try:"},{"line_number":95,"context_line":"                context.session.begin(subtransactions\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_d676da05","line":92,"in_reply_to":"ba7be1f8_c8063d21","updated":"2015-03-01 14:44:30.000000000","message":"Good point. Then we can try at line 107","commit_id":"1ee0a3ccb9516e9dcbdad3584aa897d5ba36e6de"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"53026be3d0ebf1d4e9720277ba4222e310aad174","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def auto_schedule_networks(self, plugin, context, host):"},{"line_number":35,"context_line":"        \"\"\"Schedule non-hosted networks to the DHCP agent on the specified"},{"line_number":36,"context_line":"           host."},{"line_number":37,"context_line":"        \"\"\""},{"line_number":38,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":39,"context_line":"        # a list of (agent, net_ids) tuples"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_f0541623","line":36,"updated":"2015-03-04 07:37:53.000000000","message":"Not quite related to the main topic of this change,\nbut I think it\u0027s good time to kill this auto_schedule stuff.\nIt defeats balanced distribution among agents.","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"53026be3d0ebf1d4e9720277ba4222e310aad174","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                context.session.commit()"},{"line_number":102,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":103,"context_line":"                # it\u0027s totally ok, someone just did our job!"},{"line_number":104,"context_line":"                context.session.rollback()"},{"line_number":105,"context_line":"                LOG.info(_LI(\u0027Agent %s already present\u0027), agent)"},{"line_number":106,"context_line":"            LOG.debug(\u0027Resource %(resource_id)s is scheduled to be \u0027"},{"line_number":107,"context_line":"                      \u0027hosted by DHCP agent %(agent_id)s\u0027,"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_3b520f14","line":104,"updated":"2015-03-04 07:37:53.000000000","message":"This agent should be removed from the agents list, otherwise resource counting gets messed up.","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"44a929472be94f88ccc6569b95225e13c87b699e","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                context.session.commit()"},{"line_number":102,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":103,"context_line":"                # it\u0027s totally ok, someone just did our job!"},{"line_number":104,"context_line":"                context.session.rollback()"},{"line_number":105,"context_line":"                LOG.info(_LI(\u0027Agent %s already present\u0027), agent)"},{"line_number":106,"context_line":"            LOG.debug(\u0027Resource %(resource_id)s is scheduled to be \u0027"},{"line_number":107,"context_line":"                      \u0027hosted by DHCP agent %(agent_id)s\u0027,"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_b025390c","line":104,"in_reply_to":"9a80dd14_3b520f14","updated":"2015-03-04 10:19:49.000000000","message":"Done","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"53026be3d0ebf1d4e9720277ba4222e310aad174","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                      \u0027hosted by DHCP agent %(agent_id)s\u0027,"},{"line_number":108,"context_line":"                      {\u0027resource_id\u0027: resource_id,"},{"line_number":109,"context_line":"                       \u0027agent_id\u0027: agent})"},{"line_number":110,"context_line":"        super(DhcpFilter, self).bind(context, agents, resource_id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def filter_agents(self, plugin, context, resource):"},{"line_number":113,"context_line":"        \"\"\"Return the agents that can host the resource.\"\"\""}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_f002560a","line":110,"updated":"2015-03-04 07:37:53.000000000","message":"Doesn\u0027t this line need to be inside a transaction?","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"1dd62bb0dfab5e2a255eb08176dd9883faf38fe6","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                      \u0027hosted by DHCP agent %(agent_id)s\u0027,"},{"line_number":108,"context_line":"                      {\u0027resource_id\u0027: resource_id,"},{"line_number":109,"context_line":"                       \u0027agent_id\u0027: agent})"},{"line_number":110,"context_line":"        super(DhcpFilter, self).bind(context, agents, resource_id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def filter_agents(self, plugin, context, resource):"},{"line_number":113,"context_line":"        \"\"\"Return the agents that can host the resource.\"\"\""}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_f5468820","line":110,"in_reply_to":"9a80dd14_01184bd2","updated":"2015-03-05 10:33:36.000000000","message":"Done","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"14e52e355f0bb5a4755fd4e5d2c0ccd473b5c198","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                      \u0027hosted by DHCP agent %(agent_id)s\u0027,"},{"line_number":108,"context_line":"                      {\u0027resource_id\u0027: resource_id,"},{"line_number":109,"context_line":"                       \u0027agent_id\u0027: agent})"},{"line_number":110,"context_line":"        super(DhcpFilter, self).bind(context, agents, resource_id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def filter_agents(self, plugin, context, resource):"},{"line_number":113,"context_line":"        \"\"\"Return the agents that can host the resource.\"\"\""}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_01184bd2","line":110,"in_reply_to":"9a80dd14_70d101cd","updated":"2015-03-05 07:06:22.000000000","message":"I meant, as super().bind does a read-modify-update, it needs to be inside a transaction.","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"44a929472be94f88ccc6569b95225e13c87b699e","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                      \u0027hosted by DHCP agent %(agent_id)s\u0027,"},{"line_number":108,"context_line":"                      {\u0027resource_id\u0027: resource_id,"},{"line_number":109,"context_line":"                       \u0027agent_id\u0027: agent})"},{"line_number":110,"context_line":"        super(DhcpFilter, self).bind(context, agents, resource_id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def filter_agents(self, plugin, context, resource):"},{"line_number":113,"context_line":"        \"\"\"Return the agents that can host the resource.\"\"\""}],"source_content_type":"text/x-python","patch_set":27,"id":"9a80dd14_70d101cd","line":110,"in_reply_to":"9a80dd14_f002560a","updated":"2015-03-04 10:19:49.000000000","message":"This will be taken care as part of comment in line number 104.\nAlso one more reason for this is, we need to send each agent in a new list.\nMore detail is in patch set 24.","commit_id":"dbac01457852ba5b867696166b5e38cf1de57163"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"4ee435112ee9a3fddface63bc0f675567d144156","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        hosted_agents \u003d self.get_resource_hosted_dhcp_agents(plugin,"},{"line_number":153,"context_line":"                                                          context, resource)"},{"line_number":154,"context_line":"        if hosted_agents is None:"},{"line_number":155,"context_line":"            return 0, []"},{"line_number":156,"context_line":"        n_agents \u003d cfg.CONF.dhcp_agents_per_network - len(hosted_agents)"},{"line_number":157,"context_line":"        active_dhcp_agents \u003d self.get_active_agents(plugin, context)"},{"line_number":158,"context_line":"        if not active_dhcp_agents:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_94aab717","line":155,"updated":"2015-03-05 07:38:05.000000000","message":"can we create an object that the method returns. then at the the method calling this can use:\nx \u003d get_resource_hostable_dhcp_agents\n\nx.num_agents and x.histable_agnents","commit_id":"e6707cdd8325cc4be3d92995709e43af09bf1fb0"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"8d21aa868b5422a7bd0277fa630f04478773eca1","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        hosted_agents \u003d self.get_resource_hosted_dhcp_agents(plugin,"},{"line_number":153,"context_line":"                                                          context, resource)"},{"line_number":154,"context_line":"        if hosted_agents is None:"},{"line_number":155,"context_line":"            return 0, []"},{"line_number":156,"context_line":"        n_agents \u003d cfg.CONF.dhcp_agents_per_network - len(hosted_agents)"},{"line_number":157,"context_line":"        active_dhcp_agents \u003d self.get_active_agents(plugin, context)"},{"line_number":158,"context_line":"        if not active_dhcp_agents:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_b57170e2","line":155,"in_reply_to":"9a80dd14_94aab717","updated":"2015-03-05 10:34:03.000000000","message":"We can return dict\n{\"n_agents\": n_agents , \"hostable_agents\": hostable_agents}","commit_id":"e6707cdd8325cc4be3d92995709e43af09bf1fb0"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"79b3291e8f37739fd29f7750fb570eee520150b4","unresolved":false,"context_lines":[{"line_number":75,"context_line":"class ChanceScheduler(base_scheduler.BaseChanceScheduler, AutoScheduler):"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def __init__(self):"},{"line_number":78,"context_line":"        self.resource_filter \u003d DhcpFilter()"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"class WeightScheduler(base_scheduler.BaseWeightScheduler, AutoScheduler):"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_192a2e2c","line":78,"updated":"2015-03-06 14:33:08.000000000","message":"Base***Scheduler does not have __init__ method, but it is better to call it with super().","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"483c1da6b77411c392e7aa29010b0ce549c445d8","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            return {\u0027n_agents\u0027: 0, \u0027hostable_agents\u0027: []}"},{"line_number":122,"context_line":"        return agents_dict"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_resource_hosted_dhcp_agents(self, plugin, context, resource):"},{"line_number":125,"context_line":"        \"\"\"Returns dhcp agents hosting the given resource.\"\"\""},{"line_number":126,"context_line":"        agents_per_resource \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":127,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_ff02ac6d","line":124,"updated":"2015-03-06 07:53:31.000000000","message":"what other resource? why not get_network_hosted_dhcp_agents?","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"2d6878fd4576be4599b074f1d2fd36c31b796e6b","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            return {\u0027n_agents\u0027: 0, \u0027hostable_agents\u0027: []}"},{"line_number":122,"context_line":"        return agents_dict"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_resource_hosted_dhcp_agents(self, plugin, context, resource):"},{"line_number":125,"context_line":"        \"\"\"Returns dhcp agents hosting the given resource.\"\"\""},{"line_number":126,"context_line":"        agents_per_resource \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":127,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_b5d77522","line":124,"in_reply_to":"9a80dd14_ff02ac6d","updated":"2015-03-06 08:47:58.000000000","message":"Done","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"483c1da6b77411c392e7aa29010b0ce549c445d8","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        # subnets whose enable_dhcp is false"},{"line_number":129,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":130,"context_line":"            resource_hosted_agents \u003d plugin.get_dhcp_agents_hosting_networks("},{"line_number":131,"context_line":"                context, [resource[\u0027id\u0027]], active\u003dTrue)"},{"line_number":132,"context_line":"            if len(resource_hosted_agents) \u003e\u003d agents_per_resource:"},{"line_number":133,"context_line":"                LOG.debug(\u0027Resource %s is hosted already\u0027,"},{"line_number":134,"context_line":"                          resource[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_1f278013","line":131,"updated":"2015-03-06 07:53:31.000000000","message":"since the implementation works only for network, so why not change the parameter \u0027resource\u0027 into \u0027network\u0027?","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"2d6878fd4576be4599b074f1d2fd36c31b796e6b","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        # subnets whose enable_dhcp is false"},{"line_number":129,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":130,"context_line":"            resource_hosted_agents \u003d plugin.get_dhcp_agents_hosting_networks("},{"line_number":131,"context_line":"                context, [resource[\u0027id\u0027]], active\u003dTrue)"},{"line_number":132,"context_line":"            if len(resource_hosted_agents) \u003e\u003d agents_per_resource:"},{"line_number":133,"context_line":"                LOG.debug(\u0027Resource %s is hosted already\u0027,"},{"line_number":134,"context_line":"                          resource[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_7516ddf2","line":131,"in_reply_to":"9a80dd14_1f278013","updated":"2015-03-06 08:47:58.000000000","message":"Done","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"928ea3f65b3234398e2d9623b22e5ec243fb800e","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            return {\u0027n_agents\u0027: 0, \u0027hostable_agents\u0027: []}"},{"line_number":122,"context_line":"        return agents_dict"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_network_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":125,"context_line":"        \"\"\"Returns dhcp agents hosting the given network.\"\"\""},{"line_number":126,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":127,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a80dd14_e221f54d","line":124,"updated":"2015-03-09 06:15:30.000000000","message":"get_dhcp_agents_hosting_network?","commit_id":"bbf735c391c58cc13187625eb481a1d42cf234b3"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9e6e79040e887dcd049043040c5ff027577d3d58","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            return {\u0027n_agents\u0027: 0, \u0027hostable_agents\u0027: []}"},{"line_number":122,"context_line":"        return agents_dict"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_network_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":125,"context_line":"        \"\"\"Returns dhcp agents hosting the given network.\"\"\""},{"line_number":126,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":127,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a80dd14_b9e487ac","line":124,"in_reply_to":"9a80dd14_9d0df8ea","updated":"2015-03-09 11:56:36.000000000","message":"This method is not a method of a plugin level, so I don\u0027t think there is a conflict in method names. Am I missing something?","commit_id":"bbf735c391c58cc13187625eb481a1d42cf234b3"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"417df7abd4cb3458aa08d94db3b1d42a145c778c","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            return {\u0027n_agents\u0027: 0, \u0027hostable_agents\u0027: []}"},{"line_number":122,"context_line":"        return agents_dict"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_network_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":125,"context_line":"        \"\"\"Returns dhcp agents hosting the given network.\"\"\""},{"line_number":126,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":127,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a80dd14_dcff3b32","line":124,"in_reply_to":"9a80dd14_b4e48eac","updated":"2015-03-10 10:41:10.000000000","message":"My vote is \"get_network_hosting_dhcp_agents\" (or get_dhcp_agents_hosting_network).\n\nFor consistency, it is better this method and L.150 below follow the same naming rule. In L.150 (get_network_hostable_dhcp_agent),  \"dhcp agent\" is \"able\" to \"host\" (hostable) a network.\nFrom this point of view, it seems better this method is \"get_network_hosting_dhcp_agents\" (\"dhcp agent\" is \"hosting\").","commit_id":"bbf735c391c58cc13187625eb481a1d42cf234b3"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"5170d78865c990e36859ab6b2344db9050eacfb7","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            return {\u0027n_agents\u0027: 0, \u0027hostable_agents\u0027: []}"},{"line_number":122,"context_line":"        return agents_dict"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_network_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":125,"context_line":"        \"\"\"Returns dhcp agents hosting the given network.\"\"\""},{"line_number":126,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":127,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a80dd14_b4e48eac","line":124,"in_reply_to":"9a80dd14_b9e487ac","updated":"2015-03-09 12:35:29.000000000","message":"Yes you are right this is not plugin level method , we need to decide whether to change method name as suggested by gongysh or retain current method name only ?","commit_id":"bbf735c391c58cc13187625eb481a1d42cf234b3"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"ccad554e911354993a3d04cb0bc3d1453df79843","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            return {\u0027n_agents\u0027: 0, \u0027hostable_agents\u0027: []}"},{"line_number":122,"context_line":"        return agents_dict"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_network_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":125,"context_line":"        \"\"\"Returns dhcp agents hosting the given network.\"\"\""},{"line_number":126,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":127,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a80dd14_a700b466","line":124,"in_reply_to":"9a80dd14_dcff3b32","updated":"2015-03-10 10:52:54.000000000","message":"Ok that means I will change this method name to \"get_network_hosting_dhcp_agents\" and I will retain the same method name \"get_network_hostable_dhcp_agents\" for line number 150, is that fine ?","commit_id":"bbf735c391c58cc13187625eb481a1d42cf234b3"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"94b0034bbce2be3501250ff7a506dd628adfe129","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            return {\u0027n_agents\u0027: 0, \u0027hostable_agents\u0027: []}"},{"line_number":122,"context_line":"        return agents_dict"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_network_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":125,"context_line":"        \"\"\"Returns dhcp agents hosting the given network.\"\"\""},{"line_number":126,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":127,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a80dd14_9d0df8ea","line":124,"in_reply_to":"9a80dd14_e221f54d","updated":"2015-03-09 06:32:27.000000000","message":"The method name suggested clashes with the method already present in agentschdulers_db.py.\nWe are calling that method in line 130.","commit_id":"bbf735c391c58cc13187625eb481a1d42cf234b3"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"a93edaa0d92946fccf3377ac96b3cf581d210824","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            return {\u0027n_agents\u0027: 0, \u0027hostable_agents\u0027: []}"},{"line_number":122,"context_line":"        return agents_dict"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_network_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":125,"context_line":"        \"\"\"Returns dhcp agents hosting the given network.\"\"\""},{"line_number":126,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":127,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_07ac208b","line":124,"updated":"2015-03-10 10:57:23.000000000","message":"Per my comment in the previous patch set, \"get_dhcp_agents_hosting_network\".\n\nIn addition, this method seems internal method in this class.\nIf so, please start the method name with an underscore.","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e6b55af6f2a0770288f02ba54fb2dbfdeef10da8","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            return {\u0027n_agents\u0027: 0, \u0027hostable_agents\u0027: []}"},{"line_number":122,"context_line":"        return agents_dict"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_network_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":125,"context_line":"        \"\"\"Returns dhcp agents hosting the given network.\"\"\""},{"line_number":126,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":127,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_4a0b737d","line":124,"in_reply_to":"9a80dd14_07ac208b","updated":"2015-03-10 14:39:18.000000000","message":"Done","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"a93edaa0d92946fccf3377ac96b3cf581d210824","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        return agents_dict"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_network_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":125,"context_line":"        \"\"\"Returns dhcp agents hosting the given network.\"\"\""},{"line_number":126,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":127,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"},{"line_number":128,"context_line":"        # subnets whose enable_dhcp is false"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_4715389a","line":125,"updated":"2015-03-10 10:57:23.000000000","message":"This method looks a bit tricky because it returns None if a given network is already hosted by enough number of agents.\nIt is okay, but please add a note on the return value in the docstring","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e6b55af6f2a0770288f02ba54fb2dbfdeef10da8","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        return agents_dict"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_network_hosted_dhcp_agents(self, plugin, context, network):"},{"line_number":125,"context_line":"        \"\"\"Returns dhcp agents hosting the given network.\"\"\""},{"line_number":126,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":127,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"},{"line_number":128,"context_line":"        # subnets whose enable_dhcp is false"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_2a7d5fe8","line":125,"in_reply_to":"9a80dd14_4715389a","updated":"2015-03-10 14:39:18.000000000","message":"Done","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"a93edaa0d92946fccf3377ac96b3cf581d210824","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            network_hosted_agents \u003d plugin.get_dhcp_agents_hosting_networks("},{"line_number":131,"context_line":"                context, [network[\u0027id\u0027]], active\u003dTrue)"},{"line_number":132,"context_line":"            if len(network_hosted_agents) \u003e\u003d agents_per_network:"},{"line_number":133,"context_line":"                LOG.debug(\u0027Network %s is hosted already\u0027,"},{"line_number":134,"context_line":"                          network[\u0027id\u0027])"},{"line_number":135,"context_line":"                return None"},{"line_number":136,"context_line":"        return network_hosted_agents"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_e7d8ecf0","line":133,"updated":"2015-03-10 10:57:23.000000000","message":"\"Network %s is already hosted by enough agents.\"\n\nThe current message is correct even when a network is hosted by one agent but it is expected to be hosted by multiple agents.","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e6b55af6f2a0770288f02ba54fb2dbfdeef10da8","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            network_hosted_agents \u003d plugin.get_dhcp_agents_hosting_networks("},{"line_number":131,"context_line":"                context, [network[\u0027id\u0027]], active\u003dTrue)"},{"line_number":132,"context_line":"            if len(network_hosted_agents) \u003e\u003d agents_per_network:"},{"line_number":133,"context_line":"                LOG.debug(\u0027Network %s is hosted already\u0027,"},{"line_number":134,"context_line":"                          network[\u0027id\u0027])"},{"line_number":135,"context_line":"                return None"},{"line_number":136,"context_line":"        return network_hosted_agents"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_4a8293c9","line":133,"in_reply_to":"9a80dd14_e7d8ecf0","updated":"2015-03-10 14:39:18.000000000","message":"Done","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"f1d2dceb27764f1a6b1f6cca25dafcb3df2721c1","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        return active_dhcp_agents"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def get_network_hostable_dhcp_agents(self, plugin, context, network):"},{"line_number":151,"context_line":"        \"\"\"Returns a list of dhcp agents which can host the given network.\"\"\""},{"line_number":152,"context_line":"        hosted_agents \u003d self.get_network_hosted_dhcp_agents(plugin,"},{"line_number":153,"context_line":"                                                            context, network)"},{"line_number":154,"context_line":"        if hosted_agents is None:"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_f933c8f3","line":151,"updated":"2015-03-12 05:10:05.000000000","message":"this docstring seems to need an update.  it returns more than a list.","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"7fafca9753857d657de22aa1660277a51c52f36a","unresolved":false,"context_lines":[{"line_number":102,"context_line":"                # try to actually write the changes and catch integrity"},{"line_number":103,"context_line":"                # DBDuplicateEntry"},{"line_number":104,"context_line":"                context.session.commit()"},{"line_number":105,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":106,"context_line":"                # it\u0027s totally ok, someone just did our job!"},{"line_number":107,"context_line":"                context.session.rollback()"},{"line_number":108,"context_line":"                agents.remove(agent)"}],"source_content_type":"text/x-python","patch_set":37,"id":"9a80dd14_eb620d15","line":105,"updated":"2015-03-18 10:49:23.000000000","message":"Since you didn\u0027t use context.session.begin(subtransactions\u003dTrue) as a context manager, we now have the risk of a different exception not being caught and rolling back the session.\n\nWouldn\u0027t it be easier to do something like the following that leaves the rollback semantics up to the context manager?\n\nagent_id \u003d agent.id\ntry:\n    with context.session.begin(subtransactions\u003dTrue):\n        binding \u003d agentschedulers_db.NetworkDhcpAgentBinding()\n        binding.dhcp_agent_id \u003d agent_id\n        binding.network_id \u003d network_id\n        context.session.add(binding)\nexcept db_exc.DBDuplicateEntry:\n    agents.remove(agent)\n    LOG.info(_LI(\u0027Agent %s already present\u0027), agent_id)","commit_id":"be72b811ecbdfa021ebb94040eb0ac5ea234e797"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"0267bfd70be7ba279fcad3b63779922da95247e7","unresolved":false,"context_lines":[{"line_number":102,"context_line":"                # try to actually write the changes and catch integrity"},{"line_number":103,"context_line":"                # DBDuplicateEntry"},{"line_number":104,"context_line":"                context.session.commit()"},{"line_number":105,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":106,"context_line":"                # it\u0027s totally ok, someone just did our job!"},{"line_number":107,"context_line":"                context.session.rollback()"},{"line_number":108,"context_line":"                agents.remove(agent)"}],"source_content_type":"text/x-python","patch_set":37,"id":"9a80dd14_94d52eb9","line":105,"in_reply_to":"9a80dd14_0ef12f6a","updated":"2015-03-18 11:58:51.000000000","message":"you seems to still have a session.commit() call which is not appropriate\nif you use \"with session.begin()\" style.\n\nKevin, the code here is just moved from other place.\ni don\u0027t think it\u0027s desirable to make this kind of change\nwithin the same commit.","commit_id":"be72b811ecbdfa021ebb94040eb0ac5ea234e797"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"467dd549b9d85e1d7b58814b297e809b3007a27e","unresolved":false,"context_lines":[{"line_number":102,"context_line":"                # try to actually write the changes and catch integrity"},{"line_number":103,"context_line":"                # DBDuplicateEntry"},{"line_number":104,"context_line":"                context.session.commit()"},{"line_number":105,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":106,"context_line":"                # it\u0027s totally ok, someone just did our job!"},{"line_number":107,"context_line":"                context.session.rollback()"},{"line_number":108,"context_line":"                agents.remove(agent)"}],"source_content_type":"text/x-python","patch_set":37,"id":"9a80dd14_0ef12f6a","line":105,"in_reply_to":"9a80dd14_eb620d15","updated":"2015-03-18 11:09:07.000000000","message":"If I make the suggested changes then most of existing scheduler test cases fails with transaction closed error as below. please suggest.\n\n 2015-03-18 04:05:35,785  WARNING [neutron.scheduler.dhcp_agent_scheduler] No more DHCP agents\n    2015-03-18 04:05:35,785  WARNING [neutron.api.rpc.agentnotifiers.dhcp_rpc_agent_api] Unable to schedule network bf9b6b65-00cc-4221-8691-137e9523e567: no agents available; will retry on subsequent port and subnet creation events.\n    2015-03-18 04:05:35,920     INFO [neutron.callbacks.manager] Notify callbacks for port, after_create\n    2015-03-18 04:05:35,955    ERROR [neutron.api.v2.resource] create failed\n    Traceback (most recent call last):\n      File \"neutron/api/v2/resource.py\", line 83, in resource\n        result \u003d method(request\u003drequest, **args)\n      File \"neutron/api/v2/base.py\", line 456, in create\n        obj)})\n      File \"neutron/api/v2/base.py\", line 428, in notify\n        notifier_method)\n      File \"neutron/api/v2/base.py\", line 300, in _send_dhcp_notification\n        self._dhcp_agent_notifier.notify(context, data, methodname)\n      File \"neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py\", line 186, in notify\n        self._notify_agents(context, method_name, data, network_id)\n      File \"neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py\", line 133, in _notify_agents\n        agents \u003d self._schedule_network(admin_ctx, network, agents)\n      File \"neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py\", line 65, in _schedule_network\n        new_agents \u003d self.plugin.schedule_network(context, network) or []\n      File \"neutron/db/agentschedulers_db.py\", line 412, in schedule_network\n        self, context, created_network)\n      File \"neutron/scheduler/base_scheduler.py\", line 50, in schedule\n        self.resource_filter.bind(context, chosen_agents, resource[\u0027id\u0027])\n      File \"neutron/scheduler/dhcp_agent_scheduler.py\", line 104, in bind\n        context.session.commit()\n      File \"/home/sdn/upstreamcode/neutron-mar16/neutron/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 474, in __exit__\n        self._assert_active(deactive_ok\u003dTrue, prepared_ok\u003dTrue)\n      File \"/home/sdn/upstreamcode/neutron-mar16/neutron/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 223, in _assert_active\n        raise sa_exc.ResourceClosedError(closed_msg)\n    ResourceClosedError: This transaction is closed","commit_id":"be72b811ecbdfa021ebb94040eb0ac5ea234e797"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"75a98d3ca513c65f6ed9a3d61959e178a195c0f2","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":106,"context_line":"                # it\u0027s totally ok, someone just did our job!"},{"line_number":107,"context_line":"                context.session.rollback()"},{"line_number":108,"context_line":"                agents.remove(agent)"},{"line_number":109,"context_line":"                LOG.info(_LI(\u0027Agent %s already present\u0027), agent_id)"},{"line_number":110,"context_line":"            LOG.debug(\u0027Network %(network_id)s is scheduled to be \u0027"},{"line_number":111,"context_line":"                      \u0027hosted by DHCP agent %(agent_id)s\u0027,"}],"source_content_type":"text/x-python","patch_set":37,"id":"9a80dd14_f68cbcd9","line":108,"updated":"2015-03-18 06:34:41.000000000","message":"removing an element during iteration is subtle.\nhttps://docs.python.org/2.7/reference/compound_stmts.html#the-for-statement","commit_id":"be72b811ecbdfa021ebb94040eb0ac5ea234e797"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"cc4a5fa2ee0b0831fa374e3b0e756f597e239b00","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":106,"context_line":"                # it\u0027s totally ok, someone just did our job!"},{"line_number":107,"context_line":"                context.session.rollback()"},{"line_number":108,"context_line":"                agents.remove(agent)"},{"line_number":109,"context_line":"                LOG.info(_LI(\u0027Agent %s already present\u0027), agent_id)"},{"line_number":110,"context_line":"            LOG.debug(\u0027Network %(network_id)s is scheduled to be \u0027"},{"line_number":111,"context_line":"                      \u0027hosted by DHCP agent %(agent_id)s\u0027,"}],"source_content_type":"text/x-python","patch_set":37,"id":"9a80dd14_b92310bd","line":108,"in_reply_to":"9a80dd14_f68cbcd9","updated":"2015-03-18 09:42:31.000000000","message":"Done","commit_id":"be72b811ecbdfa021ebb94040eb0ac5ea234e797"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"2be1fb2b490d11b52928e693c55403d6681857c9","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                      \u0027hosted by DHCP agent %(agent_id)s\u0027,"},{"line_number":112,"context_line":"                      {\u0027network_id\u0027: network_id,"},{"line_number":113,"context_line":"                       \u0027agent_id\u0027: agent_id})"},{"line_number":114,"context_line":"        super(DhcpFilter, self).bind(context, agents, network_id)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def filter_agents(self, plugin, context, network):"},{"line_number":117,"context_line":"        \"\"\"Return the agents that can host the network.\"\"\""}],"source_content_type":"text/x-python","patch_set":37,"id":"9a80dd14_b638843c","line":114,"updated":"2015-03-18 06:27:45.000000000","message":"increasing load in case of DBDuplicateEntry seems wrong.","commit_id":"be72b811ecbdfa021ebb94040eb0ac5ea234e797"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"75a98d3ca513c65f6ed9a3d61959e178a195c0f2","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                      \u0027hosted by DHCP agent %(agent_id)s\u0027,"},{"line_number":112,"context_line":"                      {\u0027network_id\u0027: network_id,"},{"line_number":113,"context_line":"                       \u0027agent_id\u0027: agent_id})"},{"line_number":114,"context_line":"        super(DhcpFilter, self).bind(context, agents, network_id)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def filter_agents(self, plugin, context, network):"},{"line_number":117,"context_line":"        \"\"\"Return the agents that can host the network.\"\"\""}],"source_content_type":"text/x-python","patch_set":37,"id":"9a80dd14_d675f8fa","line":114,"in_reply_to":"9a80dd14_b638843c","updated":"2015-03-18 06:34:41.000000000","message":"oops, i missed L108.  please ignore this comment.","commit_id":"be72b811ecbdfa021ebb94040eb0ac5ea234e797"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"d2a86fe895382ca13bb4dcce6f07ca3700631191","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def bind(self, context, agents, network_id):"},{"line_number":90,"context_line":"        \"\"\"Bind the network to the agents.\"\"\""},{"line_number":91,"context_line":"        # customize the bind logic"},{"line_number":92,"context_line":"        for agent in agents:"},{"line_number":93,"context_line":"            context.session.begin(subtransactions\u003dTrue)"},{"line_number":94,"context_line":"            # saving agent_id to use it after rollback to avoid"}],"source_content_type":"text/x-python","patch_set":38,"id":"9a80dd14_3499e26e","line":91,"updated":"2015-03-18 11:54:29.000000000","message":"bound_agents \u003d agents[:]","commit_id":"42f49c3168bc3323130669d43a78330a053108ce"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"d2a86fe895382ca13bb4dcce6f07ca3700631191","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                context.session.rollback()"},{"line_number":108,"context_line":"                for agent_iter in agents[:]:"},{"line_number":109,"context_line":"                    if agent_id \u003d\u003d agent_iter.id:"},{"line_number":110,"context_line":"                        agents.remove(agent_iter)"},{"line_number":111,"context_line":"                LOG.info(_LI(\u0027Agent %s already present\u0027), agent_id)"},{"line_number":112,"context_line":"            LOG.debug(\u0027Network %(network_id)s is scheduled to be \u0027"},{"line_number":113,"context_line":"                      \u0027hosted by DHCP agent %(agent_id)s\u0027,"}],"source_content_type":"text/x-python","patch_set":38,"id":"9a80dd14_74a27a9b","line":110,"updated":"2015-03-18 11:54:29.000000000","message":"replace L108-L110 with bound_agents.remove(agent)","commit_id":"42f49c3168bc3323130669d43a78330a053108ce"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"d2a86fe895382ca13bb4dcce6f07ca3700631191","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                      \u0027hosted by DHCP agent %(agent_id)s\u0027,"},{"line_number":114,"context_line":"                      {\u0027network_id\u0027: network_id,"},{"line_number":115,"context_line":"                       \u0027agent_id\u0027: agent_id})"},{"line_number":116,"context_line":"        super(DhcpFilter, self).bind(context, agents, network_id)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def filter_agents(self, plugin, context, network):"},{"line_number":119,"context_line":"        \"\"\"Return the agents that can host the network.\"\"\""}],"source_content_type":"text/x-python","patch_set":38,"id":"9a80dd14_949d2e5a","line":116,"updated":"2015-03-18 11:54:29.000000000","message":"s/agents/bound_agents/g","commit_id":"42f49c3168bc3323130669d43a78330a053108ce"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"59ec0a8740d065164f0d1c83fad15d579df4d097","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            if len(network_hosted_agents) \u003e\u003d agents_per_network:"},{"line_number":137,"context_line":"                LOG.debug(\u0027Network %s is already hosted by enough agents.\u0027,"},{"line_number":138,"context_line":"                          network[\u0027id\u0027])"},{"line_number":139,"context_line":"                return None"},{"line_number":140,"context_line":"        return network_hosted_agents"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def _get_active_agents(self, plugin, context):"}],"source_content_type":"text/x-python","patch_set":39,"id":"9a80dd14_b1e87217","line":139,"updated":"2015-03-18 17:07:11.000000000","message":"this can simply be return, but ok...","commit_id":"f6cec4881dfa634c296f440b94ad6924d76a09f7"}],"neutron/scheduler/resource_filter.py":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"91715eb4699db39ff91050be8cfb321c14a4777c","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    @abc.abstractmethod"},{"line_number":33,"context_line":"    def filter(self, plugin, context, resource):"},{"line_number":34,"context_line":"        \"\"\"Return the agents that can host the resource.\"\"\""},{"line_number":35,"context_line":"        pass"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @abc.abstractmethod"},{"line_number":38,"context_line":"    def bind(self, plugin, context, resource, agents):"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_783871ee","line":35,"updated":"2015-02-11 14:54:34.000000000","message":"itto","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    @abc.abstractmethod"},{"line_number":33,"context_line":"    def filter(self, plugin, context, resource):"},{"line_number":34,"context_line":"        \"\"\"Return the agents that can host the resource.\"\"\""},{"line_number":35,"context_line":"        pass"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @abc.abstractmethod"},{"line_number":38,"context_line":"    def bind(self, plugin, context, resource, agents):"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_e05b51f4","line":35,"in_reply_to":"da86d52c_783871ee","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"91715eb4699db39ff91050be8cfb321c14a4777c","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":55,"context_line":"        # customize the bind logic"},{"line_number":56,"context_line":"        for agent in agents:"},{"line_number":57,"context_line":"            context.session.begin(subtransactions\u003dTrue)"},{"line_number":58,"context_line":"            try:"},{"line_number":59,"context_line":"                binding \u003d agentschedulers_db.NetworkDhcpAgentBinding()"},{"line_number":60,"context_line":"                binding.dhcp_agent \u003d agent"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_5ba727bd","line":57,"updated":"2015-02-11 14:54:34.000000000","message":"You should use the following pattern:\n\n  try:\n    with context.session.begin(...):\n      ...\n  except db_exc.DuplicateEntry:\n    ...\n\n\nBut it will not work if an error append before the last agent allocation ... indeed if a db error is raised it breaks the subtransaction and ALL its ancestors.\n\nYou must use context.session.begin_nested which breaks only the subtransaction","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import abc"},{"line_number":17,"context_line":"from sqlalchemy import sql"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from oslo_config import cfg"},{"line_number":20,"context_line":"from oslo_db import exception as db_exc"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_38d82c7f","line":17,"updated":"2015-02-14 22:07:53.000000000","message":"sqlalchemy is third party module, so it should be placed in the second import group (same as oslo_*).","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import abc"},{"line_number":17,"context_line":"from sqlalchemy import sql"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from oslo_config import cfg"},{"line_number":20,"context_line":"from oslo_db import exception as db_exc"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_73cc868b","line":17,"in_reply_to":"da86d52c_38d82c7f","updated":"2015-02-15 07:16:08.000000000","message":"Done","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        \"\"\"Return the agents that can host the resource.\"\"\""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @abc.abstractmethod"},{"line_number":38,"context_line":"    def bind(self, plugin, context, resource, agents):"},{"line_number":39,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_b83a5c96","line":38,"updated":"2015-02-14 22:07:53.000000000","message":"This interface looks odd. Filter is used to retrieve a list of agents which satisfy a specified criteria and in theory we can use multiple filters per resource (e.g. to choose an appropriate dhcp-agent).\nOn the other hand, \"bind\" operation is done only once per scheduling, so bind should be a part of scheduler rather than a filter.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        \"\"\"Return the agents that can host the resource.\"\"\""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @abc.abstractmethod"},{"line_number":38,"context_line":"    def bind(self, plugin, context, resource, agents):"},{"line_number":39,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_b39d1e69","line":38,"in_reply_to":"da86d52c_b83a5c96","updated":"2015-02-15 07:16:08.000000000","message":"Agreed., we will think about your suggestion.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                return None"},{"line_number":86,"context_line":"        return resource_hosted_agents"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def get_active_agents(self, plugin, context, resource_hosted_agents):"},{"line_number":89,"context_line":"        \"\"\"A list of active dhcp agents is returned.\"\"\""},{"line_number":90,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":91,"context_line":"            active_dhcp_agents \u003d plugin.get_agents_db("}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_d8c8f0aa","line":88,"updated":"2015-02-14 22:07:53.000000000","message":"resource_hosted_agents is used. If unused, we should remove it from arguments unless there is a special reason.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                return None"},{"line_number":86,"context_line":"        return resource_hosted_agents"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def get_active_agents(self, plugin, context, resource_hosted_agents):"},{"line_number":89,"context_line":"        \"\"\"A list of active dhcp agents is returned.\"\"\""},{"line_number":90,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":91,"context_line":"            active_dhcp_agents \u003d plugin.get_agents_db("}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_5386a214","line":88,"in_reply_to":"da86d52c_d8c8f0aa","updated":"2015-02-15 07:16:08.000000000","message":"Agreed.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"88e967e4dec1095f9ee224e5ca22ffe5e1a98f4a","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        return resource_hosted_agents"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def get_active_agents(self, plugin, context, resource_hosted_agents):"},{"line_number":89,"context_line":"        \"\"\"A list of active dhcp agents is returned.\"\"\""},{"line_number":90,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":91,"context_line":"            active_dhcp_agents \u003d plugin.get_agents_db("},{"line_number":92,"context_line":"                context, filters\u003d{"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_78e2a430","line":89,"updated":"2015-02-14 22:07:53.000000000","message":"It is better to assume the subject is the method.\n\n  Returns a list of active dhcp agents.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        return resource_hosted_agents"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def get_active_agents(self, plugin, context, resource_hosted_agents):"},{"line_number":89,"context_line":"        \"\"\"A list of active dhcp agents is returned.\"\"\""},{"line_number":90,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":91,"context_line":"            active_dhcp_agents \u003d plugin.get_agents_db("},{"line_number":92,"context_line":"                context, filters\u003d{"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_f386b615","line":89,"in_reply_to":"da86d52c_78e2a430","updated":"2015-02-15 07:16:08.000000000","message":"Done","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"fe8a1f417f5e207015165aa8cfe526d795a8090e","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def filter_agents(self, plugin, context, resource):"},{"line_number":45,"context_line":"        \"\"\"Return the agents that can host the resource.\"\"\""},{"line_number":46,"context_line":"        n_agents_needed, resource_hostable_agents \u003d \\"},{"line_number":47,"context_line":"            self.get_resource_hostable_dhcp_agents(plugin, context, resource)"},{"line_number":48,"context_line":"        if not resource_hostable_agents or n_agents_needed \u003c\u003d 0:"},{"line_number":49,"context_line":"            return 0, []"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_7c529369","line":46,"updated":"2015-02-15 13:47:49.000000000","message":"ditto","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def filter_agents(self, plugin, context, resource):"},{"line_number":45,"context_line":"        \"\"\"Return the agents that can host the resource.\"\"\""},{"line_number":46,"context_line":"        n_agents_needed, resource_hostable_agents \u003d \\"},{"line_number":47,"context_line":"            self.get_resource_hostable_dhcp_agents(plugin, context, resource)"},{"line_number":48,"context_line":"        if not resource_hostable_agents or n_agents_needed \u003c\u003d 0:"},{"line_number":49,"context_line":"            return 0, []"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_473fb8d6","line":46,"in_reply_to":"da86d52c_7c529369","updated":"2015-02-15 17:25:39.000000000","message":"Agreed","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fbcc1fce85ef077f829f0f93529483db3ed4180b","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        if not resource_hostable_agents or n_agents_needed \u003c\u003d 0:"},{"line_number":49,"context_line":"            return 0, []"},{"line_number":50,"context_line":"        return n_agents_needed, resource_hostable_agents"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":53,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":54,"context_line":"        # customize the bind logic"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_87461020","line":51,"updated":"2015-02-15 15:05:39.000000000","message":"A filter should not bind, as Akihiro already mentioned.","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        if not resource_hostable_agents or n_agents_needed \u003c\u003d 0:"},{"line_number":49,"context_line":"            return 0, []"},{"line_number":50,"context_line":"        return n_agents_needed, resource_hostable_agents"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":53,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":54,"context_line":"        # customize the bind logic"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_2208f227","line":51,"in_reply_to":"da86d52c_87461020","updated":"2015-02-15 17:25:39.000000000","message":"We will consider this after thinking its pros and cons","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"fe8a1f417f5e207015165aa8cfe526d795a8090e","unresolved":false,"context_lines":[{"line_number":103,"context_line":"                                                          context, resource)"},{"line_number":104,"context_line":"        if resource_hosted_agents is None:"},{"line_number":105,"context_line":"            return 0, []"},{"line_number":106,"context_line":"        n_agents \u003d cfg.CONF.dhcp_agents_per_network - \\"},{"line_number":107,"context_line":"            len(resource_hosted_agents)"},{"line_number":108,"context_line":"        active_dhcp_agents \u003d self.get_active_agents(plugin, context)"},{"line_number":109,"context_line":"        if not active_dhcp_agents:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_fcc5a30a","line":106,"updated":"2015-02-15 13:47:49.000000000","message":"ditto","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":103,"context_line":"                                                          context, resource)"},{"line_number":104,"context_line":"        if resource_hosted_agents is None:"},{"line_number":105,"context_line":"            return 0, []"},{"line_number":106,"context_line":"        n_agents \u003d cfg.CONF.dhcp_agents_per_network - \\"},{"line_number":107,"context_line":"            len(resource_hosted_agents)"},{"line_number":108,"context_line":"        active_dhcp_agents \u003d self.get_active_agents(plugin, context)"},{"line_number":109,"context_line":"        if not active_dhcp_agents:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_e24b3a5d","line":106,"in_reply_to":"da86d52c_fcc5a30a","updated":"2015-02-15 17:25:39.000000000","message":"Agreed","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fbcc1fce85ef077f829f0f93529483db3ed4180b","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            return 0, []"},{"line_number":118,"context_line":"        n_agents \u003d min(len(hostable_dhcp_agents), n_agents)"},{"line_number":119,"context_line":"        return n_agents, hostable_dhcp_agents"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def auto_schedule_networks(self, plugin, context, host):"},{"line_number":122,"context_line":"        \"\"\"Schedule non-hosted networks to the DHCP agent on the specified"},{"line_number":123,"context_line":"           host."}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_c75008d7","line":120,"updated":"2015-02-15 15:05:39.000000000","message":"Nor should a filter do actual scheduling. I think none of us are clear what this \u0027filter\u0027 class is actually representing.","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            return 0, []"},{"line_number":118,"context_line":"        n_agents \u003d min(len(hostable_dhcp_agents), n_agents)"},{"line_number":119,"context_line":"        return n_agents, hostable_dhcp_agents"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def auto_schedule_networks(self, plugin, context, host):"},{"line_number":122,"context_line":"        \"\"\"Schedule non-hosted networks to the DHCP agent on the specified"},{"line_number":123,"context_line":"           host."}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_c22f1687","line":120,"in_reply_to":"da86d52c_c75008d7","updated":"2015-02-15 17:25:39.000000000","message":"Filter class will give resource hostable agents based  on load type . currently we have dhcp filter and in future we need to add l3 filter class to get l3 agents based on l3 load type but it will be another dependent bp. In this design scheduling logic is common across both filters.  We will think and implement backward compatibility aspects also.","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6e14ba56bad7efbf3d30fede34f3341ebf55cbc0","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            return 0, []"},{"line_number":118,"context_line":"        n_agents \u003d min(len(hostable_dhcp_agents), n_agents)"},{"line_number":119,"context_line":"        return n_agents, hostable_dhcp_agents"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def auto_schedule_networks(self, plugin, context, host):"},{"line_number":122,"context_line":"        \"\"\"Schedule non-hosted networks to the DHCP agent on the specified"},{"line_number":123,"context_line":"           host."}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_820efe30","line":120,"in_reply_to":"da86d52c_c75008d7","updated":"2015-02-15 16:58:29.000000000","message":"agreed. I think the filter, when I proposed in PS5:\n\nhttps://review.openstack.org/#/c/137017/5/neutron/scheduler/dhcp_agent_scheduler.py\n\nWas to wrap any resource specific logic (dhcp vs l3) that should not be exposed to a scheduler. In my opinion the split was:\n\n - filter: is the one that knows about the resource and does figure out what agents can host the resource\n - scheduler: is the one that does the placement amongst a set of candidates, based on a specific scheduling policy (least load, chance, etc)\n\nNow auto-scheduling is kind of an abuse, because mixes together filtering and scheduling together; this is an aberration that should be stopped if you ask me, but for now we gotta live with it somehow.\n\nI am still unclear how this patch put auto scheduling back together with the scheduler though...","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"bacd548706dbaff1260de6b088154c8e6781ac5b","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            return 0, []"},{"line_number":50,"context_line":"        return n_agents, hostable_agents"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":53,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":54,"context_line":"        # customize the bind logic"},{"line_number":55,"context_line":"        for agent in agents:"}],"source_content_type":"text/x-python","patch_set":12,"id":"da86d52c_c96d64ce","line":52,"updated":"2015-02-16 14:48:39.000000000","message":"We have retained bind method here because  if we move the bind method to scheduler class then we are facing circular import issue while calling bind in auto_schedule_networks method. please let us know if there is any way to solve this problem.","commit_id":"06f15e2531726b7c1b0917811995f3483901b6be"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f8082aea7b7f287bb18a72ef8ab8f13a099edf5f","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class DhcpFilter(BaseResourceFilter):"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def filter_agents(self, plugin, context, resource):"},{"line_number":45,"context_line":"        \"\"\"Return the agents that can host the resource.\"\"\""}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_6a7c2521","line":42,"updated":"2015-02-18 03:11:04.000000000","message":"this doesn\u0027t belong here, but in dhcp_agent_scheduler.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"80e1248bb204e5f03503d773d9c01097841e033e","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        return n_agents, hostable_agents"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":53,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":54,"context_line":"        # customize the bind logic"},{"line_number":55,"context_line":"        for agent in agents:"},{"line_number":56,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_875dfe4a","line":53,"updated":"2015-02-17 07:06:03.000000000","message":"We have retained bind method here because if we move the bind method to scheduler class then we are facing circular import issue while calling bind in auto_schedule_networks method. please let us know if there is any way to solve this problem.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f5a33674315cf4f5d02ecceda110cc1969031199","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        return n_agents, hostable_agents"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":53,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":54,"context_line":"        # customize the bind logic"},{"line_number":55,"context_line":"        for agent in agents:"},{"line_number":56,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_8f878260","line":53,"in_reply_to":"da86d52c_337f05e2","updated":"2015-02-18 20:51:22.000000000","message":"Hopefully the clarification I provided earlier gives you the answer you\u0027re looking for? That said, as I mentioned above, I don\u0027t believe having this here is the right thing to do.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c4f880bde082bc798cf3979c502823081f69208b","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        return n_agents, hostable_agents"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def bind(self, context, agents, resource_id):"},{"line_number":53,"context_line":"        \"\"\"Bind the resource to the agents.\"\"\""},{"line_number":54,"context_line":"        # customize the bind logic"},{"line_number":55,"context_line":"        for agent in agents:"},{"line_number":56,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_337f05e2","line":53,"in_reply_to":"da86d52c_875dfe4a","updated":"2015-02-18 09:50:02.000000000","message":"I am still confused. I wonder why the filter object needs a method bind(). A scheduler selects an agent from candidates which filter(s) return, so I believe bind() should be defined in a scheduler class.\n\nIt should be decided as a design not as an implementation specific topic. Circular import is an implementation specific issue and we need to find a way to avoid the circular import without breaking the design decision.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"}],"neutron/tests/functional/scheduler/test_dhcp_agent_scheduler.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f8082aea7b7f287bb18a72ef8ab8f13a099edf5f","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    def test_schedule_network(self):"},{"line_number":100,"context_line":"        self.config(dhcp_agents_per_network\u003dself.max_agents_per_network)"},{"line_number":101,"context_line":"        scheduler \u003d dhcp_agent_scheduler.ChanceScheduler()"},{"line_number":102,"context_line":"        scheduler.add_filter(\u0027DhcpFilter\u0027)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        # create dhcp agents"},{"line_number":105,"context_line":"        hosts \u003d [\u0027host-%s\u0027 % i for i in range(self.agent_count)]"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_aa161df0","line":102,"updated":"2015-02-18 03:11:04.000000000","message":"I am convinced that explicitly adding a filter is really necessary. I\u0027d like you to explore ways where this step is not required.","commit_id":"7c686b74b081eac503b8219a99f9eefae8f24714"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9ad1a3b37590bece665eaed13f2ce1c215cf55e6","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            # schedule the network"},{"line_number":113,"context_line":"            schedule_agents \u003d active_agents[:self.scheduled_agent_count]"},{"line_number":114,"context_line":"            scheduler.resource_filter.bind(self.ctx,"},{"line_number":115,"context_line":"                                          schedule_agents, self.network_id)"},{"line_number":116,"context_line":"        actual_scheduled_agents \u003d scheduler.schedule(self, self.ctx,"},{"line_number":117,"context_line":"                                                     self.network)"},{"line_number":118,"context_line":"        if self.expected_scheduled_agent_count:"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_b348aa88","line":115,"range":{"start_line":115,"start_character":0,"end_line":115,"end_character":42},"updated":"2015-02-22 17:40:45.000000000","message":"Does \"schedule_agent\" have a correct indent? In my browser \"(\" and \"s\" seem to have the same indent.","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e3e9033f221d91cc820a135577199102b931e076","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            # schedule the network"},{"line_number":113,"context_line":"            schedule_agents \u003d active_agents[:self.scheduled_agent_count]"},{"line_number":114,"context_line":"            scheduler.resource_filter.bind(self.ctx,"},{"line_number":115,"context_line":"                                          schedule_agents, self.network_id)"},{"line_number":116,"context_line":"        actual_scheduled_agents \u003d scheduler.schedule(self, self.ctx,"},{"line_number":117,"context_line":"                                                     self.network)"},{"line_number":118,"context_line":"        if self.expected_scheduled_agent_count:"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_97d46b48","line":115,"in_reply_to":"ba7be1f8_b348aa88","updated":"2015-02-23 05:07:24.000000000","message":"Its strange, pep8 was successful with this indentation.\nI will correct it.","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9ad1a3b37590bece665eaed13f2ce1c215cf55e6","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                             len(hosted_agents[\u0027agents\u0027]))"},{"line_number":126,"context_line":"        else:"},{"line_number":127,"context_line":"            empty_list \u003d []"},{"line_number":128,"context_line":"            self.assertEqual(empty_list, actual_scheduled_agents)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"class TestAutoSchedule(test_dhcp_sch.TestDhcpSchedulerBaseTestCase,"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_93456672","line":128,"updated":"2015-02-22 17:40:45.000000000","message":"Nit: assertEqual([], actual_scheduled_agents) looks sufficient.","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e3e9033f221d91cc820a135577199102b931e076","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                             len(hosted_agents[\u0027agents\u0027]))"},{"line_number":126,"context_line":"        else:"},{"line_number":127,"context_line":"            empty_list \u003d []"},{"line_number":128,"context_line":"            self.assertEqual(empty_list, actual_scheduled_agents)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"class TestAutoSchedule(test_dhcp_sch.TestDhcpSchedulerBaseTestCase,"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_b7cb2fa4","line":128,"in_reply_to":"ba7be1f8_93456672","updated":"2015-02-23 05:07:24.000000000","message":"Done","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"79b3291e8f37739fd29f7750fb570eee520150b4","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class BaseTestScheduleNetwork(object):"},{"line_number":31,"context_line":"    \"\"\"This is the Base class which defines scenarios for"},{"line_number":32,"context_line":"       ChanceScheduler and WeightScheduler."},{"line_number":33,"context_line":"    \"\"\""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    scenarios \u003d ["}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_99a8de78","line":32,"updated":"2015-03-06 14:33:08.000000000","message":"nit: it is better the summary line of docstring fits one line.\n\n  Base class which defines scenarios for schedulers.","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"79b3291e8f37739fd29f7750fb570eee520150b4","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        expected_scheduled_agent_count"},{"line_number":102,"context_line":"            Number of scheduled agents the schedule() should return"},{"line_number":103,"context_line":"            or \u0027None\u0027 if the schedule() cannot schedule the network."},{"line_number":104,"context_line":"    \"\"\""},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def test_schedule_network(self):"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_3928d2e1","line":103,"updated":"2015-03-06 14:33:08.000000000","message":"We see similar (same?) description for Chance and Weight schedulers. These attributes are defined in the scenario in the base class. It is better to move the description to the base class.","commit_id":"c7fbc97105ceb7206d597036a3131bf1143bc5bb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"a93edaa0d92946fccf3377ac96b3cf581d210824","unresolved":false,"context_lines":[{"line_number":157,"context_line":"            scheduler.resource_filter.bind(self.ctx,"},{"line_number":158,"context_line":"                                           schedule_agents, self.network_id)"},{"line_number":159,"context_line":"        actual_scheduled_agents \u003d scheduler.schedule(self, self.ctx,"},{"line_number":160,"context_line":"                                                     self.network)"},{"line_number":161,"context_line":"        if self.expected_scheduled_agent_count:"},{"line_number":162,"context_line":"            self.assertEqual(self.expected_scheduled_agent_count,"},{"line_number":163,"context_line":"                             len(actual_scheduled_agents))"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_07e6e043","line":160,"updated":"2015-03-10 10:57:23.000000000","message":"This test checks only the length of scheduled agents.\nDon\u0027t we need to check whether expected agents are chosen? This is a weight scheduler, so I think it is important to check which agents are selected.","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e6b55af6f2a0770288f02ba54fb2dbfdeef10da8","unresolved":false,"context_lines":[{"line_number":157,"context_line":"            scheduler.resource_filter.bind(self.ctx,"},{"line_number":158,"context_line":"                                           schedule_agents, self.network_id)"},{"line_number":159,"context_line":"        actual_scheduled_agents \u003d scheduler.schedule(self, self.ctx,"},{"line_number":160,"context_line":"                                                     self.network)"},{"line_number":161,"context_line":"        if self.expected_scheduled_agent_count:"},{"line_number":162,"context_line":"            self.assertEqual(self.expected_scheduled_agent_count,"},{"line_number":163,"context_line":"                             len(actual_scheduled_agents))"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_cdbcdd09","line":160,"in_reply_to":"9a80dd14_07e6e043","updated":"2015-03-10 14:39:18.000000000","message":"This scenario has been handled in the unit test case of the file : https://review.openstack.org/#/c/137017/33/neutron/tests/unit/test_dhcp_scheduler.py\n\nIn the method: def test_scheduler_equal_distribution(self):\t\nwhich starts at line number 350\n\nPlease let me know whether we need to add similar logic here also ?","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"2db29508fcb7c9e20db823533c608ea2dcd3cc96","unresolved":false,"context_lines":[{"line_number":157,"context_line":"            scheduler.resource_filter.bind(self.ctx,"},{"line_number":158,"context_line":"                                           schedule_agents, self.network_id)"},{"line_number":159,"context_line":"        actual_scheduled_agents \u003d scheduler.schedule(self, self.ctx,"},{"line_number":160,"context_line":"                                                     self.network)"},{"line_number":161,"context_line":"        if self.expected_scheduled_agent_count:"},{"line_number":162,"context_line":"            self.assertEqual(self.expected_scheduled_agent_count,"},{"line_number":163,"context_line":"                             len(actual_scheduled_agents))"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_805ec843","line":160,"in_reply_to":"9a80dd14_cdbcdd09","updated":"2015-03-12 10:35:48.000000000","message":"Please ignore above comment, we have taken care of this by modifying this test case to check whether expected agents itself are chosen for scheduling the network.","commit_id":"f22117c180b99454c52007d84245f4c95cdccdac"}],"neutron/tests/unit/openvswitch/test_agent_scheduler.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":367,"context_line":"            \u0027binary\u0027: \u0027neutron-dhcp-agent\u0027,"},{"line_number":368,"context_line":"            \u0027host\u0027: DHCP_HOSTA,"},{"line_number":369,"context_line":"            \u0027topic\u0027: \u0027DHCP_AGENT\u0027,"},{"line_number":370,"context_line":"            \u0027load\u0027: 0,"},{"line_number":371,"context_line":"            \u0027configurations\u0027: {\u0027dhcp_driver\u0027: \u0027dhcp_driver\u0027,"},{"line_number":372,"context_line":"                               \u0027use_namespaces\u0027: True,"},{"line_number":373,"context_line":"                               },"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_1893df5b","line":370,"updated":"2015-02-11 21:41:04.000000000","message":"These tests changes won\u0027t be necessary if you made the server able to work with agents that do not report the load (which is what you should do). See my comment to agent_db.","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":367,"context_line":"            \u0027binary\u0027: \u0027neutron-dhcp-agent\u0027,"},{"line_number":368,"context_line":"            \u0027host\u0027: DHCP_HOSTA,"},{"line_number":369,"context_line":"            \u0027topic\u0027: \u0027DHCP_AGENT\u0027,"},{"line_number":370,"context_line":"            \u0027load\u0027: 0,"},{"line_number":371,"context_line":"            \u0027configurations\u0027: {\u0027dhcp_driver\u0027: \u0027dhcp_driver\u0027,"},{"line_number":372,"context_line":"                               \u0027use_namespaces\u0027: True,"},{"line_number":373,"context_line":"                               },"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_406a5d82","line":370,"in_reply_to":"da86d52c_1893df5b","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"}],"neutron/tests/unit/test_agent_ext_plugin.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            \u0027binary\u0027: \u0027neutron-dhcp-agent\u0027,"},{"line_number":104,"context_line":"            \u0027host\u0027: DHCP_HOSTA,"},{"line_number":105,"context_line":"            \u0027topic\u0027: \u0027DHCP_AGENT\u0027,"},{"line_number":106,"context_line":"            \u0027load\u0027: 0,"},{"line_number":107,"context_line":"            \u0027configurations\u0027: {\u0027dhcp_driver\u0027: \u0027dhcp_driver\u0027,"},{"line_number":108,"context_line":"                               \u0027use_namespaces\u0027: True,"},{"line_number":109,"context_line":"                               },"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_5899d777","line":106,"updated":"2015-02-11 21:41:04.000000000","message":"get rid of these","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            \u0027binary\u0027: \u0027neutron-dhcp-agent\u0027,"},{"line_number":104,"context_line":"            \u0027host\u0027: DHCP_HOSTA,"},{"line_number":105,"context_line":"            \u0027topic\u0027: \u0027DHCP_AGENT\u0027,"},{"line_number":106,"context_line":"            \u0027load\u0027: 0,"},{"line_number":107,"context_line":"            \u0027configurations\u0027: {\u0027dhcp_driver\u0027: \u0027dhcp_driver\u0027,"},{"line_number":108,"context_line":"                               \u0027use_namespaces\u0027: True,"},{"line_number":109,"context_line":"                               },"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_606761b8","line":106,"in_reply_to":"da86d52c_5899d777","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"}],"neutron/tests/unit/test_dhcp_scheduler.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"9a97ce32afd21bba362209f80a48a567cc2c6211","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        plugin.get_subnets.return_value \u003d [{\"network_id\": self.network_id,"},{"line_number":137,"context_line":"                                            \"enable_dhcp\": True}]"},{"line_number":138,"context_line":"        agents \u003d self._get_agents([\u0027host-a\u0027])"},{"line_number":139,"context_line":"        self._save_agents(agents)"},{"line_number":140,"context_line":"        scheduler \u003d dhcp_agent_scheduler.LeastNetworksScheduler()"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        self.assertTrue(scheduler.auto_schedule_networks(plugin,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_e003910a","line":139,"updated":"2014-12-04 07:30:16.000000000","message":"what is this function doing?","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        plugin.get_subnets.return_value \u003d [{\"network_id\": self.network_id,"},{"line_number":137,"context_line":"                                            \"enable_dhcp\": True}]"},{"line_number":138,"context_line":"        agents \u003d self._get_agents([\u0027host-a\u0027])"},{"line_number":139,"context_line":"        self._save_agents(agents)"},{"line_number":140,"context_line":"        scheduler \u003d dhcp_agent_scheduler.LeastNetworksScheduler()"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        self.assertTrue(scheduler.auto_schedule_networks(plugin,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_5c50cd2b","line":139,"in_reply_to":"5a890539_e003910a","updated":"2014-12-18 09:33:53.000000000","message":"This test is to check auto_schedule_networks() method works without fail with new Scheduler.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"6f3ba1bcffc9ee4c272a1a48fc782ccef8f4acc1","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                                                         self.ctx, \"host-a\"))"},{"line_number":144,"context_line":"        results \u003d ("},{"line_number":145,"context_line":"            self.ctx.session.query(agentschedulers_db.NetworkDhcpAgentBinding)"},{"line_number":146,"context_line":"            .all())"},{"line_number":147,"context_line":"        self.assertEqual(1, len(results))"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def test_auto_schedule_networks_already_scheduled_least_networks_based("}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_a8e167d1","line":146,"updated":"2014-12-04 12:41:51.000000000","message":"you should use .count() instead of .all()","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"cb4cd4a8d75e1f4ea829a38e9e228a17e8bc5a6f","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                                                         self.ctx, \"host-a\"))"},{"line_number":144,"context_line":"        results \u003d ("},{"line_number":145,"context_line":"            self.ctx.session.query(agentschedulers_db.NetworkDhcpAgentBinding)"},{"line_number":146,"context_line":"            .all())"},{"line_number":147,"context_line":"        self.assertEqual(1, len(results))"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def test_auto_schedule_networks_already_scheduled_least_networks_based("}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_53ffcf01","line":146,"in_reply_to":"3a961159_a053226b","updated":"2014-12-24 01:37:52.000000000","message":"This function is a copy-and-paste of test_auto_schedule_networks_random_based.\n\nIf you change this all() to count(), L.109 also needs to be updated.","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                                                         self.ctx, \"host-a\"))"},{"line_number":144,"context_line":"        results \u003d ("},{"line_number":145,"context_line":"            self.ctx.session.query(agentschedulers_db.NetworkDhcpAgentBinding)"},{"line_number":146,"context_line":"            .all())"},{"line_number":147,"context_line":"        self.assertEqual(1, len(results))"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def test_auto_schedule_networks_already_scheduled_least_networks_based("}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_a053226b","line":146,"in_reply_to":"5a890539_a8e167d1","updated":"2014-12-18 09:33:53.000000000","message":"Done","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"6f3ba1bcffc9ee4c272a1a48fc782ccef8f4acc1","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                                                         self.ctx, \"host-a\"))"},{"line_number":160,"context_line":"        results \u003d ("},{"line_number":161,"context_line":"            self.ctx.session.query(agentschedulers_db.NetworkDhcpAgentBinding)"},{"line_number":162,"context_line":"            .all())"},{"line_number":163,"context_line":"        self.assertEqual(1, len(results))"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_c8e4f3e1","line":162,"updated":"2014-12-04 12:41:51.000000000","message":"itto","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"186495a29c67e811677279176afefb7c4054a7ed","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                                                         self.ctx, \"host-a\"))"},{"line_number":160,"context_line":"        results \u003d ("},{"line_number":161,"context_line":"            self.ctx.session.query(agentschedulers_db.NetworkDhcpAgentBinding)"},{"line_number":162,"context_line":"            .all())"},{"line_number":163,"context_line":"        self.assertEqual(1, len(results))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_c0502e61","line":162,"in_reply_to":"5a890539_c8e4f3e1","updated":"2014-12-18 09:33:53.000000000","message":"Done","commit_id":"9244bb2ac3c7d171bea584426c7e7cb620636494"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                binary\u003d\u0027neutron-dhcp-agent\u0027,"},{"line_number":52,"context_line":"                host\u003dhost,"},{"line_number":53,"context_line":"                topic\u003dtopics.DHCP_AGENT,"},{"line_number":54,"context_line":"                load\u003d0,"},{"line_number":55,"context_line":"                configurations\u003d\"\","},{"line_number":56,"context_line":"                agent_type\u003dconstants.AGENT_TYPE_DHCP,"},{"line_number":57,"context_line":"                created_at\u003dtimeutils.utcnow(),"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_988eef2c","line":54,"updated":"2015-02-11 21:41:04.000000000","message":"and this","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"bcd84b61b2c059829b66111d71d60e5f4d9ea73b","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                binary\u003d\u0027neutron-dhcp-agent\u0027,"},{"line_number":52,"context_line":"                host\u003dhost,"},{"line_number":53,"context_line":"                topic\u003dtopics.DHCP_AGENT,"},{"line_number":54,"context_line":"                load\u003d0,"},{"line_number":55,"context_line":"                configurations\u003d\"\","},{"line_number":56,"context_line":"                agent_type\u003dconstants.AGENT_TYPE_DHCP,"},{"line_number":57,"context_line":"                created_at\u003dtimeutils.utcnow(),"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_20f489ce","line":54,"in_reply_to":"da86d52c_988eef2c","updated":"2015-02-13 18:00:45.000000000","message":"Done","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e9f40e9691c774d8bd6770964533781022c069e","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    def _test_schedule_bind_network(self, agents, network_id):"},{"line_number":85,"context_line":"        scheduler \u003d dhcp_agent_scheduler.ChanceScheduler()"},{"line_number":86,"context_line":"        dhcp_filter \u003d importutils.import_object("},{"line_number":87,"context_line":"            \u0027neutron.scheduler.resource_filter.DhcpFilter\u0027"},{"line_number":88,"context_line":"        )"},{"line_number":89,"context_line":"        scheduler.add_filter(dhcp_filter)"},{"line_number":90,"context_line":"        scheduler.resource_filter.bind(self.ctx, agents, network_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da86d52c_d884e70c","line":87,"updated":"2015-02-11 21:41:04.000000000","message":"you should not sprinkle this import all over the place!","commit_id":"812b66e4d5390ea572a5f785a4f3184c52681b5b"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"94738f216988434c9d09a5abebfb7f42ff5a008e","unresolved":false,"context_lines":[{"line_number":258,"context_line":"            self.assertIn(\u0027foo3\u0027, res_ids)"},{"line_number":259,"context_line":"            self.assertIn(\u0027foo4\u0027, res_ids)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"class DHCPAgentLeastNetworksSchedulerTestCase(TestDhcpSchedulerBaseTestCase):"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_9d9f4a65","line":261,"updated":"2015-02-14 19:23:56.000000000","message":"I think you\u0027re missing a test that verifies that when scheduling a network, it is scheduled on the agent hosting the least amount of resources.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"115a1a06781848aac597603fb47f1c7e1b3a18af","unresolved":false,"context_lines":[{"line_number":258,"context_line":"            self.assertIn(\u0027foo3\u0027, res_ids)"},{"line_number":259,"context_line":"            self.assertIn(\u0027foo4\u0027, res_ids)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"class DHCPAgentLeastNetworksSchedulerTestCase(TestDhcpSchedulerBaseTestCase):"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_f3b876ea","line":261,"in_reply_to":"da86d52c_9d9f4a65","updated":"2015-02-15 07:16:08.000000000","message":"Yes, agreed.. We need to add that test.","commit_id":"6aa47c4db2fe05b8d35a5218e30831db4e708f53"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fbcc1fce85ef077f829f0f93529483db3ed4180b","unresolved":false,"context_lines":[{"line_number":258,"context_line":"            self.assertIn(\u0027foo3\u0027, res_ids)"},{"line_number":259,"context_line":"            self.assertIn(\u0027foo4\u0027, res_ids)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"class DHCPAgentLeastNetworksSchedulerTestCase(TestDhcpSchedulerBaseTestCase):"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_e75c2cf3","line":261,"updated":"2015-02-15 15:05:39.000000000","message":"Unaddressed comment about missing test from PS 9. If I\u0027m not mistaken, nothing currently actually puts anything in the load column, so you can\u0027t write such a test. This goes back to me saying that this patch is very confusing - It adds an unused infrastructure. I\u0027d expect a follow up patch (?)","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":258,"context_line":"            self.assertIn(\u0027foo3\u0027, res_ids)"},{"line_number":259,"context_line":"            self.assertIn(\u0027foo4\u0027, res_ids)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"class DHCPAgentLeastNetworksSchedulerTestCase(TestDhcpSchedulerBaseTestCase):"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_427246ae","line":261,"in_reply_to":"da86d52c_e75c2cf3","updated":"2015-02-15 17:25:39.000000000","message":"Agreed, we will definitely add the missing test case in next patch set .","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"fe8a1f417f5e207015165aa8cfe526d795a8090e","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                                               {\u0027id\u0027: \u00271111\u0027})"},{"line_number":281,"context_line":"        agents \u003d self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":282,"context_line":"                                                              [\u00271111\u0027])"},{"line_number":283,"context_line":"        self.assertEqual(len(agents), 1)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def test_scheduler_two_agents_per_network(self):"},{"line_number":286,"context_line":"        cfg.CONF.set_override(\u0027dhcp_agents_per_network\u0027, 2)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_7cd9b3f3","line":283,"updated":"2015-02-15 13:47:49.000000000","message":"assertEqual(expected, actual)\n\nself.assertEqual(1,len(agents))","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":11774,"name":"Shivakumar M","email":"shiva.kum.m@hp.com","username":"ShivakumarM"},"change_message_id":"541b862f699788fcfb51bfe04b93b391e06cf1f1","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                                               {\u0027id\u0027: \u00271111\u0027})"},{"line_number":281,"context_line":"        agents \u003d self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":282,"context_line":"                                                              [\u00271111\u0027])"},{"line_number":283,"context_line":"        self.assertEqual(len(agents), 1)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def test_scheduler_two_agents_per_network(self):"},{"line_number":286,"context_line":"        cfg.CONF.set_override(\u0027dhcp_agents_per_network\u0027, 2)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_62666af0","line":283,"in_reply_to":"da86d52c_7cd9b3f3","updated":"2015-02-15 17:25:39.000000000","message":"Agreed","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"fe8a1f417f5e207015165aa8cfe526d795a8090e","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                                               {\u0027id\u0027: \u00271111\u0027})"},{"line_number":292,"context_line":"        agents \u003d self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":293,"context_line":"                                                              [\u00271111\u0027])"},{"line_number":294,"context_line":"        self.assertEqual(len(agents), 2)"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"    def test_scheduler_no_active_agents(self):"},{"line_number":297,"context_line":"        self._save_networks([\u00271111\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_9cd667c2","line":294,"updated":"2015-02-15 13:47:49.000000000","message":"ditto","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"fe8a1f417f5e207015165aa8cfe526d795a8090e","unresolved":false,"context_lines":[{"line_number":299,"context_line":"                                               {\u0027id\u0027: \u00271111\u0027})"},{"line_number":300,"context_line":"        agents \u003d self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":301,"context_line":"                                                              [\u00271111\u0027])"},{"line_number":302,"context_line":"        self.assertEqual(len(agents), 0)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_bce32ba3","line":302,"updated":"2015-02-15 13:47:49.000000000","message":"ditto","commit_id":"7d710320864d8dbec8a7abdeb882ab74930d87c4"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9ad1a3b37590bece665eaed13f2ce1c215cf55e6","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import contextlib"},{"line_number":17,"context_line":"import datetime"},{"line_number":18,"context_line":"import mock"},{"line_number":19,"context_line":"import testscenarios"},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_f359425c","line":17,"updated":"2015-02-22 17:40:45.000000000","message":"Blank line here","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e3e9033f221d91cc820a135577199102b931e076","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import contextlib"},{"line_number":17,"context_line":"import datetime"},{"line_number":18,"context_line":"import mock"},{"line_number":19,"context_line":"import testscenarios"},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_d7cee3b3","line":17,"in_reply_to":"ba7be1f8_f359425c","updated":"2015-02-23 05:07:24.000000000","message":"Done","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9ad1a3b37590bece665eaed13f2ce1c215cf55e6","unresolved":false,"context_lines":[{"line_number":17,"context_line":"import datetime"},{"line_number":18,"context_line":"import mock"},{"line_number":19,"context_line":"import testscenarios"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from oslo_config import cfg"},{"line_number":22,"context_line":"from oslo_utils import importutils"},{"line_number":23,"context_line":"from oslo_utils import timeutils"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_1359765a","line":20,"updated":"2015-02-22 17:40:45.000000000","message":"Blank line is unnecessary.","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e3e9033f221d91cc820a135577199102b931e076","unresolved":false,"context_lines":[{"line_number":17,"context_line":"import datetime"},{"line_number":18,"context_line":"import mock"},{"line_number":19,"context_line":"import testscenarios"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from oslo_config import cfg"},{"line_number":22,"context_line":"from oslo_utils import importutils"},{"line_number":23,"context_line":"from oslo_utils import timeutils"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba7be1f8_f7c4c793","line":20,"in_reply_to":"ba7be1f8_1359765a","updated":"2015-02-23 05:07:24.000000000","message":"Done","commit_id":"2dc7590e50cb1e156875be79c683e13ddd0cc325"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"40f7c2188a653eebe5970ef1acfc5ca36fa9901d","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.network_id \u003d \u0027foo_network_id\u0027"},{"line_number":49,"context_line":"        self._save_networks([self.network_id])"},{"line_number":50,"context_line":"        config.register_dhcp_load_type_opts_helper(cfg.CONF)"},{"line_number":51,"context_line":"        self.setup_coreplugin(\u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def _get_agents(self, hosts):"},{"line_number":54,"context_line":"        return ["}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_c17c5d75","line":51,"updated":"2015-02-28 18:06:09.000000000","message":"I would imagine that if you didn\u0027t use the plugin in the base filter you wouldn\u0027t need this setup_coreplugin method call.","commit_id":"1ee0a3ccb9516e9dcbdad3584aa897d5ba36e6de"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"1c1d105ba94b2b861b3bf4c97f80956893f29a84","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.network_id \u003d \u0027foo_network_id\u0027"},{"line_number":49,"context_line":"        self._save_networks([self.network_id])"},{"line_number":50,"context_line":"        config.register_dhcp_load_type_opts_helper(cfg.CONF)"},{"line_number":51,"context_line":"        self.setup_coreplugin(\u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def _get_agents(self, hosts):"},{"line_number":54,"context_line":"        return ["}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_6b09cb2b","line":51,"in_reply_to":"ba7be1f8_c17c5d75","updated":"2015-03-01 09:49:07.000000000","message":"Agreed. I will refactor this code.","commit_id":"1ee0a3ccb9516e9dcbdad3584aa897d5ba36e6de"},{"author":{"_account_id":11765,"name":"selvakumar","username":"selvakumarnms","inactive":true},"change_message_id":"1d844573c3907ffade7b6e8f1d440113cb3747cc","unresolved":false,"context_lines":[{"line_number":362,"context_line":"        self.assertEqual(0, len(agents))"},{"line_number":363,"context_line":""},{"line_number":364,"context_line":"    def test_different_dhcp_load_type(self):"},{"line_number":365,"context_line":"        DB_PLUGIN_KLASS \u003d \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027"},{"line_number":366,"context_line":"        cfg.CONF.set_override(\"core_plugin\", DB_PLUGIN_KLASS)"},{"line_number":367,"context_line":"        cfg.CONF.set_override(\"network_scheduler_driver\","},{"line_number":368,"context_line":"            \u0027neutron.scheduler.dhcp_agent_scheduler.WeightScheduler\u0027)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9a80dd14_d7d3685d","line":365,"updated":"2015-03-17 10:14:54.000000000","message":"can we move in to setUp() method?","commit_id":"0742ce5913f5516e10044a495d1128d633ebbf29"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e1bddbd0197440b304f308f5e2ae76b4b7410c69","unresolved":false,"context_lines":[{"line_number":362,"context_line":"        self.assertEqual(0, len(agents))"},{"line_number":363,"context_line":""},{"line_number":364,"context_line":"    def test_different_dhcp_load_type(self):"},{"line_number":365,"context_line":"        DB_PLUGIN_KLASS \u003d \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027"},{"line_number":366,"context_line":"        cfg.CONF.set_override(\"core_plugin\", DB_PLUGIN_KLASS)"},{"line_number":367,"context_line":"        cfg.CONF.set_override(\"network_scheduler_driver\","},{"line_number":368,"context_line":"            \u0027neutron.scheduler.dhcp_agent_scheduler.WeightScheduler\u0027)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9a80dd14_12e18efe","line":365,"in_reply_to":"9a80dd14_d7d3685d","updated":"2015-03-17 10:38:18.000000000","message":"Agreed.","commit_id":"0742ce5913f5516e10044a495d1128d633ebbf29"},{"author":{"_account_id":11765,"name":"selvakumar","username":"selvakumarnms","inactive":true},"change_message_id":"1d844573c3907ffade7b6e8f1d440113cb3747cc","unresolved":false,"context_lines":[{"line_number":385,"context_line":"            self.assertEqual(1, fake_log.call_count)"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    def test_scheduler_equal_distribution(self):"},{"line_number":388,"context_line":"        DB_PLUGIN_KLASS \u003d \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027"},{"line_number":389,"context_line":"        cfg.CONF.set_override(\"core_plugin\", DB_PLUGIN_KLASS)"},{"line_number":390,"context_line":"        cfg.CONF.set_override(\"network_scheduler_driver\","},{"line_number":391,"context_line":"            \u0027neutron.scheduler.dhcp_agent_scheduler.WeightScheduler\u0027)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9a80dd14_57bf78fc","line":388,"updated":"2015-03-17 10:14:54.000000000","message":"same as 365","commit_id":"0742ce5913f5516e10044a495d1128d633ebbf29"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e1bddbd0197440b304f308f5e2ae76b4b7410c69","unresolved":false,"context_lines":[{"line_number":385,"context_line":"            self.assertEqual(1, fake_log.call_count)"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    def test_scheduler_equal_distribution(self):"},{"line_number":388,"context_line":"        DB_PLUGIN_KLASS \u003d \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027"},{"line_number":389,"context_line":"        cfg.CONF.set_override(\"core_plugin\", DB_PLUGIN_KLASS)"},{"line_number":390,"context_line":"        cfg.CONF.set_override(\"network_scheduler_driver\","},{"line_number":391,"context_line":"            \u0027neutron.scheduler.dhcp_agent_scheduler.WeightScheduler\u0027)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9a80dd14_b2b8c2e9","line":388,"in_reply_to":"9a80dd14_57bf78fc","updated":"2015-03-17 10:38:18.000000000","message":"Agreed.","commit_id":"0742ce5913f5516e10044a495d1128d633ebbf29"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"b466c3415ec5eb9a1f3ed45500219f40d3ee015f","unresolved":false,"context_lines":[{"line_number":424,"context_line":"                                               {\u0027id\u0027: \u00273333\u0027})"},{"line_number":425,"context_line":"        agent3 \u003d self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":426,"context_line":"                                                              [\u00273333\u0027])"},{"line_number":427,"context_line":"        self.assertEqual(agent1[0][\u0027host\u0027], \u0027host-c\u0027)"},{"line_number":428,"context_line":"        self.assertEqual(agent2[0][\u0027host\u0027], \u0027host-c\u0027)"},{"line_number":429,"context_line":"        self.assertEqual(agent3[0][\u0027host\u0027], \u0027host-d\u0027)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9a80dd14_b79fd464","line":427,"updated":"2015-03-17 10:24:51.000000000","message":"self.assertEqual(\u0027host-c\u0027, agent1[0][\u0027host\u0027])","commit_id":"0742ce5913f5516e10044a495d1128d633ebbf29"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e1bddbd0197440b304f308f5e2ae76b4b7410c69","unresolved":false,"context_lines":[{"line_number":424,"context_line":"                                               {\u0027id\u0027: \u00273333\u0027})"},{"line_number":425,"context_line":"        agent3 \u003d self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":426,"context_line":"                                                              [\u00273333\u0027])"},{"line_number":427,"context_line":"        self.assertEqual(agent1[0][\u0027host\u0027], \u0027host-c\u0027)"},{"line_number":428,"context_line":"        self.assertEqual(agent2[0][\u0027host\u0027], \u0027host-c\u0027)"},{"line_number":429,"context_line":"        self.assertEqual(agent3[0][\u0027host\u0027], \u0027host-d\u0027)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9a80dd14_12b8aee4","line":427,"in_reply_to":"9a80dd14_b79fd464","updated":"2015-03-17 10:38:18.000000000","message":"Agreed.","commit_id":"0742ce5913f5516e10044a495d1128d633ebbf29"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"b466c3415ec5eb9a1f3ed45500219f40d3ee015f","unresolved":false,"context_lines":[{"line_number":425,"context_line":"        agent3 \u003d self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":426,"context_line":"                                                              [\u00273333\u0027])"},{"line_number":427,"context_line":"        self.assertEqual(agent1[0][\u0027host\u0027], \u0027host-c\u0027)"},{"line_number":428,"context_line":"        self.assertEqual(agent2[0][\u0027host\u0027], \u0027host-c\u0027)"},{"line_number":429,"context_line":"        self.assertEqual(agent3[0][\u0027host\u0027], \u0027host-d\u0027)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9a80dd14_d7a448bb","line":428,"updated":"2015-03-17 10:24:51.000000000","message":"ditto","commit_id":"0742ce5913f5516e10044a495d1128d633ebbf29"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e1bddbd0197440b304f308f5e2ae76b4b7410c69","unresolved":false,"context_lines":[{"line_number":425,"context_line":"        agent3 \u003d self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":426,"context_line":"                                                              [\u00273333\u0027])"},{"line_number":427,"context_line":"        self.assertEqual(agent1[0][\u0027host\u0027], \u0027host-c\u0027)"},{"line_number":428,"context_line":"        self.assertEqual(agent2[0][\u0027host\u0027], \u0027host-c\u0027)"},{"line_number":429,"context_line":"        self.assertEqual(agent3[0][\u0027host\u0027], \u0027host-d\u0027)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9a80dd14_72c64a6a","line":428,"in_reply_to":"9a80dd14_d7a448bb","updated":"2015-03-17 10:38:18.000000000","message":"Agreed.","commit_id":"0742ce5913f5516e10044a495d1128d633ebbf29"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"b466c3415ec5eb9a1f3ed45500219f40d3ee015f","unresolved":false,"context_lines":[{"line_number":426,"context_line":"                                                              [\u00273333\u0027])"},{"line_number":427,"context_line":"        self.assertEqual(agent1[0][\u0027host\u0027], \u0027host-c\u0027)"},{"line_number":428,"context_line":"        self.assertEqual(agent2[0][\u0027host\u0027], \u0027host-c\u0027)"},{"line_number":429,"context_line":"        self.assertEqual(agent3[0][\u0027host\u0027], \u0027host-d\u0027)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9a80dd14_5790584e","line":429,"updated":"2015-03-17 10:24:51.000000000","message":"ditto","commit_id":"0742ce5913f5516e10044a495d1128d633ebbf29"},{"author":{"_account_id":11546,"name":"Praveen Kumar SM","email":"praveen-sm.kumar@hpe.com","username":"praveen-sm-kumar"},"change_message_id":"e1bddbd0197440b304f308f5e2ae76b4b7410c69","unresolved":false,"context_lines":[{"line_number":426,"context_line":"                                                              [\u00273333\u0027])"},{"line_number":427,"context_line":"        self.assertEqual(agent1[0][\u0027host\u0027], \u0027host-c\u0027)"},{"line_number":428,"context_line":"        self.assertEqual(agent2[0][\u0027host\u0027], \u0027host-c\u0027)"},{"line_number":429,"context_line":"        self.assertEqual(agent3[0][\u0027host\u0027], \u0027host-d\u0027)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9a80dd14_d2a456bb","line":429,"in_reply_to":"9a80dd14_5790584e","updated":"2015-03-17 10:38:18.000000000","message":"Agreed.","commit_id":"0742ce5913f5516e10044a495d1128d633ebbf29"}]}
