)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10601,"name":"Renjie Sun","email":"sunrenjie6@gmail.com","username":"sunrenjie6"},"change_message_id":"1f8b428861848d2aa7ee1e08e7ed00642cdd438c","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Sudhakar Babu Gariganti \u003csudhakar-babu.gariganti@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-06-19 18:10:12 +0530"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix for bug 1213394"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Networks which do not have any DHCP enabled subnets should not be"},{"line_number":10,"context_line":"hosted on any of the DHCP agents"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1ae5cdf2_901df475","line":7,"updated":"2014-06-19 13:36:08.000000000","message":"nit: would it be better if the 1st line of commit message (and hence the subject) is more descriptive?","commit_id":"e7a03947fe9e9fbc3882cef7566a8d9b44388318"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"905ae35b92717d08598e586c28dae298724daa34","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Sudhakar Babu Gariganti \u003csudhakar-babu.gariganti@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-06-19 18:10:12 +0530"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix for bug 1213394"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Networks which do not have any DHCP enabled subnets should not be"},{"line_number":10,"context_line":"hosted on any of the DHCP agents"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1ae5cdf2_0df62ad7","line":7,"in_reply_to":"1ae5cdf2_76186084","updated":"2014-06-19 15:05:04.000000000","message":"Will do.","commit_id":"e7a03947fe9e9fbc3882cef7566a8d9b44388318"},{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"18c4f94de4e15c50540ea5306dec8b514171c8a3","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Sudhakar Babu Gariganti \u003csudhakar-babu.gariganti@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-06-19 18:10:12 +0530"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix for bug 1213394"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Networks which do not have any DHCP enabled subnets should not be"},{"line_number":10,"context_line":"hosted on any of the DHCP agents"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1ae5cdf2_76186084","line":7,"in_reply_to":"1ae5cdf2_901df475","updated":"2014-06-19 14:26:42.000000000","message":"Yes, please use a more descriptive line here.\nhttp://docs.openstack.org/developer/hacking/#commit-messages\n[H801] The first line of the commit message should provide an accurate description of the change, not just a reference to a bug or blueprint.","commit_id":"e7a03947fe9e9fbc3882cef7566a8d9b44388318"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"39a296fa37c8cbcd5c377c8f262b57697eb72a26","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2014-06-19 17:46:59 +0530"},{"line_number":4,"context_line":"Commit:     Sudhakar Babu Gariganti \u003csudhakar-babu.gariganti@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-07-24 23:05:23 +0530"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Check subnet\u0027s DHCP before hosting networks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Networks which do not have any DHCP enabled subnets should not be"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"baada198_ba6e7f62","line":6,"updated":"2014-07-24 20:49:42.000000000","message":"tempest.api.network.admin.test_dhcp_agent_scheduler failed on the VMWare CI job but the same test succeeded at the gate, suggesting a possible race condition. Could I ask you to rerun the test locally a few times?","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"2e29125cce2bc1bbef562f67fe64d2877e0ce443","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2014-06-19 17:46:59 +0530"},{"line_number":4,"context_line":"Commit:     Sudhakar Babu Gariganti \u003csudhakar-babu.gariganti@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-07-24 23:05:23 +0530"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Check subnet\u0027s DHCP before hosting networks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Networks which do not have any DHCP enabled subnets should not be"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"baada198_f0c64b15","line":6,"in_reply_to":"baada198_ba6e7f62","updated":"2014-07-25 09:18:21.000000000","message":"From this link,\nhttp://208.91.1.172/logs/neutron/101197/6/414334/testr_results.html\n\ntest_hotplug _nic test is failing. \nAnd from the logs, looks like the nova client is not responding.","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1399bee36f7eaa4378df8bae48982de2ccc0ab44","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Check subnet\u0027s DHCP before hosting networks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Networks which do not have any DHCP enabled subnets should not be"},{"line_number":10,"context_line":"hosted on any of the DHCP agents"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Similarly if a subnet is updated for disabling DHCP, and if there are"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"baada198_35b1fc91","line":9,"updated":"2014-08-13 16:06:25.000000000","message":"is this a regression? I don\u0027t see that networks whose subnets have dhcp enabled get scheduled when they are created.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"503fe077719633100b615f81360936fb91cb43a5","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Check subnet\u0027s DHCP before hosting networks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Networks which do not have any DHCP enabled subnets should not be"},{"line_number":10,"context_line":"hosted on any of the DHCP agents"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Similarly if a subnet is updated for disabling DHCP, and if there are"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"7ac7a964_76e725e5","line":9,"in_reply_to":"7ac7a964_c0258f0b","updated":"2014-08-14 03:49:31.000000000","message":"One thing is invoking a scheduling decision, the other is mixing the logic with the notifier; that said, assumed I agreed with your statement, I wouldn\u0027t want to make the coupling even worse.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4d3fdb9d60aef04b53c95a9e93a5b55eec50fc80","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Check subnet\u0027s DHCP before hosting networks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Networks which do not have any DHCP enabled subnets should not be"},{"line_number":10,"context_line":"hosted on any of the DHCP agents"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Similarly if a subnet is updated for disabling DHCP, and if there are"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"baada198_23770390","line":9,"in_reply_to":"baada198_0dd07051","updated":"2014-08-13 17:53:14.000000000","message":"I agree with the cases; I am not agreeing with the proposed fix: you are mixing the notification and the scheduling logic.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"ced3add11f89173ee2e8cb53dc67dffd81eb2f83","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Check subnet\u0027s DHCP before hosting networks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Networks which do not have any DHCP enabled subnets should not be"},{"line_number":10,"context_line":"hosted on any of the DHCP agents"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Similarly if a subnet is updated for disabling DHCP, and if there are"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"7ac7a964_c0258f0b","line":9,"in_reply_to":"baada198_23770390","updated":"2014-08-14 02:12:15.000000000","message":"Scheduling decision is already being done in the very same _notify_agents method. This is not something I introduced newly with this patch. The new thing was to bring in DB calls here I guess. Did not realize it was that big a blunder.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"d488fcf8919f88b350ce24fb2b1b4d3812f1a009","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Check subnet\u0027s DHCP before hosting networks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Networks which do not have any DHCP enabled subnets should not be"},{"line_number":10,"context_line":"hosted on any of the DHCP agents"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Similarly if a subnet is updated for disabling DHCP, and if there are"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"baada198_0dd07051","line":9,"in_reply_to":"baada198_35b1fc91","updated":"2014-08-13 17:19:15.000000000","message":"The motive behind this patch is to fix the following bug:\nhttps://bugs.launchpad.net/neutron/+bug/1213394\n\nYou are correct. Network is not hosted to the agent immediately after subnet creation, be it with DHCP enabled or disabled. \n\nNetwork  is scheduled to a dhcp agent as soon as you create a port in that subnet. That makes sense when DHCP enabled, but when its not , why bother agents notifying them about this network?","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1399bee36f7eaa4378df8bae48982de2ccc0ab44","unresolved":false,"context_lines":[{"line_number":10,"context_line":"hosted on any of the DHCP agents"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Similarly if a subnet is updated for disabling DHCP, and if there are"},{"line_number":13,"context_line":"no other DHCP enabled subnets for that network, we can un-host the"},{"line_number":14,"context_line":"network"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I498d588c74e53b95413e33a6afb41cbbbc319448"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"baada198_d578c0c3","line":13,"updated":"2014-08-13 16:06:25.000000000","message":"that I appreciate, but there\u0027s no resource consumption as far as I can tell, so why are we doing this?","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"503fe077719633100b615f81360936fb91cb43a5","unresolved":false,"context_lines":[{"line_number":10,"context_line":"hosted on any of the DHCP agents"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Similarly if a subnet is updated for disabling DHCP, and if there are"},{"line_number":13,"context_line":"no other DHCP enabled subnets for that network, we can un-host the"},{"line_number":14,"context_line":"network"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I498d588c74e53b95413e33a6afb41cbbbc319448"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"7ac7a964_d6f47989","line":13,"in_reply_to":"7ac7a964_204643c0","updated":"2014-08-14 03:49:31.000000000","message":"agreed, but I\u0027d be happy to see the two changes side by side and make sure they merge right about the same time. Since we\u0027re running out of time for Juno I wonder whether we want to defer this fix. It depends on how confident you are in whipping the other fix together quickly","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"385e29193ff41830e0d12792583d59bfa7240899","unresolved":false,"context_lines":[{"line_number":10,"context_line":"hosted on any of the DHCP agents"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Similarly if a subnet is updated for disabling DHCP, and if there are"},{"line_number":13,"context_line":"no other DHCP enabled subnets for that network, we can un-host the"},{"line_number":14,"context_line":"network"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I498d588c74e53b95413e33a6afb41cbbbc319448"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"7ac7a964_9ad8511f","line":13,"in_reply_to":"7ac7a964_d6f47989","updated":"2014-08-14 13:26:44.000000000","message":"I did some testing with the router scheduling.  Here are few observations:\n\n1. Router is not being scheduling to an l3 agent immediately upon creation. Scheduling is done, only after we add a subnet interface. (This is a gap with the DHCP case, which the bug is raised for)\n\n2. After deleting all the router interfaces from the Router, the router is still bound to the l3 agent. We can think of cleaning up the binding, when the last router interface is deleted from the router.\n\nBut I am not sure if (l3 agent - router) binding holds the same weight as (dhcpagent- network) binding, so that we can just decide to clean it up. \nI feel so because, if the admin has an external gateway configured on a particular l3 agent and if he wants the router to be hosted only on that l3 agent, he can manually bind the router to this l3-agent. And if we are removing the binding based on the absence of router interfaces, he will be forced to add the binding again. Same point is valid for manual dhcpagent-networkbindings as well.\n\nTo overcome this, we need to check if the binding is added manually or assigned automatically.  As of now there is no way to know this, atleast I could not find from the model. Also, this check further complicates the patch and doesn\u0027t seem to be worth the benefits its bringing.\n\nRather I prefer to roll back the unscheduling network part of the patch, to prevent overriding any admin preferences.\n\nThoughts??","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"ced3add11f89173ee2e8cb53dc67dffd81eb2f83","unresolved":false,"context_lines":[{"line_number":10,"context_line":"hosted on any of the DHCP agents"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Similarly if a subnet is updated for disabling DHCP, and if there are"},{"line_number":13,"context_line":"no other DHCP enabled subnets for that network, we can un-host the"},{"line_number":14,"context_line":"network"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I498d588c74e53b95413e33a6afb41cbbbc319448"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"7ac7a964_204643c0","line":13,"in_reply_to":"baada198_03375fb0","updated":"2014-08-14 02:12:15.000000000","message":"Sure, why not, when it makes sense. But that can be a separate patch/bug.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"d488fcf8919f88b350ce24fb2b1b4d3812f1a009","unresolved":false,"context_lines":[{"line_number":10,"context_line":"hosted on any of the DHCP agents"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Similarly if a subnet is updated for disabling DHCP, and if there are"},{"line_number":13,"context_line":"no other DHCP enabled subnets for that network, we can un-host the"},{"line_number":14,"context_line":"network"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I498d588c74e53b95413e33a6afb41cbbbc319448"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"baada198_ede33c38","line":13,"in_reply_to":"baada198_d578c0c3","updated":"2014-08-13 17:19:15.000000000","message":"we are cleaning up the dnsmasq, tap ports, namespaces related to that network from the agent, but not the binding alone. Why leave traces?","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4d3fdb9d60aef04b53c95a9e93a5b55eec50fc80","unresolved":false,"context_lines":[{"line_number":10,"context_line":"hosted on any of the DHCP agents"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Similarly if a subnet is updated for disabling DHCP, and if there are"},{"line_number":13,"context_line":"no other DHCP enabled subnets for that network, we can un-host the"},{"line_number":14,"context_line":"network"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I498d588c74e53b95413e33a6afb41cbbbc319448"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"baada198_03375fb0","line":13,"in_reply_to":"baada198_ede33c38","updated":"2014-08-13 17:53:14.000000000","message":"So we should be doing something about routers too? I think the asymmetry in the behaviors for the l3 and dhcp agents can be confusing and may break existing tooling around out-of-band agent management.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"3973b1b7f0053b2582788da4e46f26d7d0a82bd0","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Networks which do not have any DHCP enabled subnets should not be"},{"line_number":10,"context_line":"hosted on any of the DHCP agents"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"But if a subnet is updated to DHCP OFF, and if there are"},{"line_number":13,"context_line":"no other DHCP enabled subnets for that network, we may un-host the"},{"line_number":14,"context_line":"network, but rolled back those code changes considering the case"},{"line_number":15,"context_line":"of overiding manual network \u003c--\u003e dhcpagent binding."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"baa201ad_965cac4e","line":12,"updated":"2014-10-09 12:46:02.000000000","message":"Sorry, I\u0027m having trouble following this sentence. It\u0027s long and has some double negatives, so I\u0027m a bit confused as the intent. Can you clarify?\n\nIs the intent something like...\n\n\"Note: Will not un-host, If a subnet is updated to DHCP OFF and there are no other DHCP enabled subnets for the network. This handles the cases where an overridden manual network is changed to have DHCP agent binding or vice versa.\"","commit_id":"49bfc75a5c9a96eaab213e99277084fdb2ab38e3"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"04d369b7d73383ff3df5b655630b674fbbb6b1d8","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Networks which do not have any DHCP enabled subnets should not be"},{"line_number":10,"context_line":"hosted on any of the DHCP agents"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"But if a subnet is updated to DHCP OFF, and if there are"},{"line_number":13,"context_line":"no other DHCP enabled subnets for that network, we may un-host the"},{"line_number":14,"context_line":"network, but rolled back those code changes considering the case"},{"line_number":15,"context_line":"of overiding manual network \u003c--\u003e dhcpagent binding."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"baa201ad_b0528d66","line":12,"in_reply_to":"baa201ad_965cac4e","updated":"2014-10-09 16:52:01.000000000","message":"Sorry for the confusion. Let me clarify.\n\nIn earlier patches, we had code to explicitly unhost a network, which no longer has any DHCP enabled subnets. This can happen mostly during delete/update usecases. But this change can eventually lead to removing the admin assigned \"dhcp agent to network\" bindings as well, which I felt is not the correct thing to do. \n\nHence I rolled back those changes. Please have a look at the comments on patch 16 which pushed me this way.\n\nWill update the commit message anyways.","commit_id":"49bfc75a5c9a96eaab213e99277084fdb2ab38e3"}],"neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"59e312149a9525e8eb5c28bd5d6652fbafec3d01","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        super(DhcpAgentNotifyAPI, self).__init__("},{"line_number":45,"context_line":"            topic\u003dtopic, default_version\u003dself.BASE_RPC_API_VERSION)"},{"line_number":46,"context_line":"        self._plugin \u003d plugin"},{"line_number":47,"context_line":"        self._networks_to_unschedule \u003d []"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    @property"},{"line_number":50,"context_line":"    def plugin(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_5698c474","line":47,"updated":"2014-06-19 14:05:57.000000000","message":"i failed to understand why this need to be kept here.\ncan you explain the algorithm?","commit_id":"e7a03947fe9e9fbc3882cef7566a8d9b44388318"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"0e0ec55b3aacf39e3e846cbde411c0aee82d4c98","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        super(DhcpAgentNotifyAPI, self).__init__("},{"line_number":45,"context_line":"            topic\u003dtopic, default_version\u003dself.BASE_RPC_API_VERSION)"},{"line_number":46,"context_line":"        self._plugin \u003d plugin"},{"line_number":47,"context_line":"        self._networks_to_unschedule \u003d []"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    @property"},{"line_number":50,"context_line":"    def plugin(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_2094bb35","line":47,"in_reply_to":"1ae5cdf2_0acb7072","updated":"2014-06-20 01:31:34.000000000","message":"can\u0027t you get the same info by querying db?","commit_id":"e7a03947fe9e9fbc3882cef7566a8d9b44388318"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"905ae35b92717d08598e586c28dae298724daa34","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        super(DhcpAgentNotifyAPI, self).__init__("},{"line_number":45,"context_line":"            topic\u003dtopic, default_version\u003dself.BASE_RPC_API_VERSION)"},{"line_number":46,"context_line":"        self._plugin \u003d plugin"},{"line_number":47,"context_line":"        self._networks_to_unschedule \u003d []"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    @property"},{"line_number":50,"context_line":"    def plugin(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_0acb7072","line":47,"in_reply_to":"1ae5cdf2_5698c474","updated":"2014-06-19 15:05:04.000000000","message":"This is required to handle a multi-threaded neutron environment. If there are multiple notify calls coming simultaneously which will result in more than one network to be unhosted, I am using this list to keep track of the networks to be unhosted and in the subsequent _notify_agents call, check for the particular network id.","commit_id":"e7a03947fe9e9fbc3882cef7566a8d9b44388318"},{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"18c4f94de4e15c50540ea5306dec8b514171c8a3","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        count \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":107,"context_line":"                                       enable_dhcp\u003dTrue).count()"},{"line_number":108,"context_line":"        if count \u003e 0:"},{"line_number":109,"context_line":"            return True"},{"line_number":110,"context_line":"        else:"},{"line_number":111,"context_line":"            if not method_name.endswith(\".create.end\"):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_2a5e6c13","line":108,"updated":"2014-06-19 14:26:42.000000000","message":"How about this:\n\nif count:\n   return True\nif not method_name.endswith(\".create.end\"):\n....","commit_id":"e7a03947fe9e9fbc3882cef7566a8d9b44388318"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"905ae35b92717d08598e586c28dae298724daa34","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        count \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":107,"context_line":"                                       enable_dhcp\u003dTrue).count()"},{"line_number":108,"context_line":"        if count \u003e 0:"},{"line_number":109,"context_line":"            return True"},{"line_number":110,"context_line":"        else:"},{"line_number":111,"context_line":"            if not method_name.endswith(\".create.end\"):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_ca834801","line":108,"in_reply_to":"1ae5cdf2_2a5e6c13","updated":"2014-06-19 15:05:04.000000000","message":"Makes sense. Will do. Thanks","commit_id":"e7a03947fe9e9fbc3882cef7566a8d9b44388318"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"4c3bd9e266f7482a7d4f3b7b6f03acee4fe1b337","unresolved":false,"context_lines":[{"line_number":200,"context_line":"            LOG.info(_(\"No subnets exists with DHCP enabled for the\""},{"line_number":201,"context_line":"                       \" network %s. Skipping notification to agents\"),"},{"line_number":202,"context_line":"                     network_id)"},{"line_number":203,"context_line":"            return True"},{"line_number":204,"context_line":"        method_name \u003d method_name.replace(\".\", \"_\")"},{"line_number":205,"context_line":"        if method_name.endswith(\"_delete_end\"):"},{"line_number":206,"context_line":"            if \u0027id\u0027 in obj_value:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_812d4c00","line":203,"updated":"2014-06-23 15:26:40.000000000","message":"The method does not expect to return True/False. e.g., lines 187, 190 and 198","commit_id":"01ca2af473c2fa2cc17a86fdada0830792d78579"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"8fb511787f68653b84355a1941d6a8ef77740a75","unresolved":false,"context_lines":[{"line_number":200,"context_line":"            LOG.info(_(\"No subnets exists with DHCP enabled for the\""},{"line_number":201,"context_line":"                       \" network %s. Skipping notification to agents\"),"},{"line_number":202,"context_line":"                     network_id)"},{"line_number":203,"context_line":"            return True"},{"line_number":204,"context_line":"        method_name \u003d method_name.replace(\".\", \"_\")"},{"line_number":205,"context_line":"        if method_name.endswith(\"_delete_end\"):"},{"line_number":206,"context_line":"            if \u0027id\u0027 in obj_value:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_dcd9f785","line":203,"in_reply_to":"1ae5cdf2_812d4c00","updated":"2014-06-23 15:48:29.000000000","message":"empty return ~\u003d return None\nAbove cases are all error cases, hence a return value of None is \nbeing sent. However, here we do not want to throw error, we want to gracefully end the notify call. Hence I am returning True.","commit_id":"01ca2af473c2fa2cc17a86fdada0830792d78579"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"18f22f75773b684000d1c67bdb9f7bb43f410914","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def __init__(self, topic\u003dtopics.DHCP_AGENT, plugin\u003dNone):"},{"line_number":44,"context_line":"        super(DhcpAgentNotifyAPI, self).__init__("},{"line_number":45,"context_line":"            topic\u003dtopic, default_version\u003dself.BASE_RPC_API_VERSION)"},{"line_number":46,"context_line":"        self._plugin \u003d plugin"},{"line_number":47,"context_line":"        self._networks_to_unschedule \u003d []"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_1f51f961","line":46,"updated":"2014-07-20 16:11:35.000000000","message":"This could be changed into a set to optimize the code a bit.","commit_id":"75e03caa1fe536b6ec2d64d7303dbb570ee89cea"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"72a07d042c0e9a9d163c1ca122cd0054998cc428","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def __init__(self, topic\u003dtopics.DHCP_AGENT, plugin\u003dNone):"},{"line_number":44,"context_line":"        super(DhcpAgentNotifyAPI, self).__init__("},{"line_number":45,"context_line":"            topic\u003dtopic, default_version\u003dself.BASE_RPC_API_VERSION)"},{"line_number":46,"context_line":"        self._plugin \u003d plugin"},{"line_number":47,"context_line":"        self._networks_to_unschedule \u003d []"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_aaac4d89","line":46,"in_reply_to":"baada198_1f51f961","updated":"2014-07-20 17:42:59.000000000","message":"Will do.","commit_id":"75e03caa1fe536b6ec2d64d7303dbb570ee89cea"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"18f22f75773b684000d1c67bdb9f7bb43f410914","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            schedule_required \u003d method \u003d\u003d \u0027port_create_end\u0027"},{"line_number":139,"context_line":"            if schedule_required:"},{"line_number":140,"context_line":"                agents \u003d self._schedule_network(admin_ctx, network, agents)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"            unschedule_required \u003d network_id in self._networks_to_unschedule"},{"line_number":143,"context_line":"            if unschedule_required:"},{"line_number":144,"context_line":"                self._networks_to_unschedule.remove(network_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_9f36e901","line":141,"updated":"2014-07-20 16:11:35.000000000","message":"I feel like I\u0027m missing something but couldn\u0027t you remove self._networks_to_unschedule, remove the call to _check_subnets_with_dhcp from notify, move it to here, and have that method just return True/False? Then you know if to call remove_network_from_dhcp_agent or not. This will simplify the patch in a non-trivial way I think. If this wouldn\u0027t work could you please explain why?","commit_id":"75e03caa1fe536b6ec2d64d7303dbb570ee89cea"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"72a07d042c0e9a9d163c1ca122cd0054998cc428","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            schedule_required \u003d method \u003d\u003d \u0027port_create_end\u0027"},{"line_number":139,"context_line":"            if schedule_required:"},{"line_number":140,"context_line":"                agents \u003d self._schedule_network(admin_ctx, network, agents)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"            unschedule_required \u003d network_id in self._networks_to_unschedule"},{"line_number":143,"context_line":"            if unschedule_required:"},{"line_number":144,"context_line":"                self._networks_to_unschedule.remove(network_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_eadac5e7","line":141,"in_reply_to":"baada198_9f36e901","updated":"2014-07-20 17:42:59.000000000","message":"The intent of having _check_subnets_with_dhcp method in notify rather than in _notify_agents, was to prevent notifications to agents in cases(mainly create calls) where not required.\nWe will not have to go through all this code in such scenarios right?\n\nBut in case of update/delete calls we need to notify the agents appropriately.  So I saw the need to introduce the _networks_to_unschedule variable. \n\nLet me know if I am doing it wrong :)","commit_id":"75e03caa1fe536b6ec2d64d7303dbb570ee89cea"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"20291394742db5f41cd1c44258e4ebe072f5269b","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            schedule_required \u003d method \u003d\u003d \u0027port_create_end\u0027"},{"line_number":139,"context_line":"            if schedule_required:"},{"line_number":140,"context_line":"                agents \u003d self._schedule_network(admin_ctx, network, agents)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"            unschedule_required \u003d network_id in self._networks_to_unschedule"},{"line_number":143,"context_line":"            if unschedule_required:"},{"line_number":144,"context_line":"                self._networks_to_unschedule.remove(network_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_588e6433","line":141,"in_reply_to":"baada198_c1ce8a82","updated":"2014-07-24 11:35:47.000000000","message":"Posted the updated code.\nI have tested the network delete scenario and the behavior is as expected.\nConfirmed the subnet-update and subnet-delete scenarios as well.\n\nPlease do review the latest patch  and let me know your comments :)","commit_id":"75e03caa1fe536b6ec2d64d7303dbb570ee89cea"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"3a3618eb650abbeb3c8fd2c9d563660ee4eceabf","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            schedule_required \u003d method \u003d\u003d \u0027port_create_end\u0027"},{"line_number":139,"context_line":"            if schedule_required:"},{"line_number":140,"context_line":"                agents \u003d self._schedule_network(admin_ctx, network, agents)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"            unschedule_required \u003d network_id in self._networks_to_unschedule"},{"line_number":143,"context_line":"            if unschedule_required:"},{"line_number":144,"context_line":"                self._networks_to_unschedule.remove(network_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_c1ce8a82","line":141,"in_reply_to":"baada198_d9194f89","updated":"2014-07-22 05:16:54.000000000","message":"Thanks a lot for the detailed explanation Assaf. I now see  the point you are making. I will re-factor the code and post a new patch asap.\n\nOn the testing front, I have tested the subnet update scenarios and saw the expected behavior. \nI will get back on the network delete scenario. I saw no issues here as well, but will test again and confirm.","commit_id":"75e03caa1fe536b6ec2d64d7303dbb570ee89cea"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"8ae2cd7d92ad30db22d4d1c2b4e215fe86777779","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            schedule_required \u003d method \u003d\u003d \u0027port_create_end\u0027"},{"line_number":139,"context_line":"            if schedule_required:"},{"line_number":140,"context_line":"                agents \u003d self._schedule_network(admin_ctx, network, agents)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"            unschedule_required \u003d network_id in self._networks_to_unschedule"},{"line_number":143,"context_line":"            if unschedule_required:"},{"line_number":144,"context_line":"                self._networks_to_unschedule.remove(network_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_d9194f89","line":141,"in_reply_to":"baada198_eadac5e7","updated":"2014-07-21 11:14:23.000000000","message":"There\u0027s several issues as I see it:\n1) _check_subnets_with_dhcp does more than one thing: It checks if there\u0027s subnets with DHCP on a network, and appends the network to a list in a certain case. I\u0027d split it so that _check_subnets_with_dhcp only returns True if the network has DHCP subnets, otherwise False. \n\n2) You use _check_subnets_with_dhcp in notify which forces you to pass information into _notify_agents (You did it with an internal list, you could have also done it by passing parameters into _notify_agents). Here I think the solution is to to simply use _check_subnets_with_dhcp in _notify_agents.\n\nNow that _check_subnets_with_dhcp only returns True/False and you use it directly in _notify_agents: You can call the function, and if it\u0027s False and the method is create, you can return from _notify_agents and not proceed. Otherwise, if the method is remove or update, you can unschedule the network.\n\nI\u0027m curious what other people will think about explicitly calling self.plugin.remove_network_from_dhcp_agent, but let\u0027s leave that in for now. Have you tested what happens if you delete a network then call self.plugin.remove_network_from_dhcp_agent? For example, It will cause two delete.network.end notifications about the same network (The one we\u0027re sending right now + Another notification sent from remove_network_from_dhcp_agent). Also, have you tested the case where a network with a DHCP subnet is updated so that the subnet is removed or the DHCP is disabled, causing this code to unschedule the network from the agent, then updating the network again with a DHCP subnet? Will the network be rescheduled?\n\nRegardless of my queries about self.plugin.remove_network_from_dhcp_agent you can refactor the code according to what I wrote in the first 3 paragraphs - I think it\u0027ll greatly simplify the code. What do you think?","commit_id":"75e03caa1fe536b6ec2d64d7303dbb570ee89cea"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"18f22f75773b684000d1c67bdb9f7bb43f410914","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            network_id \u003d obj_value[\u0027network_id\u0027]"},{"line_number":199,"context_line":"        if not network_id:"},{"line_number":200,"context_line":"            return"},{"line_number":201,"context_line":"        if not self._check_subnets_with_dhcp(context, network_id, method_name):"},{"line_number":202,"context_line":"            LOG.info(_(\"No subnets exists with DHCP enabled for the\""},{"line_number":203,"context_line":"                       \" network %s. Skipping notification to agents\"),"},{"line_number":204,"context_line":"                     network_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_ffafe528","line":201,"updated":"2014-07-20 16:11:35.000000000","message":"exists -\u003e exist\n\nDrop the \"the\" at the end of the first line","commit_id":"75e03caa1fe536b6ec2d64d7303dbb570ee89cea"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"72a07d042c0e9a9d163c1ca122cd0054998cc428","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            network_id \u003d obj_value[\u0027network_id\u0027]"},{"line_number":199,"context_line":"        if not network_id:"},{"line_number":200,"context_line":"            return"},{"line_number":201,"context_line":"        if not self._check_subnets_with_dhcp(context, network_id, method_name):"},{"line_number":202,"context_line":"            LOG.info(_(\"No subnets exists with DHCP enabled for the\""},{"line_number":203,"context_line":"                       \" network %s. Skipping notification to agents\"),"},{"line_number":204,"context_line":"                     network_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_6aeeb58c","line":201,"in_reply_to":"baada198_ffafe528","updated":"2014-07-20 17:42:59.000000000","message":"will do..","commit_id":"75e03caa1fe536b6ec2d64d7303dbb570ee89cea"},{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"b01c127187e8e11886abf17919f309fd39d011ac","unresolved":false,"context_lines":[{"line_number":97,"context_line":"                             \u0027payload\u0027: payload})"},{"line_number":98,"context_line":"        return enabled_agents"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def _check_subnets_with_dhcp(self, context, network_id, method_name):"},{"line_number":101,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":102,"context_line":"           Based on the return value we can decide to skip scheduling"},{"line_number":103,"context_line":"           the network"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_58f520c9","line":100,"updated":"2014-07-21 20:49:32.000000000","message":"This should be broken in to two parts.\u003d as it is doing more that checking is subnets have dhcp.","commit_id":"797832b691589b57e18265d477af7d1cfe2a8c05"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"868975ab4b176acddb52460addde8aef17caa217","unresolved":false,"context_lines":[{"line_number":97,"context_line":"                             \u0027payload\u0027: payload})"},{"line_number":98,"context_line":"        return enabled_agents"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def _check_subnets_with_dhcp(self, context, network_id, method_name):"},{"line_number":101,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":102,"context_line":"           Based on the return value we can decide to skip scheduling"},{"line_number":103,"context_line":"           the network"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_21a5869e","line":100,"in_reply_to":"baada198_58f520c9","updated":"2014-07-24 11:36:51.000000000","message":"Thanks for comment. Assaf also in his earlier review expressed similar concern. Refactored the code appropriately","commit_id":"797832b691589b57e18265d477af7d1cfe2a8c05"},{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"b01c127187e8e11886abf17919f309fd39d011ac","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                LOG.info(_(\"Marking network: %s to get unhosted later\"),"},{"line_number":114,"context_line":"                         network_id)"},{"line_number":115,"context_line":"            return True"},{"line_number":116,"context_line":"        return False"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":119,"context_line":"        \"\"\"Notify all the agents that are hosting the network.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_18580830","line":116,"updated":"2014-07-21 20:49:32.000000000","message":"Last line not necessary","commit_id":"797832b691589b57e18265d477af7d1cfe2a8c05"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"868975ab4b176acddb52460addde8aef17caa217","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                LOG.info(_(\"Marking network: %s to get unhosted later\"),"},{"line_number":114,"context_line":"                         network_id)"},{"line_number":115,"context_line":"            return True"},{"line_number":116,"context_line":"        return False"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":119,"context_line":"        \"\"\"Notify all the agents that are hosting the network.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_a1b0b6dc","line":116,"in_reply_to":"baada198_18580830","updated":"2014-07-24 11:36:51.000000000","message":"Done","commit_id":"797832b691589b57e18265d477af7d1cfe2a8c05"},{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"b01c127187e8e11886abf17919f309fd39d011ac","unresolved":false,"context_lines":[{"line_number":202,"context_line":"            LOG.info(_(\"No subnets exist with DHCP enabled for\""},{"line_number":203,"context_line":"                       \" network %s. Skipping notification to agents\"),"},{"line_number":204,"context_line":"                     network_id)"},{"line_number":205,"context_line":"            return True"},{"line_number":206,"context_line":"        method_name \u003d method_name.replace(\".\", \"_\")"},{"line_number":207,"context_line":"        if method_name.endswith(\"_delete_end\"):"},{"line_number":208,"context_line":"            if \u0027id\u0027 in obj_value:"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_38cf8c80","line":205,"updated":"2014-07-21 20:49:32.000000000","message":"Why True?","commit_id":"797832b691589b57e18265d477af7d1cfe2a8c05"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"868975ab4b176acddb52460addde8aef17caa217","unresolved":false,"context_lines":[{"line_number":202,"context_line":"            LOG.info(_(\"No subnets exist with DHCP enabled for\""},{"line_number":203,"context_line":"                       \" network %s. Skipping notification to agents\"),"},{"line_number":204,"context_line":"                     network_id)"},{"line_number":205,"context_line":"            return True"},{"line_number":206,"context_line":"        method_name \u003d method_name.replace(\".\", \"_\")"},{"line_number":207,"context_line":"        if method_name.endswith(\"_delete_end\"):"},{"line_number":208,"context_line":"            if \u0027id\u0027 in obj_value:"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_6164de48","line":205,"in_reply_to":"baada198_38cf8c80","updated":"2014-07-24 11:36:51.000000000","message":"I thought we need to return gracefully here as this is not an error. We are just preventing further code from getting excited as its not required in this case.\nCode is refactored now. \n\nPlease do review the latest patch  as possible. :)","commit_id":"797832b691589b57e18265d477af7d1cfe2a8c05"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f9f33800bd25045f68753489e84bff595f98183","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                             \u0027payload\u0027: payload})"},{"line_number":97,"context_line":"        return enabled_agents"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _check_subnets_with_dhcp(self, context, network_id, method_name):"},{"line_number":100,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":101,"context_line":"           Based on the return value we can decide to skip scheduling"},{"line_number":102,"context_line":"           the network"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_abe1e5d1","line":99,"updated":"2014-07-24 15:22:39.000000000","message":"You can make this a static method.","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"3ca1992c85096439a44507f30d074642eda46454","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                             \u0027payload\u0027: payload})"},{"line_number":97,"context_line":"        return enabled_agents"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _check_subnets_with_dhcp(self, context, network_id, method_name):"},{"line_number":100,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":101,"context_line":"           Based on the return value we can decide to skip scheduling"},{"line_number":102,"context_line":"           the network"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_da033374","line":99,"in_reply_to":"baada198_321ffd0a","updated":"2014-07-24 20:41:30.000000000","message":"It\u0027s more readable since you immediately know that the function isn\u0027t dependent on the state of the class instance.","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"6d4103d4f6d9a851fbaa36d02906355c1f036f1f","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                             \u0027payload\u0027: payload})"},{"line_number":97,"context_line":"        return enabled_agents"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _check_subnets_with_dhcp(self, context, network_id, method_name):"},{"line_number":100,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":101,"context_line":"           Based on the return value we can decide to skip scheduling"},{"line_number":102,"context_line":"           the network"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_321ffd0a","line":99,"in_reply_to":"baada198_abe1e5d1","updated":"2014-07-24 17:37:45.000000000","message":"made it static ..but can you please help me undestand the advantage this change brings in??","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f9f33800bd25045f68753489e84bff595f98183","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    def _check_subnets_with_dhcp(self, context, network_id, method_name):"},{"line_number":100,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":101,"context_line":"           Based on the return value we can decide to skip scheduling"},{"line_number":102,"context_line":"           the network"},{"line_number":103,"context_line":"        \"\"\""},{"line_number":104,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":105,"context_line":"        count \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_0b3e5129","line":102,"updated":"2014-07-24 15:22:39.000000000","message":"Nit: end docstring with a period.","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"6d4103d4f6d9a851fbaa36d02906355c1f036f1f","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    def _check_subnets_with_dhcp(self, context, network_id, method_name):"},{"line_number":100,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":101,"context_line":"           Based on the return value we can decide to skip scheduling"},{"line_number":102,"context_line":"           the network"},{"line_number":103,"context_line":"        \"\"\""},{"line_number":104,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":105,"context_line":"        count \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_bd35a3f8","line":102,"in_reply_to":"baada198_0b3e5129","updated":"2014-07-24 17:37:45.000000000","message":"Done","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f9f33800bd25045f68753489e84bff595f98183","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":105,"context_line":"        count \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":106,"context_line":"                                       enable_dhcp\u003dTrue).count()"},{"line_number":107,"context_line":"        return True if count \u003e 0 else False"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":110,"context_line":"        \"\"\"Notify all the agents that are hosting the network.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_cbc53991","line":107,"updated":"2014-07-24 15:22:39.000000000","message":"This can be just\n\n  return count \u003e 0","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"6d4103d4f6d9a851fbaa36d02906355c1f036f1f","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":105,"context_line":"        count \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":106,"context_line":"                                       enable_dhcp\u003dTrue).count()"},{"line_number":107,"context_line":"        return True if count \u003e 0 else False"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":110,"context_line":"        \"\"\"Notify all the agents that are hosting the network.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_5d2ac791","line":107,"in_reply_to":"baada198_cbc53991","updated":"2014-07-24 17:37:45.000000000","message":"Done","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f9f33800bd25045f68753489e84bff595f98183","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":110,"context_line":"        \"\"\"Notify all the agents that are hosting the network.\"\"\""},{"line_number":111,"context_line":"        #Check if the networks have any DHCP enabled subnets before"},{"line_number":112,"context_line":"        # proceeding to notify agents."},{"line_number":113,"context_line":"        _unschedule_network \u003d False"},{"line_number":114,"context_line":"        if not self._check_subnets_with_dhcp(context, network_id, method):"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_4b5049d5","line":111,"updated":"2014-07-24 15:22:39.000000000","message":"Add a blank line after the docstring to distinguish this comment from it. Also insert a space after #.","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"6d4103d4f6d9a851fbaa36d02906355c1f036f1f","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":110,"context_line":"        \"\"\"Notify all the agents that are hosting the network.\"\"\""},{"line_number":111,"context_line":"        #Check if the networks have any DHCP enabled subnets before"},{"line_number":112,"context_line":"        # proceeding to notify agents."},{"line_number":113,"context_line":"        _unschedule_network \u003d False"},{"line_number":114,"context_line":"        if not self._check_subnets_with_dhcp(context, network_id, method):"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_cf78de91","line":111,"in_reply_to":"baada198_4b5049d5","updated":"2014-07-24 17:37:45.000000000","message":"Done","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f9f33800bd25045f68753489e84bff595f98183","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        \"\"\"Notify all the agents that are hosting the network.\"\"\""},{"line_number":111,"context_line":"        #Check if the networks have any DHCP enabled subnets before"},{"line_number":112,"context_line":"        # proceeding to notify agents."},{"line_number":113,"context_line":"        _unschedule_network \u003d False"},{"line_number":114,"context_line":"        if not self._check_subnets_with_dhcp(context, network_id, method):"},{"line_number":115,"context_line":"            LOG.info(_(\"No subnets exist with DHCP enabled, for\""},{"line_number":116,"context_line":"                       \" network %s\"), network_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_6ba50d9e","line":113,"updated":"2014-07-24 15:22:39.000000000","message":"This is just a regular local variable. It\u0027s name should not start with an underscore.","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"6d4103d4f6d9a851fbaa36d02906355c1f036f1f","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        \"\"\"Notify all the agents that are hosting the network.\"\"\""},{"line_number":111,"context_line":"        #Check if the networks have any DHCP enabled subnets before"},{"line_number":112,"context_line":"        # proceeding to notify agents."},{"line_number":113,"context_line":"        _unschedule_network \u003d False"},{"line_number":114,"context_line":"        if not self._check_subnets_with_dhcp(context, network_id, method):"},{"line_number":115,"context_line":"            LOG.info(_(\"No subnets exist with DHCP enabled, for\""},{"line_number":116,"context_line":"                       \" network %s\"), network_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_6fe27231","line":113,"in_reply_to":"baada198_6ba50d9e","updated":"2014-07-24 17:37:45.000000000","message":"Done","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f9f33800bd25045f68753489e84bff595f98183","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        _unschedule_network \u003d False"},{"line_number":114,"context_line":"        if not self._check_subnets_with_dhcp(context, network_id, method):"},{"line_number":115,"context_line":"            LOG.info(_(\"No subnets exist with DHCP enabled, for\""},{"line_number":116,"context_line":"                       \" network %s\"), network_id)"},{"line_number":117,"context_line":"            if not method.endswith(\".create.end\"):"},{"line_number":118,"context_line":"                LOG.debug(\"Marking network: %s to be unhosted later\","},{"line_number":119,"context_line":"                          network_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_eb9f5d00","line":116,"updated":"2014-07-24 15:22:39.000000000","message":"Can you change message to \"Network %s has no subnets with DHCP enabled.\"","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"6d4103d4f6d9a851fbaa36d02906355c1f036f1f","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        _unschedule_network \u003d False"},{"line_number":114,"context_line":"        if not self._check_subnets_with_dhcp(context, network_id, method):"},{"line_number":115,"context_line":"            LOG.info(_(\"No subnets exist with DHCP enabled, for\""},{"line_number":116,"context_line":"                       \" network %s\"), network_id)"},{"line_number":117,"context_line":"            if not method.endswith(\".create.end\"):"},{"line_number":118,"context_line":"                LOG.debug(\"Marking network: %s to be unhosted later\","},{"line_number":119,"context_line":"                          network_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_af2baa31","line":116,"in_reply_to":"baada198_eb9f5d00","updated":"2014-07-24 17:37:45.000000000","message":"Done","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f9f33800bd25045f68753489e84bff595f98183","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                    context, method, payload, agent.host, agent.topic)"},{"line_number":150,"context_line":"                if _unschedule_network:"},{"line_number":151,"context_line":"                    LOG.info(_(\"Unhosting the network: %(net_id)s from \""},{"line_number":152,"context_line":"                               \"agent: %(agt_id)s\")"},{"line_number":153,"context_line":"                             % {\u0027net_id\u0027: network_id,"},{"line_number":154,"context_line":"                                \u0027agt_id\u0027: agent[\u0027id\u0027]})"},{"line_number":155,"context_line":"                    self.plugin.remove_network_from_dhcp_agent(admin_ctx,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_0e4adf26","line":152,"updated":"2014-07-24 15:22:39.000000000","message":"Nit: remove \u0027the\u0027 and colons.","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"6d4103d4f6d9a851fbaa36d02906355c1f036f1f","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                    context, method, payload, agent.host, agent.topic)"},{"line_number":150,"context_line":"                if _unschedule_network:"},{"line_number":151,"context_line":"                    LOG.info(_(\"Unhosting the network: %(net_id)s from \""},{"line_number":152,"context_line":"                               \"agent: %(agt_id)s\")"},{"line_number":153,"context_line":"                             % {\u0027net_id\u0027: network_id,"},{"line_number":154,"context_line":"                                \u0027agt_id\u0027: agent[\u0027id\u0027]})"},{"line_number":155,"context_line":"                    self.plugin.remove_network_from_dhcp_agent(admin_ctx,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_4f1cce13","line":152,"in_reply_to":"baada198_0e4adf26","updated":"2014-07-24 17:37:45.000000000","message":"Done","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"39a296fa37c8cbcd5c377c8f262b57697eb72a26","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                             \u0027payload\u0027: payload})"},{"line_number":97,"context_line":"        return enabled_agents"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def check_subnets_with_dhcp(context, network_id, method_name):"},{"line_number":101,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":102,"context_line":"           Based on the return value we can decide to skip scheduling"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_babcbfb6","line":99,"updated":"2014-07-24 20:49:42.000000000","message":"method_name is unused in this function.","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"2e29125cce2bc1bbef562f67fe64d2877e0ce443","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                             \u0027payload\u0027: payload})"},{"line_number":97,"context_line":"        return enabled_agents"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def check_subnets_with_dhcp(context, network_id, method_name):"},{"line_number":101,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":102,"context_line":"           Based on the return value we can decide to skip scheduling"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_f02acbe5","line":99,"in_reply_to":"baada198_babcbfb6","updated":"2014-07-25 09:18:21.000000000","message":"Done","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"39a296fa37c8cbcd5c377c8f262b57697eb72a26","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        # Check if the networks have any DHCP enabled subnets before"},{"line_number":115,"context_line":"        # proceeding to notify agents."},{"line_number":116,"context_line":"        unschedule_network \u003d False"},{"line_number":117,"context_line":"        if not self.check_subnets_with_dhcp(context, network_id, method):"},{"line_number":118,"context_line":"            LOG.info(_(\"Network %s has no subnets with DHCP enabled\"),"},{"line_number":119,"context_line":"                     network_id)"},{"line_number":120,"context_line":"            if not method.endswith(\".create.end\"):"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_dabb3373","line":117,"updated":"2014-07-24 20:49:42.000000000","message":"What is the value of this log message?","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"2e29125cce2bc1bbef562f67fe64d2877e0ce443","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        # Check if the networks have any DHCP enabled subnets before"},{"line_number":115,"context_line":"        # proceeding to notify agents."},{"line_number":116,"context_line":"        unschedule_network \u003d False"},{"line_number":117,"context_line":"        if not self.check_subnets_with_dhcp(context, network_id, method):"},{"line_number":118,"context_line":"            LOG.info(_(\"Network %s has no subnets with DHCP enabled\"),"},{"line_number":119,"context_line":"                     network_id)"},{"line_number":120,"context_line":"            if not method.endswith(\".create.end\"):"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_10c1ffe3","line":117,"in_reply_to":"baada198_dabb3373","updated":"2014-07-25 09:18:21.000000000","message":"Made it a debug. Just to keep track of the flow.","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"39a296fa37c8cbcd5c377c8f262b57697eb72a26","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        unschedule_network \u003d False"},{"line_number":117,"context_line":"        if not self.check_subnets_with_dhcp(context, network_id, method):"},{"line_number":118,"context_line":"            LOG.info(_(\"Network %s has no subnets with DHCP enabled\"),"},{"line_number":119,"context_line":"                     network_id)"},{"line_number":120,"context_line":"            if not method.endswith(\".create.end\"):"},{"line_number":121,"context_line":"                LOG.debug(\"Marking network: %s to be unhosted later\","},{"line_number":122,"context_line":"                          network_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_5a8803c6","line":119,"updated":"2014-07-24 20:49:42.000000000","message":"So, why do you want to un-schedule in the case of a delete?\n\nIn the case of an update it\u0027s clear, but if you delete then the agent will get the delete notification anyway.","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"2e29125cce2bc1bbef562f67fe64d2877e0ce443","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        unschedule_network \u003d False"},{"line_number":117,"context_line":"        if not self.check_subnets_with_dhcp(context, network_id, method):"},{"line_number":118,"context_line":"            LOG.info(_(\"Network %s has no subnets with DHCP enabled\"),"},{"line_number":119,"context_line":"                     network_id)"},{"line_number":120,"context_line":"            if not method.endswith(\".create.end\"):"},{"line_number":121,"context_line":"                LOG.debug(\"Marking network: %s to be unhosted later\","},{"line_number":122,"context_line":"                          network_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_7076bbd9","line":119,"in_reply_to":"baada198_5a8803c6","updated":"2014-07-25 09:18:21.000000000","message":"When the method is network_delete , we are anyways doing a fanout and this unscheduling code will not get excited at all.\nIn case of subnet_delete, the DHCP agent will still be mapped to the network, which is not required.So, we need to unschedule the network explicitly","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"39a296fa37c8cbcd5c377c8f262b57697eb72a26","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        if not self.check_subnets_with_dhcp(context, network_id, method):"},{"line_number":118,"context_line":"            LOG.info(_(\"Network %s has no subnets with DHCP enabled\"),"},{"line_number":119,"context_line":"                     network_id)"},{"line_number":120,"context_line":"            if not method.endswith(\".create.end\"):"},{"line_number":121,"context_line":"                LOG.debug(\"Marking network: %s to be unhosted later\","},{"line_number":122,"context_line":"                          network_id)"},{"line_number":123,"context_line":"                unschedule_network \u003d True"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_7a222702","line":120,"updated":"2014-07-24 20:49:42.000000000","message":"Why log both here and in line 154? I think the log in line 154 is absolutely sufficient.","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"2e29125cce2bc1bbef562f67fe64d2877e0ce443","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        if not self.check_subnets_with_dhcp(context, network_id, method):"},{"line_number":118,"context_line":"            LOG.info(_(\"Network %s has no subnets with DHCP enabled\"),"},{"line_number":119,"context_line":"                     network_id)"},{"line_number":120,"context_line":"            if not method.endswith(\".create.end\"):"},{"line_number":121,"context_line":"                LOG.debug(\"Marking network: %s to be unhosted later\","},{"line_number":122,"context_line":"                          network_id)"},{"line_number":123,"context_line":"                unschedule_network \u003d True"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_d01867cf","line":120,"in_reply_to":"baada198_7a222702","updated":"2014-07-25 09:18:21.000000000","message":"Removed the log from here.","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"39a296fa37c8cbcd5c377c8f262b57697eb72a26","unresolved":false,"context_lines":[{"line_number":150,"context_line":"            for agent in enabled_agents:"},{"line_number":151,"context_line":"                self._cast_message("},{"line_number":152,"context_line":"                    context, method, payload, agent.host, agent.topic)"},{"line_number":153,"context_line":"                if unschedule_network:"},{"line_number":154,"context_line":"                    LOG.info(_(\"Unhosting network %(net_id)s from \""},{"line_number":155,"context_line":"                               \"agent %(agt_id)s\")"},{"line_number":156,"context_line":"                             % {\u0027net_id\u0027: network_id,"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_3a6eef00","line":153,"updated":"2014-07-24 20:49:42.000000000","message":"This should be debug and not info probably?","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"2e29125cce2bc1bbef562f67fe64d2877e0ce443","unresolved":false,"context_lines":[{"line_number":150,"context_line":"            for agent in enabled_agents:"},{"line_number":151,"context_line":"                self._cast_message("},{"line_number":152,"context_line":"                    context, method, payload, agent.host, agent.topic)"},{"line_number":153,"context_line":"                if unschedule_network:"},{"line_number":154,"context_line":"                    LOG.info(_(\"Unhosting network %(net_id)s from \""},{"line_number":155,"context_line":"                               \"agent %(agt_id)s\")"},{"line_number":156,"context_line":"                             % {\u0027net_id\u0027: network_id,"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_7025db08","line":153,"in_reply_to":"baada198_3a6eef00","updated":"2014-07-25 09:18:21.000000000","message":"Done","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c2ea4a5b3301b809f3b816a74b3627139f4dfb8e","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def check_subnets_with_dhcp(context, network_id):"},{"line_number":101,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":102,"context_line":"           Based on the return value we can decide to skip scheduling"},{"line_number":103,"context_line":"           the network."},{"line_number":104,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_998293fd","line":101,"updated":"2014-07-25 12:08:36.000000000","message":"nit: PEP8/PEP257, summary docstring line ending in a period, blank line, and then any additional docstring lines.","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"bbe3b349d939d72f87783a4cc385959502834c0e","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def check_subnets_with_dhcp(context, network_id):"},{"line_number":101,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":102,"context_line":"           Based on the return value we can decide to skip scheduling"},{"line_number":103,"context_line":"           the network."},{"line_number":104,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_ca116ff9","line":101,"in_reply_to":"baada198_90d97df6","updated":"2014-07-26 08:57:46.000000000","message":"Done","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"f48bf805b5e5d5cbd383e570cbe031b1e69c29f9","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def check_subnets_with_dhcp(context, network_id):"},{"line_number":101,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":102,"context_line":"           Based on the return value we can decide to skip scheduling"},{"line_number":103,"context_line":"           the network."},{"line_number":104,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_90d97df6","line":101,"in_reply_to":"baada198_998293fd","updated":"2014-07-25 15:21:34.000000000","message":"will do..","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c2ea4a5b3301b809f3b816a74b3627139f4dfb8e","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        return count \u003e 0"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":111,"context_line":"        \"\"\"Notify all the agents that are hosting the network."},{"line_number":112,"context_line":"        \"\"\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        # Check if the networks have any DHCP enabled subnets before"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_79abff70","line":111,"updated":"2014-07-25 12:08:36.000000000","message":"Nit: PEP8/PEP257 put trailing quotes on same line as single line docstring.","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c2ea4a5b3301b809f3b816a74b3627139f4dfb8e","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        \"\"\"Notify all the agents that are hosting the network."},{"line_number":112,"context_line":"        \"\"\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        # Check if the networks have any DHCP enabled subnets before"},{"line_number":115,"context_line":"        # proceeding to notify agents."},{"line_number":116,"context_line":"        unschedule_network \u003d False"},{"line_number":117,"context_line":"        if not self.check_subnets_with_dhcp(context, network_id):"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_b9c83757","line":114,"updated":"2014-07-25 12:08:36.000000000","message":"Do you want to add this to the docstring?","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"bbe3b349d939d72f87783a4cc385959502834c0e","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        \"\"\"Notify all the agents that are hosting the network."},{"line_number":112,"context_line":"        \"\"\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        # Check if the networks have any DHCP enabled subnets before"},{"line_number":115,"context_line":"        # proceeding to notify agents."},{"line_number":116,"context_line":"        unschedule_network \u003d False"},{"line_number":117,"context_line":"        if not self.check_subnets_with_dhcp(context, network_id):"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_cafa4fb9","line":114,"in_reply_to":"baada198_10c64d16","updated":"2014-07-26 08:57:46.000000000","message":"Done","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"f48bf805b5e5d5cbd383e570cbe031b1e69c29f9","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        \"\"\"Notify all the agents that are hosting the network."},{"line_number":112,"context_line":"        \"\"\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        # Check if the networks have any DHCP enabled subnets before"},{"line_number":115,"context_line":"        # proceeding to notify agents."},{"line_number":116,"context_line":"        unschedule_network \u003d False"},{"line_number":117,"context_line":"        if not self.check_subnets_with_dhcp(context, network_id):"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_10c64d16","line":114,"in_reply_to":"baada198_b9c83757","updated":"2014-07-25 15:21:34.000000000","message":"will do","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"151d759dba912e4e8a7492ab1583c86d4e53b009","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        return enabled_agents"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def check_subnets_with_dhcp(context, network_id):"},{"line_number":101,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        Based on the return value we can decide to skip scheduling"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_0899a56c","line":100,"updated":"2014-07-28 02:21:20.000000000","message":"Need UT for his new method as well.","commit_id":"4c8ff6fe6740f70a07afa0194665125dc4a01d97"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"74ea169b9281b68bcc9f89b870be08dc4e390056","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        return enabled_agents"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def check_subnets_with_dhcp(context, network_id):"},{"line_number":101,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        Based on the return value we can decide to skip scheduling"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_0909a483","line":100,"in_reply_to":"baada198_0899a56c","updated":"2014-07-28 07:56:51.000000000","message":"Since this method is having only a DB call, I did not add any tests.\nWill add if you insist.","commit_id":"4c8ff6fe6740f70a07afa0194665125dc4a01d97"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"95c30bf6e67bb87b9d42720648add3839f9b77e0","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        return enabled_agents"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def check_subnets_with_dhcp(context, network_id):"},{"line_number":101,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        Based on the return value we can decide to skip scheduling"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_acde0668","line":100,"in_reply_to":"baada198_0909a483","updated":"2014-07-28 08:18:54.000000000","message":"I share Mohammad point of view, it ensures to highlight regression if Subnet db model changes.","commit_id":"4c8ff6fe6740f70a07afa0194665125dc4a01d97"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"fbe5b36420bf332617b07b6db256d355113435c4","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        return enabled_agents"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def check_subnets_with_dhcp(context, network_id):"},{"line_number":101,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        Based on the return value we can decide to skip scheduling"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_2c99166d","line":100,"in_reply_to":"baada198_acde0668","updated":"2014-07-28 08:26:39.000000000","message":"Ok. Posted a new patch set with the additional test. :)","commit_id":"4c8ff6fe6740f70a07afa0194665125dc4a01d97"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"578ff2146f5e82e87b167cb01038109b7c105543","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        unschedule_network \u003d False"},{"line_number":118,"context_line":"        if not self.check_subnets_with_dhcp(context, network_id):"},{"line_number":119,"context_line":"            LOG.debug(\"Network %s has no subnets with DHCP enabled\","},{"line_number":120,"context_line":"                      network_id)"},{"line_number":121,"context_line":"            if not method.endswith(\".create.end\"):"},{"line_number":122,"context_line":"                unschedule_network \u003d True"},{"line_number":123,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":10,"id":"baada198_20f4aecd","line":120,"updated":"2014-07-28 13:30:07.000000000","message":"According to the original code, \u0027method\u0027s value is something like \"%s_%s_%s\", for example \"network_create_end\" (as per line 132), yet this code checks if it ends with \".create.end\", implying that the variable\u0027s method is rather \"%s.%s.%s\".\n\nThis confuses me. If it is \"%s.%s.%s\", then a. the original code is wrong and b. your tests (in test_dhcp_rpc_agent_api.py) are also wrong (they specifically check for \"%s_%s_%s\").\nIf it is actually \"%s_%s_%s\", then unschedule_network is never True, and the if block starting at line 152 is unreachable.","commit_id":"ecba71011507c620c6f5958423878e9c771a0bad"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"03d0184c2c025949857b4c9767637588334c272d","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        unschedule_network \u003d False"},{"line_number":118,"context_line":"        if not self.check_subnets_with_dhcp(context, network_id):"},{"line_number":119,"context_line":"            LOG.debug(\"Network %s has no subnets with DHCP enabled\","},{"line_number":120,"context_line":"                      network_id)"},{"line_number":121,"context_line":"            if not method.endswith(\".create.end\"):"},{"line_number":122,"context_line":"                unschedule_network \u003d True"},{"line_number":123,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":10,"id":"baada198_b3b3b307","line":120,"in_reply_to":"baada198_20f4aecd","updated":"2014-07-28 14:54:43.000000000","message":"Thanks alot for catching this John. It is my bad.\nIn the initial patches, I was doing this check before the \u0027.\u0027 in the method name was replaced with \u0027_\u0027.  I missed to change after refactoring. Sorry for missing this.\n\nUnit tests are calling it correctly. Will correct this and post a fresh patch.","commit_id":"ecba71011507c620c6f5958423878e9c771a0bad"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2c9268fc599a56d4d501e97af201d795ef4665e8","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def check_subnets_with_dhcp(context, network_id):"},{"line_number":101,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        Based on the return value we can decide to skip scheduling"},{"line_number":104,"context_line":"        the network."}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_adcdeb32","line":101,"updated":"2014-07-29 12:28:10.000000000","message":"Nit: Just add a period at the end of the summary line doc-string. Same on L112.","commit_id":"196cd457fa62eec943dc2ed62ca871146ed770a9"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"1c67195cc659a5b0185b137406dd3c90d26026b4","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def check_subnets_with_dhcp(context, network_id):"},{"line_number":101,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        Based on the return value we can decide to skip scheduling"},{"line_number":104,"context_line":"        the network."}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_30512eda","line":101,"in_reply_to":"baada198_adcdeb32","updated":"2014-07-29 12:41:12.000000000","message":"Done","commit_id":"196cd457fa62eec943dc2ed62ca871146ed770a9"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"2d21cd5fd3732256a1befc8df2920059d716ff12","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        the network."},{"line_number":108,"context_line":"        \"\"\""},{"line_number":109,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":110,"context_line":"        count \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":111,"context_line":"                                       enable_dhcp\u003dTrue).count()"},{"line_number":112,"context_line":"        return count \u003e 0"},{"line_number":113,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_44450b71","line":110,"updated":"2014-08-05 16:02:26.000000000","message":"not sure in the context it will improve performance, but you can add .limit(1) to the query","commit_id":"e97789730f76b0b6cc1dc39331eae1159232c868"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"fc2c4177c16ea199ae1e3fa97fdce013316045d5","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        the network."},{"line_number":108,"context_line":"        \"\"\""},{"line_number":109,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":110,"context_line":"        count \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":111,"context_line":"                                       enable_dhcp\u003dTrue).count()"},{"line_number":112,"context_line":"        return count \u003e 0"},{"line_number":113,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_953defbe","line":110,"in_reply_to":"baada198_2fdee86a","updated":"2014-08-10 15:27:17.000000000","message":"thanks for the explanation Cedric. Modified the query to use first() which I understand that uses limit 1 internally, for simplification.\n\nHope its fine.","commit_id":"e97789730f76b0b6cc1dc39331eae1159232c868"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"19dbb6ed1c056c47403427399e533151c2c4c003","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        the network."},{"line_number":108,"context_line":"        \"\"\""},{"line_number":109,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":110,"context_line":"        count \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":111,"context_line":"                                       enable_dhcp\u003dTrue).count()"},{"line_number":112,"context_line":"        return count \u003e 0"},{"line_number":113,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_bcc954ad","line":110,"in_reply_to":"baada198_44450b71","updated":"2014-08-07 09:44:18.000000000","message":"Isn\u0027t limit only useful when pagenation is in context? Here it may not be of much help.","commit_id":"e97789730f76b0b6cc1dc39331eae1159232c868"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"600963111936c2c925e67dffa6eb60dd79ff19e5","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        the network."},{"line_number":108,"context_line":"        \"\"\""},{"line_number":109,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":110,"context_line":"        count \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":111,"context_line":"                                       enable_dhcp\u003dTrue).count()"},{"line_number":112,"context_line":"        return count \u003e 0"},{"line_number":113,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_2fdee86a","line":110,"in_reply_to":"baada198_bcc954ad","updated":"2014-08-07 10:13:16.000000000","message":"if limit(X) is used, sql db will stop searching for result when X results is found.","commit_id":"e97789730f76b0b6cc1dc39331eae1159232c868"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c9582c2f03730f81fb713a99fd84f50a30111d6d","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    @staticmethod"},{"line_number":103,"context_line":"    def check_subnets_with_dhcp(context, network_id):"},{"line_number":104,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled."},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        Based on the return value we can decide to skip scheduling"},{"line_number":107,"context_line":"        the network."}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_3525a716","line":104,"updated":"2014-08-13 01:02:52.000000000","message":"s/is having/has/","commit_id":"6e4b18eb4a81cb8fe4327f93e96f88f860156477"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"7bc1d980fed984fe7ac776ce094e3e5a829b417f","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    @staticmethod"},{"line_number":103,"context_line":"    def check_subnets_with_dhcp(context, network_id):"},{"line_number":104,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled."},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        Based on the return value we can decide to skip scheduling"},{"line_number":107,"context_line":"        the network."}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_343829cb","line":104,"in_reply_to":"baada198_3525a716","updated":"2014-08-13 13:08:46.000000000","message":"Done","commit_id":"6e4b18eb4a81cb8fe4327f93e96f88f860156477"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c9582c2f03730f81fb713a99fd84f50a30111d6d","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled."},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        Based on the return value we can decide to skip scheduling"},{"line_number":107,"context_line":"        the network."},{"line_number":108,"context_line":"        \"\"\""},{"line_number":109,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":110,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_93512b10","line":107,"updated":"2014-08-13 01:02:52.000000000","message":"Super pedantic nit: There could be other usage in the future, so this comment feels a little out of place here. Maybe just leave out?","commit_id":"6e4b18eb4a81cb8fe4327f93e96f88f860156477"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"7bc1d980fed984fe7ac776ce094e3e5a829b417f","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        \"\"\"Check if network is having any subnets with DHCP enabled."},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        Based on the return value we can decide to skip scheduling"},{"line_number":107,"context_line":"        the network."},{"line_number":108,"context_line":"        \"\"\""},{"line_number":109,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":110,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_7442a13c","line":107,"in_reply_to":"baada198_93512b10","updated":"2014-08-13 13:08:46.000000000","message":"Done","commit_id":"6e4b18eb4a81cb8fe4327f93e96f88f860156477"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c9582c2f03730f81fb713a99fd84f50a30111d6d","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":110,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":111,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":112,"context_line":"        return result"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":115,"context_line":"        \"\"\"Notify all the agents that are hosting the network."}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_eec44063","line":112,"updated":"2014-08-13 01:02:52.000000000","message":"Nit: The return value can now be either a subnet record or None. I think it would be clearer if this method was named \"has_subnet_with_dhcp()\" and it returned:\n\n    return True if subnet_query....first() else False","commit_id":"6e4b18eb4a81cb8fe4327f93e96f88f860156477"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"7bc1d980fed984fe7ac776ce094e3e5a829b417f","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":110,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":111,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":112,"context_line":"        return result"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":115,"context_line":"        \"\"\"Notify all the agents that are hosting the network."}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_341ca97b","line":112,"in_reply_to":"baada198_eec44063","updated":"2014-08-13 13:08:46.000000000","message":"Done","commit_id":"6e4b18eb4a81cb8fe4327f93e96f88f860156477"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"26ca61867d566c75f21d59a07dce16a7b405485b","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        return port.get(\u0027device_id\u0027) \u003d\u003d constants.DEVICE_ID_RESERVED_DHCP_PORT"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    @staticmethod"},{"line_number":103,"context_line":"    def has_subnets_with_dhcp(context, network_id):"},{"line_number":104,"context_line":"        \"\"\"Check if network has any subnets with DHCP enabled.\"\"\""},{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_ba489bb5","line":103,"updated":"2014-08-13 15:50:59.000000000","message":"nit: this method it should start with \u0027_\u0027 since it\u0027s not accessed outside of this class","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"9773d84190718439fa2bf7b4dbe2572ec9bf4a0d","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        return port.get(\u0027device_id\u0027) \u003d\u003d constants.DEVICE_ID_RESERVED_DHCP_PORT"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    @staticmethod"},{"line_number":103,"context_line":"    def has_subnets_with_dhcp(context, network_id):"},{"line_number":104,"context_line":"        \"\"\"Check if network has any subnets with DHCP enabled.\"\"\""},{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_95ef28b2","line":103,"in_reply_to":"baada198_ba489bb5","updated":"2014-08-13 15:56:48.000000000","message":"In the intial patches I was having \u0027_\u0027, but was suggested to make this a static method, so removed the _ as well after making it static.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1399bee36f7eaa4378df8bae48982de2ccc0ab44","unresolved":false,"context_lines":[{"line_number":102,"context_line":"    @staticmethod"},{"line_number":103,"context_line":"    def has_subnets_with_dhcp(context, network_id):"},{"line_number":104,"context_line":"        \"\"\"Check if network has any subnets with DHCP enabled.\"\"\""},{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":107,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":108,"context_line":"        return True if result else False"}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_b5526c34","line":105,"updated":"2014-08-13 16:06:25.000000000","message":"we shouldn\u0027t mix db logic in this file anyway. This should be placed in the scheduler code IMO","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1399bee36f7eaa4378df8bae48982de2ccc0ab44","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":107,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":108,"context_line":"        return True if result else False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":111,"context_line":"        \"\"\"Notify all the agents that are hosting the network."}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_d540c0a4","line":108,"updated":"2014-08-13 16:06:25.000000000","message":"nit: this could simply be return result is not None","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1399bee36f7eaa4378df8bae48982de2ccc0ab44","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":108,"context_line":"        return True if result else False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":111,"context_line":"        \"\"\"Notify all the agents that are hosting the network."},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        Check if the networks have any DHCP enabled subnets before"}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_d545209c","line":110,"updated":"2014-08-13 16:06:25.000000000","message":"please don\u0027t make this method longer than it really needs to be, I worked very hard to make it easier to read and with fewer branches than are really necessary.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"503fe077719633100b615f81360936fb91cb43a5","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":108,"context_line":"        return True if result else False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":111,"context_line":"        \"\"\"Notify all the agents that are hosting the network."},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        Check if the networks have any DHCP enabled subnets before"}],"source_content_type":"text/x-python","patch_set":16,"id":"7ac7a964_d622b900","line":110,"in_reply_to":"7ac7a964_40ddff13","updated":"2014-08-14 03:49:31.000000000","message":"As I said previously, one thing is triggering a scheduling decision, the other is encapsulating the logic where it belongs. Your multiple ??? lead me to believe that we have different interpretations of what Object Orientation really means, and I fear we won\u0027t be able to make much progress if we don\u0027t get on the same page.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4d3fdb9d60aef04b53c95a9e93a5b55eec50fc80","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":108,"context_line":"        return True if result else False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":111,"context_line":"        \"\"\"Notify all the agents that are hosting the network."},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        Check if the networks have any DHCP enabled subnets before"}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_63457b15","line":110,"in_reply_to":"baada198_4d350844","updated":"2014-08-13 17:53:14.000000000","message":"sorry, I don\u0027t understand how those are relevant here. Can you clarify? I am simply saying that you\u0027re making scheduling decisions here that should be made elsewhere.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"ced3add11f89173ee2e8cb53dc67dffd81eb2f83","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":108,"context_line":"        return True if result else False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":111,"context_line":"        \"\"\"Notify all the agents that are hosting the network."},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        Check if the networks have any DHCP enabled subnets before"}],"source_content_type":"text/x-python","patch_set":16,"id":"7ac7a964_40ddff13","line":110,"in_reply_to":"baada198_63457b15","updated":"2014-08-14 02:12:15.000000000","message":"Based on those (sensible) review comments only, I had added all the new checks in this method. And I felt that really helped simplifying the patch. \n\nSecondly, we are already deciding to schedule or not from this method at lines 121-126. When there is nothing wrong with that, why is this a concern??? \n\nThis is basically the source from where we are initiating a call to scheduler. So, I was preventing it here itself, rather than wait for this method to do some unnecessary stuff, let it call the scheduler and then prevent.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"d488fcf8919f88b350ce24fb2b1b4d3812f1a009","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":108,"context_line":"        return True if result else False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":111,"context_line":"        \"\"\"Notify all the agents that are hosting the network."},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        Check if the networks have any DHCP enabled subnets before"}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_4d350844","line":110,"in_reply_to":"baada198_d545209c","updated":"2014-08-13 17:19:15.000000000","message":"Have a look at the comments here for some context.\n\nhttps://review.openstack.org/#/c/101197/4/neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1399bee36f7eaa4378df8bae48982de2ccc0ab44","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            LOG.debug(\"Network %s has no subnets with DHCP enabled\","},{"line_number":119,"context_line":"                      network_id)"},{"line_number":120,"context_line":"            if not method.endswith(\"_create_end\"):"},{"line_number":121,"context_line":"                unschedule_network \u003d True"},{"line_number":122,"context_line":"            else:"},{"line_number":123,"context_line":"                return"},{"line_number":124,"context_line":"        # fanout is required as we do not know who is \"listening\""}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_c02e408d","line":121,"updated":"2014-08-13 16:06:25.000000000","message":"you\u0027re removing the network for any create event? Even for port of subnet create event? Granted you don\u0027t get in this block, but this is very counterintuitive.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"d488fcf8919f88b350ce24fb2b1b4d3812f1a009","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            LOG.debug(\"Network %s has no subnets with DHCP enabled\","},{"line_number":119,"context_line":"                      network_id)"},{"line_number":120,"context_line":"            if not method.endswith(\"_create_end\"):"},{"line_number":121,"context_line":"                unschedule_network \u003d True"},{"line_number":122,"context_line":"            else:"},{"line_number":123,"context_line":"                return"},{"line_number":124,"context_line":"        # fanout is required as we do not know who is \"listening\""}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_8def20b2","line":121,"in_reply_to":"baada198_c02e408d","updated":"2014-08-13 17:19:15.000000000","message":"I don\u0027t think so. The flag is being set to True when methods are NOT ending with _create_end.  Doing this check to unschedule the network in subnet delete/update cases.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1399bee36f7eaa4378df8bae48982de2ccc0ab44","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                      network_id)"},{"line_number":120,"context_line":"            if not method.endswith(\"_create_end\"):"},{"line_number":121,"context_line":"                unschedule_network \u003d True"},{"line_number":122,"context_line":"            else:"},{"line_number":123,"context_line":"                return"},{"line_number":124,"context_line":"        # fanout is required as we do not know who is \"listening\""},{"line_number":125,"context_line":"        no_agents \u003d not utils.is_extension_supported("}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_f5122463","line":122,"updated":"2014-08-13 16:06:25.000000000","message":"too many branches for 8 lines of code! This gets very difficult to test.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4d3fdb9d60aef04b53c95a9e93a5b55eec50fc80","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                      network_id)"},{"line_number":120,"context_line":"            if not method.endswith(\"_create_end\"):"},{"line_number":121,"context_line":"                unschedule_network \u003d True"},{"line_number":122,"context_line":"            else:"},{"line_number":123,"context_line":"                return"},{"line_number":124,"context_line":"        # fanout is required as we do not know who is \"listening\""},{"line_number":125,"context_line":"        no_agents \u003d not utils.is_extension_supported("}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_63f3bbe8","line":122,"in_reply_to":"baada198_edb09ce1","updated":"2014-08-13 17:53:14.000000000","message":"there\u0027s alway a way...","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"d488fcf8919f88b350ce24fb2b1b4d3812f1a009","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                      network_id)"},{"line_number":120,"context_line":"            if not method.endswith(\"_create_end\"):"},{"line_number":121,"context_line":"                unschedule_network \u003d True"},{"line_number":122,"context_line":"            else:"},{"line_number":123,"context_line":"                return"},{"line_number":124,"context_line":"        # fanout is required as we do not know who is \"listening\""},{"line_number":125,"context_line":"        no_agents \u003d not utils.is_extension_supported("}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_edb09ce1","line":122,"in_reply_to":"baada198_f5122463","updated":"2014-08-13 17:19:15.000000000","message":"I could not avoid.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1399bee36f7eaa4378df8bae48982de2ccc0ab44","unresolved":false,"context_lines":[{"line_number":150,"context_line":"            for agent in enabled_agents:"},{"line_number":151,"context_line":"                self._cast_message("},{"line_number":152,"context_line":"                    context, method, payload, agent.host, agent.topic)"},{"line_number":153,"context_line":"                if unschedule_network:"},{"line_number":154,"context_line":"                    LOG.debug(\"Unhosting network %(net_id)s from \""},{"line_number":155,"context_line":"                              \"agent %(agt_id)s\" % {\u0027net_id\u0027: network_id,"},{"line_number":156,"context_line":"                                                    \u0027agt_id\u0027: agent[\u0027id\u0027]})"}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_157958fb","line":153,"updated":"2014-08-13 16:06:25.000000000","message":"this approach is ugly and inefficient. We should avoid to schedule the network in the first place.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"503fe077719633100b615f81360936fb91cb43a5","unresolved":false,"context_lines":[{"line_number":150,"context_line":"            for agent in enabled_agents:"},{"line_number":151,"context_line":"                self._cast_message("},{"line_number":152,"context_line":"                    context, method, payload, agent.host, agent.topic)"},{"line_number":153,"context_line":"                if unschedule_network:"},{"line_number":154,"context_line":"                    LOG.debug(\"Unhosting network %(net_id)s from \""},{"line_number":155,"context_line":"                              \"agent %(agt_id)s\" % {\u0027net_id\u0027: network_id,"},{"line_number":156,"context_line":"                                                    \u0027agt_id\u0027: agent[\u0027id\u0027]})"}],"source_content_type":"text/x-python","patch_set":16,"id":"7ac7a964_5665c943","line":153,"in_reply_to":"7ac7a964_a0e25301","updated":"2014-08-14 03:49:31.000000000","message":"ok, I\u0027ll double check this, thanks.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"d488fcf8919f88b350ce24fb2b1b4d3812f1a009","unresolved":false,"context_lines":[{"line_number":150,"context_line":"            for agent in enabled_agents:"},{"line_number":151,"context_line":"                self._cast_message("},{"line_number":152,"context_line":"                    context, method, payload, agent.host, agent.topic)"},{"line_number":153,"context_line":"                if unschedule_network:"},{"line_number":154,"context_line":"                    LOG.debug(\"Unhosting network %(net_id)s from \""},{"line_number":155,"context_line":"                              \"agent %(agt_id)s\" % {\u0027net_id\u0027: network_id,"},{"line_number":156,"context_line":"                                                    \u0027agt_id\u0027: agent[\u0027id\u0027]})"}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_ad71440f","line":153,"in_reply_to":"baada198_157958fb","updated":"2014-08-13 17:19:15.000000000","message":"We are doing that NOW, by returning early.  This is still required to clean up the left over binding when the subnet is deleted or updated to disable DHCP.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4d3fdb9d60aef04b53c95a9e93a5b55eec50fc80","unresolved":false,"context_lines":[{"line_number":150,"context_line":"            for agent in enabled_agents:"},{"line_number":151,"context_line":"                self._cast_message("},{"line_number":152,"context_line":"                    context, method, payload, agent.host, agent.topic)"},{"line_number":153,"context_line":"                if unschedule_network:"},{"line_number":154,"context_line":"                    LOG.debug(\"Unhosting network %(net_id)s from \""},{"line_number":155,"context_line":"                              \"agent %(agt_id)s\" % {\u0027net_id\u0027: network_id,"},{"line_number":156,"context_line":"                                                    \u0027agt_id\u0027: agent[\u0027id\u0027]})"}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_c3964749","line":153,"in_reply_to":"baada198_ad71440f","updated":"2014-08-13 17:53:14.000000000","message":"okay my bad, let me rephrase, with a question actually: what happens if I create a network with subnets with dhcp OFF? Do you create the binding on line 145 and then remove it subsequently on line 157?","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"ced3add11f89173ee2e8cb53dc67dffd81eb2f83","unresolved":false,"context_lines":[{"line_number":150,"context_line":"            for agent in enabled_agents:"},{"line_number":151,"context_line":"                self._cast_message("},{"line_number":152,"context_line":"                    context, method, payload, agent.host, agent.topic)"},{"line_number":153,"context_line":"                if unschedule_network:"},{"line_number":154,"context_line":"                    LOG.debug(\"Unhosting network %(net_id)s from \""},{"line_number":155,"context_line":"                              \"agent %(agt_id)s\" % {\u0027net_id\u0027: network_id,"},{"line_number":156,"context_line":"                                                    \u0027agt_id\u0027: agent[\u0027id\u0027]})"}],"source_content_type":"text/x-python","patch_set":16,"id":"7ac7a964_a0e25301","line":153,"in_reply_to":"baada198_c3964749","updated":"2014-08-14 02:12:15.000000000","message":"Hmm...\nWe just quit the method from line 123 ... There is no hitting 145 or 157 in that case.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4b98fbd2ef48e4ddb618cb54fd9c1df9f18b3c7d","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                    LOG.debug(\"Unhosting network %(net_id)s from \""},{"line_number":155,"context_line":"                              \"agent %(agt_id)s\" % {\u0027net_id\u0027: network_id,"},{"line_number":156,"context_line":"                                                    \u0027agt_id\u0027: agent[\u0027id\u0027]})"},{"line_number":157,"context_line":"                    self.plugin.remove_network_from_dhcp_agent(admin_ctx,"},{"line_number":158,"context_line":"                                                               agent[\u0027id\u0027],"},{"line_number":159,"context_line":"                                                               network_id)"},{"line_number":160,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_00459871","line":157,"updated":"2014-08-13 16:26:00.000000000","message":"okay, after some digging this is what I understand: you want to ensure the following:\n\na) a network is being created with subnets with dhcp OFF: you don\u0027t want to schedule it to any agent. Today it is, even though it results in no waste of resources (like dnsmasq process up and running)\n\nb) a network that was initially scheduled to an agent, should be deassociated from the agent if it has no subnets that have dhcp enabled. Today, the network is sticky, in that it stays with the agent until it gets removed.\n\nI don\u0027t think that case b) requires a fix IMO; if it did, it would make the dhcp case asymmetric with the L3 case, and I think admins will freak out.\n\ncase a) might make sense, but I don\u0027t believe this logic needs to resides here, this is about notifying the agent, once the decision is made in _schedule_network.","commit_id":"2d6c4d26cc0bff829201e65572752783b2c13223"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"a3d90f8cc6a94e6b720597ac7f4837a6eaf71d02","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        return port.get(\u0027device_id\u0027) \u003d\u003d constants.DEVICE_ID_RESERVED_DHCP_PORT"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    @staticmethod"},{"line_number":103,"context_line":"    def has_subnets_with_dhcp(context, network_id):"},{"line_number":104,"context_line":"        \"\"\"Check if network has any subnets with DHCP enabled.\"\"\""},{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"baa201ad_7e40d335","line":103,"updated":"2014-10-10 20:57:07.000000000","message":"nit:  I\u0027m not sure that making this static is reason to remove the _ from the beginning of the method name.  Seems it should begin with _.  Or is there a convention that static methods don\u0027t follow that convention?","commit_id":"49bfc75a5c9a96eaab213e99277084fdb2ab38e3"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"ca3955c82730abc48fa607ddf49fc6ef9c23fe72","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        return port.get(\u0027device_id\u0027) \u003d\u003d constants.DEVICE_ID_RESERVED_DHCP_PORT"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    @staticmethod"},{"line_number":103,"context_line":"    def has_subnets_with_dhcp(context, network_id):"},{"line_number":104,"context_line":"        \"\"\"Check if network has any subnets with DHCP enabled.\"\"\""},{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"baa201ad_9ce80d7e","line":103,"in_reply_to":"baa201ad_7e40d335","updated":"2014-10-13 06:12:44.000000000","message":"I am not aware of any convention as such. But went with the decision of removing the \u0027_\u0027 to avoid confusion of the method looking as private, when its no longer.","commit_id":"49bfc75a5c9a96eaab213e99277084fdb2ab38e3"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"a3d90f8cc6a94e6b720597ac7f4837a6eaf71d02","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        \"\"\"Check if network has any subnets with DHCP enabled.\"\"\""},{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":107,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":108,"context_line":"        return True if result else False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"}],"source_content_type":"text/x-python","patch_set":17,"id":"baa201ad_9e6497e6","line":107,"updated":"2014-10-10 20:57:07.000000000","message":"I have a small concern about the trade-off here.  Is it common enough that we find networks with no dhcp enabled to justify adding an extra query to the common case?","commit_id":"49bfc75a5c9a96eaab213e99277084fdb2ab38e3"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"360e22638aca75e396c251178afd97a1810527a1","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        \"\"\"Check if network has any subnets with DHCP enabled.\"\"\""},{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":107,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":108,"context_line":"        return True if result else False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"}],"source_content_type":"text/x-python","patch_set":17,"id":"baa201ad_a7904096","line":107,"in_reply_to":"baa201ad_7c4d2999","updated":"2014-10-14 00:16:04.000000000","message":"The bug is marked with low importance.  It doesn\u0027t seem wise to fix such a bug if the cost isn\u0027t justified by the importance of the bug.","commit_id":"49bfc75a5c9a96eaab213e99277084fdb2ab38e3"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"ca3955c82730abc48fa607ddf49fc6ef9c23fe72","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        \"\"\"Check if network has any subnets with DHCP enabled.\"\"\""},{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":107,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":108,"context_line":"        return True if result else False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"}],"source_content_type":"text/x-python","patch_set":17,"id":"baa201ad_7c4d2999","line":107,"in_reply_to":"baa201ad_9e6497e6","updated":"2014-10-13 06:12:44.000000000","message":"I too agree that the probability of having non-dhcp subnets is minimal, but we have this bug still open https://bugs.launchpad.net/neutron/+bug/1213394 \n\nIf the concern really is about having DB query in this module, we can look to relocate it to a better suited one. \n\nThoughts?","commit_id":"49bfc75a5c9a96eaab213e99277084fdb2ab38e3"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"bb09f5001fa050bd3411f77ed1773ea5851d79f9","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        \"\"\"Check if network has any subnets with DHCP enabled.\"\"\""},{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":107,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":108,"context_line":"        return True if result else False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"}],"source_content_type":"text/x-python","patch_set":17,"id":"baa201ad_598773d7","line":107,"in_reply_to":"baa201ad_a7904096","updated":"2014-10-14 07:00:00.000000000","message":"Agreed.","commit_id":"49bfc75a5c9a96eaab213e99277084fdb2ab38e3"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"3973b1b7f0053b2582788da4e46f26d7d0a82bd0","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":107,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":108,"context_line":"        return True if result else False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":111,"context_line":"        \"\"\"Notify all the agents that are hosting the network."}],"source_content_type":"text/x-python","patch_set":17,"id":"baa201ad_960aec25","line":108,"updated":"2014-10-09 12:46:02.000000000","message":"return result is not None","commit_id":"49bfc75a5c9a96eaab213e99277084fdb2ab38e3"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"04d369b7d73383ff3df5b655630b674fbbb6b1d8","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        subnet_query \u003d context.session.query(models_v2.Subnet)"},{"line_number":106,"context_line":"        result \u003d subnet_query.filter_by(network_id\u003dnetwork_id,"},{"line_number":107,"context_line":"                                        enable_dhcp\u003dTrue).first()"},{"line_number":108,"context_line":"        return True if result else False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":111,"context_line":"        \"\"\"Notify all the agents that are hosting the network."}],"source_content_type":"text/x-python","patch_set":17,"id":"baa201ad_d0fd513d","line":108,"in_reply_to":"baa201ad_960aec25","updated":"2014-10-09 16:52:01.000000000","message":"Missed this. will do. Thanks.","commit_id":"49bfc75a5c9a96eaab213e99277084fdb2ab38e3"}],"neutron/scheduler/dhcp_agent_scheduler.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c9e9f9136897a7bde8fcf0a9eb00fb20ab46a3ce","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        \"\"\""},{"line_number":62,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"},{"line_number":65,"context_line":"        # subnets whose enable_dhcp is false"},{"line_number":66,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":67,"context_line":"            dhcp_agents \u003d plugin.get_dhcp_agents_hosting_networks("}],"source_content_type":"text/x-python","patch_set":17,"id":"baa201ad_44887922","side":"PARENT","line":64,"updated":"2014-10-13 19:07:45.000000000","message":"if we knew everything about the network object here, this would be possible. Unfortunately this is only a filtered dict and we only track the subnet ids. Without making another DB query this cannot be achieved.\n\nHowever, if we passed the DB object, then we could see if at least one subnet had DHCP enabled and skip this block altogether if don\u0027t.\n\nBottom line, without some refactoring, and adding methods to the plugin API, I cannot see this bug being easily addressed, unless we incur in the penalty that Carl hinted in the other file.\n\nThere was a reason why this TODO has been lying around for a very long time :)","commit_id":"555ba34bf09b87e9fbc4b07a28f8aefdbf3cbc08"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"bb09f5001fa050bd3411f77ed1773ea5851d79f9","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        \"\"\""},{"line_number":62,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"},{"line_number":65,"context_line":"        # subnets whose enable_dhcp is false"},{"line_number":66,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":67,"context_line":"            dhcp_agents \u003d plugin.get_dhcp_agents_hosting_networks("}],"source_content_type":"text/x-python","patch_set":17,"id":"baa201ad_7926f717","side":"PARENT","line":64,"in_reply_to":"baa201ad_0aed9325","updated":"2014-10-14 07:00:00.000000000","message":"Makes sense. I will then abandon this patch and look to see if its possible to fix it other way. \n\nThanks for the time folks :)","commit_id":"555ba34bf09b87e9fbc4b07a28f8aefdbf3cbc08"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"360e22638aca75e396c251178afd97a1810527a1","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        \"\"\""},{"line_number":62,"context_line":"        agents_per_network \u003d cfg.CONF.dhcp_agents_per_network"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        #TODO(gongysh) don\u0027t schedule the networks with only"},{"line_number":65,"context_line":"        # subnets whose enable_dhcp is false"},{"line_number":66,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":67,"context_line":"            dhcp_agents \u003d plugin.get_dhcp_agents_hosting_networks("}],"source_content_type":"text/x-python","patch_set":17,"id":"baa201ad_0aed9325","side":"PARENT","line":64,"in_reply_to":"baa201ad_44887922","updated":"2014-10-14 00:16:04.000000000","message":"+1.  I don\u0027t think this bug is worth the extra DB query on every notification.  I was looking for some way to refactor when I came across this comment by Armando.","commit_id":"555ba34bf09b87e9fbc4b07a28f8aefdbf3cbc08"}],"neutron/tests/unit/api/rpc/agentnotifiers/test_dhcp_rpc_agent_api.py":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f9f33800bd25045f68753489e84bff595f98183","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def test__notify_agents_fanout_required(self):"},{"line_number":114,"context_line":"        with mock.patch.object(self.notifier, \u0027_check_subnets_with_dhcp\u0027,"},{"line_number":115,"context_line":"                               return_value \u003d True):"},{"line_number":116,"context_line":"            self.notifier._notify_agents(mock.ANY,"},{"line_number":117,"context_line":"                                         \u0027network_delete_end\u0027,"},{"line_number":118,"context_line":"                                         mock.ANY, \u0027foo_network_id\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_eeddab42","line":115,"updated":"2014-07-24 15:22:39.000000000","message":"No spaces around \u0027\u003d\u0027 for keyword args.","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"6d4103d4f6d9a851fbaa36d02906355c1f036f1f","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def test__notify_agents_fanout_required(self):"},{"line_number":114,"context_line":"        with mock.patch.object(self.notifier, \u0027_check_subnets_with_dhcp\u0027,"},{"line_number":115,"context_line":"                               return_value \u003d True):"},{"line_number":116,"context_line":"            self.notifier._notify_agents(mock.ANY,"},{"line_number":117,"context_line":"                                         \u0027network_delete_end\u0027,"},{"line_number":118,"context_line":"                                         mock.ANY, \u0027foo_network_id\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_1df76f8d","line":115,"in_reply_to":"baada198_eeddab42","updated":"2014-07-24 17:37:45.000000000","message":"Done","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f9f33800bd25045f68753489e84bff595f98183","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                                          expected_scheduling\u003d0,"},{"line_number":123,"context_line":"                                          expected_casts\u003d0):"},{"line_number":124,"context_line":"        with mock.patch.object(self.notifier, \u0027_check_subnets_with_dhcp\u0027,"},{"line_number":125,"context_line":"                               return_value \u003d True):"},{"line_number":126,"context_line":"            with mock.patch.object(self.notifier, \u0027_schedule_network\u0027) as f:"},{"line_number":127,"context_line":"                with mock.patch.object(self.notifier,"},{"line_number":128,"context_line":"                                       \u0027_get_enabled_agents\u0027) as g:"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_2ee32306","line":125,"updated":"2014-07-24 15:22:39.000000000","message":"No spaces around \u0027\u003d\u0027 for keyword args.","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"6d4103d4f6d9a851fbaa36d02906355c1f036f1f","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                                          expected_scheduling\u003d0,"},{"line_number":123,"context_line":"                                          expected_casts\u003d0):"},{"line_number":124,"context_line":"        with mock.patch.object(self.notifier, \u0027_check_subnets_with_dhcp\u0027,"},{"line_number":125,"context_line":"                               return_value \u003d True):"},{"line_number":126,"context_line":"            with mock.patch.object(self.notifier, \u0027_schedule_network\u0027) as f:"},{"line_number":127,"context_line":"                with mock.patch.object(self.notifier,"},{"line_number":128,"context_line":"                                       \u0027_get_enabled_agents\u0027) as g:"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_5ded67b7","line":125,"in_reply_to":"baada198_2ee32306","updated":"2014-07-24 17:37:45.000000000","message":"Done","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f9f33800bd25045f68753489e84bff595f98183","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                                           expected_scheduling\u003d0,"},{"line_number":155,"context_line":"                                           expected_casts\u003d0):"},{"line_number":156,"context_line":"        with mock.patch.object(self.notifier, \u0027_check_subnets_with_dhcp\u0027,"},{"line_number":157,"context_line":"                               return_value \u003d False):"},{"line_number":158,"context_line":"            with mock.patch.object(self.notifier, \u0027_schedule_network\u0027) as f:"},{"line_number":159,"context_line":"                with mock.patch.object(self.notifier,"},{"line_number":160,"context_line":"                                       \u0027_get_enabled_agents\u0027) as g:"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_aebe53d2","line":157,"updated":"2014-07-24 15:22:39.000000000","message":"No spaces around \u0027\u003d\u0027 for keyword args.","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"6d4103d4f6d9a851fbaa36d02906355c1f036f1f","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                                           expected_scheduling\u003d0,"},{"line_number":155,"context_line":"                                           expected_casts\u003d0):"},{"line_number":156,"context_line":"        with mock.patch.object(self.notifier, \u0027_check_subnets_with_dhcp\u0027,"},{"line_number":157,"context_line":"                               return_value \u003d False):"},{"line_number":158,"context_line":"            with mock.patch.object(self.notifier, \u0027_schedule_network\u0027) as f:"},{"line_number":159,"context_line":"                with mock.patch.object(self.notifier,"},{"line_number":160,"context_line":"                                       \u0027_get_enabled_agents\u0027) as g:"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_7dea2ba1","line":157,"in_reply_to":"baada198_aebe53d2","updated":"2014-07-24 17:37:45.000000000","message":"Done","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"39a296fa37c8cbcd5c377c8f262b57697eb72a26","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        network \u003d {\u0027id\u0027: \u0027foo_network_id\u0027, \u0027subnets\u0027: [\u0027foo_subnet_id\u0027]}"},{"line_number":110,"context_line":"        self._test__get_enabled_agents(network, [], port_count\u003d20,"},{"line_number":111,"context_line":"                                       expected_warnings\u003d0, expected_errors\u003d1)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def test__notify_agents_fanout_required(self):"},{"line_number":114,"context_line":"        with mock.patch.object(self.notifier, \u0027check_subnets_with_dhcp\u0027,"},{"line_number":115,"context_line":"                               return_value\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_bd88396c","line":112,"updated":"2014-07-24 20:49:42.000000000","message":"I think that you\u0027re missing a test that creates a network with a DHCP subnet, creates a port, asserts that scheduling occurred and that a notification was sent, and then updates the subnet so that\u0027s it\u0027s no longer DHCP, and makes the appropriate assertions. This is one of the key changes in this patch. You\u0027d need to inherit from test_db_plugin:NeutronDbPluginV2TestCase in order to be able to easily create networks, subnets and ports. I\u0027d add a new test case class to test_dhcp_scheduler.py.","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"2e29125cce2bc1bbef562f67fe64d2877e0ce443","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        network \u003d {\u0027id\u0027: \u0027foo_network_id\u0027, \u0027subnets\u0027: [\u0027foo_subnet_id\u0027]}"},{"line_number":110,"context_line":"        self._test__get_enabled_agents(network, [], port_count\u003d20,"},{"line_number":111,"context_line":"                                       expected_warnings\u003d0, expected_errors\u003d1)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def test__notify_agents_fanout_required(self):"},{"line_number":114,"context_line":"        with mock.patch.object(self.notifier, \u0027check_subnets_with_dhcp\u0027,"},{"line_number":115,"context_line":"                               return_value\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_ab71c846","line":112,"in_reply_to":"baada198_bd88396c","updated":"2014-07-25 09:18:21.000000000","message":"For the scenario of \"creates a network with a DHCP subnet, creates a port, asserts that scheduling occurred and that a notification was sent\" the below test ensures that scheduling is done and notification is also sent: \n\ntest__notify_agents_cast_required_with_scheduling\nI have updated this test already to call the notify_agents with dhcp enabled case.\n\nAnd for the second half, \" then updates the subnet so that\u0027s it\u0027s no longer DHCP, and makes the appropriate assertions.\" , I added one test case, but its not proper. Will correct in the next patch","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"39a296fa37c8cbcd5c377c8f262b57697eb72a26","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def _test__notify_agents_dhcp_enabled(self, method,"},{"line_number":122,"context_line":"                                          expected_scheduling\u003d0,"},{"line_number":123,"context_line":"                                          expected_casts\u003d0):"},{"line_number":124,"context_line":"        with mock.patch.object(self.notifier, \u0027check_subnets_with_dhcp\u0027,"},{"line_number":125,"context_line":"                               return_value\u003dTrue):"},{"line_number":126,"context_line":"            with mock.patch.object(self.notifier, \u0027_schedule_network\u0027) as f:"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_dd25edae","line":123,"updated":"2014-07-24 20:49:42.000000000","message":"I think with 3 nested mocks it makes more sense to use a contextmanager. Check this out for an example:\nhttps://github.com/openstack/neutron/blob/1162ffc709918aa7e12db684c8fc754c365fe988/neutron/tests/unit/services/loadbalancer/agent/test_agent.py","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"2e29125cce2bc1bbef562f67fe64d2877e0ce443","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def _test__notify_agents_dhcp_enabled(self, method,"},{"line_number":122,"context_line":"                                          expected_scheduling\u003d0,"},{"line_number":123,"context_line":"                                          expected_casts\u003d0):"},{"line_number":124,"context_line":"        with mock.patch.object(self.notifier, \u0027check_subnets_with_dhcp\u0027,"},{"line_number":125,"context_line":"                               return_value\u003dTrue):"},{"line_number":126,"context_line":"            with mock.patch.object(self.notifier, \u0027_schedule_network\u0027) as f:"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_cb151c3e","line":123,"in_reply_to":"baada198_dd25edae","updated":"2014-07-25 09:18:21.000000000","message":"Done","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c2ea4a5b3301b809f3b816a74b3627139f4dfb8e","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            self.assertEqual(expected_scheduling, mock_schedule.call_count)"},{"line_number":139,"context_line":"            self.assertEqual(expected_casts, self.mock_cast.call_count)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def test__notify_agents_cast_required_with_scheduling(self):"},{"line_number":142,"context_line":"        self._test__notify_agents_dhcp_enabled(\u0027port_create_end\u0027,"},{"line_number":143,"context_line":"                                               expected_scheduling\u003d1,"},{"line_number":144,"context_line":"                                               expected_casts\u003d1)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_f929cf9c","line":141,"updated":"2014-07-25 12:08:36.000000000","message":"Just curious as to why the tests and helper functions have double underscores. It doesn\u0027t match a function name being tested that has a leading underscore (which would maybe be a case of when that would make sense to me).","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"7dd581fd793fbaa04c3dce58c14078161cd9e8a3","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            self.assertEqual(expected_scheduling, mock_schedule.call_count)"},{"line_number":139,"context_line":"            self.assertEqual(expected_casts, self.mock_cast.call_count)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def test__notify_agents_cast_required_with_scheduling(self):"},{"line_number":142,"context_line":"        self._test__notify_agents_dhcp_enabled(\u0027port_create_end\u0027,"},{"line_number":143,"context_line":"                                               expected_scheduling\u003d1,"},{"line_number":144,"context_line":"                                               expected_casts\u003d1)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_4c9ae6c5","line":141,"in_reply_to":"baada198_6420b39a","updated":"2014-07-25 21:28:04.000000000","message":"if you want to rename, could you do it in an other change to avoid mixing code correction and cleaning.","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"f48bf805b5e5d5cbd383e570cbe031b1e69c29f9","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            self.assertEqual(expected_scheduling, mock_schedule.call_count)"},{"line_number":139,"context_line":"            self.assertEqual(expected_casts, self.mock_cast.call_count)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def test__notify_agents_cast_required_with_scheduling(self):"},{"line_number":142,"context_line":"        self._test__notify_agents_dhcp_enabled(\u0027port_create_end\u0027,"},{"line_number":143,"context_line":"                                               expected_scheduling\u003d1,"},{"line_number":144,"context_line":"                                               expected_casts\u003d1)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_6420b39a","line":141,"in_reply_to":"baada198_f929cf9c","updated":"2014-07-25 15:21:34.000000000","message":"I agree. I was just following the naming convention of other methods in this module.\n\nLet me know if you recommend renaming all the unit test names here.","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"48fadad6d924cc5a62002500fa6a145d5e2ffd7e","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            self.assertEqual(expected_scheduling, mock_schedule.call_count)"},{"line_number":139,"context_line":"            self.assertEqual(expected_casts, self.mock_cast.call_count)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def test__notify_agents_cast_required_with_scheduling(self):"},{"line_number":142,"context_line":"        self._test__notify_agents_dhcp_enabled(\u0027port_create_end\u0027,"},{"line_number":143,"context_line":"                                               expected_scheduling\u003d1,"},{"line_number":144,"context_line":"                                               expected_casts\u003d1)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_50afe59c","line":141,"in_reply_to":"baada198_f929cf9c","updated":"2014-07-25 15:15:43.000000000","message":"Seems to be the convention in this module. Although I don\u0027t see any reason for it, I have no objection to keeping it.","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c2ea4a5b3301b809f3b816a74b3627139f4dfb8e","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            self.assertTrue(mock_check.called)"},{"line_number":181,"context_line":"            self.assertEqual(1, mock_get.call_count)"},{"line_number":182,"context_line":"            self.assertEqual(0, mock_schedule.call_count)"},{"line_number":183,"context_line":"            self.assertEqual(expected_scheduling, - mock_remove.call_count)"},{"line_number":184,"context_line":"            self.assertEqual(expected_casts, self.mock_cast.call_count)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    def test__notify_agents_cast_not_required_on_port_update(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_6b57a601","line":183,"updated":"2014-07-25 12:08:36.000000000","message":"Can you elaborate on why a negative call count is being used here? Seems non-intuitive.","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"48fadad6d924cc5a62002500fa6a145d5e2ffd7e","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            self.assertTrue(mock_check.called)"},{"line_number":181,"context_line":"            self.assertEqual(1, mock_get.call_count)"},{"line_number":182,"context_line":"            self.assertEqual(0, mock_schedule.call_count)"},{"line_number":183,"context_line":"            self.assertEqual(expected_scheduling, - mock_remove.call_count)"},{"line_number":184,"context_line":"            self.assertEqual(expected_casts, self.mock_cast.call_count)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    def test__notify_agents_cast_not_required_on_port_update(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_10b56dcf","line":183,"in_reply_to":"baada198_6b57a601","updated":"2014-07-25 15:15:43.000000000","message":"I agree, there is no reason to have it this way. Remove the - sign here and line 197.","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"f48bf805b5e5d5cbd383e570cbe031b1e69c29f9","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            self.assertTrue(mock_check.called)"},{"line_number":181,"context_line":"            self.assertEqual(1, mock_get.call_count)"},{"line_number":182,"context_line":"            self.assertEqual(0, mock_schedule.call_count)"},{"line_number":183,"context_line":"            self.assertEqual(expected_scheduling, - mock_remove.call_count)"},{"line_number":184,"context_line":"            self.assertEqual(expected_casts, self.mock_cast.call_count)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    def test__notify_agents_cast_not_required_on_port_update(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_c4b33f4c","line":183,"in_reply_to":"baada198_6b57a601","updated":"2014-07-25 15:21:34.000000000","message":"I was just trying reuse the exising parameter expected_scheduling instead of defining a new parameter expected_unscheduling. I will change this.","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"bbe3b349d939d72f87783a4cc385959502834c0e","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            self.assertTrue(mock_check.called)"},{"line_number":181,"context_line":"            self.assertEqual(1, mock_get.call_count)"},{"line_number":182,"context_line":"            self.assertEqual(0, mock_schedule.call_count)"},{"line_number":183,"context_line":"            self.assertEqual(expected_scheduling, - mock_remove.call_count)"},{"line_number":184,"context_line":"            self.assertEqual(expected_casts, self.mock_cast.call_count)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    def test__notify_agents_cast_not_required_on_port_update(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_ead39335","line":183,"in_reply_to":"baada198_c4b33f4c","updated":"2014-07-26 08:57:46.000000000","message":"Done","commit_id":"e49f10cc558e98aa3e20a674dbb41ba5e3dcff1f"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"10ef16a01a2f6d88e69fa79663ce6b80df9ca9c4","unresolved":false,"context_lines":[{"line_number":147,"context_line":"    def test_check_subnets_with_dhcp(self):"},{"line_number":148,"context_line":"        self._create_network(\u0027net1\u0027)"},{"line_number":149,"context_line":"        pool1 \u003d {\u0027start\u0027: \u002720.0.0.2\u0027, \u0027end\u0027: \u002720.0.0.254\u0027}"},{"line_number":150,"context_line":"        self._create_subnet(\u0027subnet1\u0027, \u0027net1\u0027, \u002720.0.0.0/24\u0027, True, pool1)"},{"line_number":151,"context_line":"        pool2 \u003d {\u0027start\u0027: \u002730.0.0.2\u0027, \u0027end\u0027: \u002730.0.0.254\u0027}"},{"line_number":152,"context_line":"        self._create_subnet(\u0027subnet2\u0027, \u0027net1\u0027, \u002730.0.0.0/24\u0027, False, pool2)"},{"line_number":153,"context_line":"        ret_val \u003d self.notifier.check_subnets_with_dhcp(self.context, \u0027net1\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"baada198_affa7174","line":150,"updated":"2014-07-28 12:14:57.000000000","message":"Nit: For clarity please call _create_subnet(..., enable_dhcp\u003dTrue, ...). Same for the other places where it is called below.","commit_id":"ecba71011507c620c6f5958423878e9c771a0bad"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"03d0184c2c025949857b4c9767637588334c272d","unresolved":false,"context_lines":[{"line_number":147,"context_line":"    def test_check_subnets_with_dhcp(self):"},{"line_number":148,"context_line":"        self._create_network(\u0027net1\u0027)"},{"line_number":149,"context_line":"        pool1 \u003d {\u0027start\u0027: \u002720.0.0.2\u0027, \u0027end\u0027: \u002720.0.0.254\u0027}"},{"line_number":150,"context_line":"        self._create_subnet(\u0027subnet1\u0027, \u0027net1\u0027, \u002720.0.0.0/24\u0027, True, pool1)"},{"line_number":151,"context_line":"        pool2 \u003d {\u0027start\u0027: \u002730.0.0.2\u0027, \u0027end\u0027: \u002730.0.0.254\u0027}"},{"line_number":152,"context_line":"        self._create_subnet(\u0027subnet2\u0027, \u0027net1\u0027, \u002730.0.0.0/24\u0027, False, pool2)"},{"line_number":153,"context_line":"        ret_val \u003d self.notifier.check_subnets_with_dhcp(self.context, \u0027net1\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"baada198_b3aad381","line":150,"in_reply_to":"baada198_affa7174","updated":"2014-07-28 14:54:43.000000000","message":"Will do.","commit_id":"ecba71011507c620c6f5958423878e9c771a0bad"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"10ef16a01a2f6d88e69fa79663ce6b80df9ca9c4","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        self._create_subnet(\u0027subnet2\u0027, \u0027net1\u0027, \u002730.0.0.0/24\u0027, False, pool2)"},{"line_number":153,"context_line":"        ret_val \u003d self.notifier.check_subnets_with_dhcp(self.context, \u0027net1\u0027)"},{"line_number":154,"context_line":"        self.assertTrue(ret_val)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        self._create_network(\u0027net2\u0027)"},{"line_number":157,"context_line":"        pool3 \u003d {\u0027start\u0027: \u002740.0.0.2\u0027, \u0027end\u0027: \u002740.0.0.254\u0027}"},{"line_number":158,"context_line":"        self._create_subnet(\u0027subnet3\u0027, \u0027net2\u0027, \u002740.0.0.0/24\u0027, False, pool3)"}],"source_content_type":"text/x-python","patch_set":10,"id":"baada198_ef3e2928","line":155,"updated":"2014-07-28 12:14:57.000000000","message":"The code above here should be one test case,\n\nThe code below should be a separate test case, test_check_subnets_without_dhcp()","commit_id":"ecba71011507c620c6f5958423878e9c771a0bad"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"03d0184c2c025949857b4c9767637588334c272d","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        self._create_subnet(\u0027subnet2\u0027, \u0027net1\u0027, \u002730.0.0.0/24\u0027, False, pool2)"},{"line_number":153,"context_line":"        ret_val \u003d self.notifier.check_subnets_with_dhcp(self.context, \u0027net1\u0027)"},{"line_number":154,"context_line":"        self.assertTrue(ret_val)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        self._create_network(\u0027net2\u0027)"},{"line_number":157,"context_line":"        pool3 \u003d {\u0027start\u0027: \u002740.0.0.2\u0027, \u0027end\u0027: \u002740.0.0.254\u0027}"},{"line_number":158,"context_line":"        self._create_subnet(\u0027subnet3\u0027, \u0027net2\u0027, \u002740.0.0.0/24\u0027, False, pool3)"}],"source_content_type":"text/x-python","patch_set":10,"id":"baada198_f38feb2b","line":155,"in_reply_to":"baada198_ef3e2928","updated":"2014-07-28 14:54:43.000000000","message":"Will do.","commit_id":"ecba71011507c620c6f5958423878e9c771a0bad"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2c9268fc599a56d4d501e97af201d795ef4665e8","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                ret_val \u003d self.notifier.check_subnets_with_dhcp(self.context,"},{"line_number":127,"context_line":"                                                                net_id)"},{"line_number":128,"context_line":"                self.assertFalse(ret_val)"},{"line_number":129,"context_line":"        self.dhcp_notifier_mock.stop()"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def test_check_subnets_with_dhcp_enabled_true(self):"},{"line_number":132,"context_line":"        self.dhcp_notifier_mock \u003d mock.patch.object("}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_cda05f45","line":129,"updated":"2014-07-29 12:28:10.000000000","message":"stop() is not needed, as base test class will stop all object mocks.  Same on line 141.","commit_id":"196cd457fa62eec943dc2ed62ca871146ed770a9"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"1c67195cc659a5b0185b137406dd3c90d26026b4","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                ret_val \u003d self.notifier.check_subnets_with_dhcp(self.context,"},{"line_number":127,"context_line":"                                                                net_id)"},{"line_number":128,"context_line":"                self.assertFalse(ret_val)"},{"line_number":129,"context_line":"        self.dhcp_notifier_mock.stop()"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def test_check_subnets_with_dhcp_enabled_true(self):"},{"line_number":132,"context_line":"        self.dhcp_notifier_mock \u003d mock.patch.object("}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_10442a18","line":129,"in_reply_to":"baada198_cda05f45","updated":"2014-07-29 12:41:12.000000000","message":"Done","commit_id":"196cd457fa62eec943dc2ed62ca871146ed770a9"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c9582c2f03730f81fb713a99fd84f50a30111d6d","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            self.notifier._notify_agents(mock.ANY,"},{"line_number":145,"context_line":"                                         \u0027network_delete_end\u0027,"},{"line_number":146,"context_line":"                                         mock.ANY, \u0027foo_network_id\u0027)"},{"line_number":147,"context_line":"        self.assertEqual(1, self.mock_fanout.call_count)"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def _test__notify_agents_dhcp_enabled(self, method,"},{"line_number":150,"context_line":"                                          expected_scheduling\u003d0,"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_f34d00c8","line":147,"updated":"2014-08-13 01:02:52.000000000","message":"Would it make sense to also have a test for _fanout_not_required()?","commit_id":"6e4b18eb4a81cb8fe4327f93e96f88f860156477"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"7bc1d980fed984fe7ac776ce094e3e5a829b417f","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            self.notifier._notify_agents(mock.ANY,"},{"line_number":145,"context_line":"                                         \u0027network_delete_end\u0027,"},{"line_number":146,"context_line":"                                         mock.ANY, \u0027foo_network_id\u0027)"},{"line_number":147,"context_line":"        self.assertEqual(1, self.mock_fanout.call_count)"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def _test__notify_agents_dhcp_enabled(self, method,"},{"line_number":150,"context_line":"                                          expected_scheduling\u003d0,"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_d409addd","line":147,"in_reply_to":"baada198_f34d00c8","updated":"2014-08-13 13:08:46.000000000","message":"This test test__notify_agents_cast_not_required_on_port_update,\nwhich is added down below, covers that :)","commit_id":"6e4b18eb4a81cb8fe4327f93e96f88f860156477"}],"neutron/tests/unit/test_api_v2.py":[{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"4c3bd9e266f7482a7d4f3b7b6f03acee4fe1b337","unresolved":false,"context_lines":[{"line_number":750,"context_line":"        instance.create_network.return_value \u003d return_value"},{"line_number":751,"context_line":"        instance.get_networks_count.return_value \u003d 0"},{"line_number":752,"context_line":""},{"line_number":753,"context_line":"        with mock.patch.object(dhcp_rpc_agent_api.DhcpAgentNotifyAPI,"},{"line_number":754,"context_line":"                               \u0027notify\u0027) as dhcp_notifier:"},{"line_number":755,"context_line":"            res \u003d self.api.post(_get_path(\u0027networks\u0027, fmt\u003dself.fmt),"},{"line_number":756,"context_line":"                                self.serialize(data),"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_81f0ec67","line":753,"updated":"2014-06-23 15:26:40.000000000","message":"As this code is repeated, is it not a good idea to mock the object in setUp() or a common helper method?","commit_id":"01ca2af473c2fa2cc17a86fdada0830792d78579"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"4ff49e1c13141d256c3b12ed5116c9c16ebdb517","unresolved":false,"context_lines":[{"line_number":750,"context_line":"        instance.create_network.return_value \u003d return_value"},{"line_number":751,"context_line":"        instance.get_networks_count.return_value \u003d 0"},{"line_number":752,"context_line":""},{"line_number":753,"context_line":"        with mock.patch.object(dhcp_rpc_agent_api.DhcpAgentNotifyAPI,"},{"line_number":754,"context_line":"                               \u0027notify\u0027) as dhcp_notifier:"},{"line_number":755,"context_line":"            res \u003d self.api.post(_get_path(\u0027networks\u0027, fmt\u003dself.fmt),"},{"line_number":756,"context_line":"                                self.serialize(data),"}],"source_content_type":"text/x-python","patch_set":3,"id":"dab895d6_3b1751ef","line":753,"in_reply_to":"1ae5cdf2_7c14639f","updated":"2014-06-30 08:54:26.000000000","message":"I tried to add the mock in the setup method, but other tests are failing. So had to revert to the earlier way. \nAlso, if we mock in the setup method, is it applicable to all tests in the class, which is not required here.","commit_id":"01ca2af473c2fa2cc17a86fdada0830792d78579"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"8fb511787f68653b84355a1941d6a8ef77740a75","unresolved":false,"context_lines":[{"line_number":750,"context_line":"        instance.create_network.return_value \u003d return_value"},{"line_number":751,"context_line":"        instance.get_networks_count.return_value \u003d 0"},{"line_number":752,"context_line":""},{"line_number":753,"context_line":"        with mock.patch.object(dhcp_rpc_agent_api.DhcpAgentNotifyAPI,"},{"line_number":754,"context_line":"                               \u0027notify\u0027) as dhcp_notifier:"},{"line_number":755,"context_line":"            res \u003d self.api.post(_get_path(\u0027networks\u0027, fmt\u003dself.fmt),"},{"line_number":756,"context_line":"                                self.serialize(data),"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_7c14639f","line":753,"in_reply_to":"1ae5cdf2_81f0ec67","updated":"2014-06-23 15:48:29.000000000","message":"Will modify appropriately.","commit_id":"01ca2af473c2fa2cc17a86fdada0830792d78579"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2f9f33800bd25045f68753489e84bff595f98183","unresolved":false,"context_lines":[{"line_number":759,"context_line":"        net \u003d res[\u0027network\u0027]"},{"line_number":760,"context_line":"        self.assertEqual(net[\u0027id\u0027], net_id)"},{"line_number":761,"context_line":"        self.assertEqual(net[\u0027status\u0027], \"ACTIVE\")"},{"line_number":762,"context_line":"        self.assertTrue(dhcp_notifier.called)"},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"    def test_create_use_defaults(self):"},{"line_number":765,"context_line":"        net_id \u003d _uuid()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_2ed7a3c0","line":762,"updated":"2014-07-24 15:22:39.000000000","message":"Strictly speaking dhcp_notifier goes out of scope after the with statement, so you should indent lines 756-762. Same for the rest of the changes in this module.\n\nBut I think it would be better to patch notify in setUp() like this:\n\n    self.dhcp_notifier_p \u003d mock.patch.object(\n        dhcp_rpc_agent_api.DhcpAgentNotifyAPI, \u0027notify\u0027)\n    self.dhcp_notifier \u003d self.dhcp_notifier_p.start()\n\nto avoid having to add with statements everywhere.","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"6d4103d4f6d9a851fbaa36d02906355c1f036f1f","unresolved":false,"context_lines":[{"line_number":759,"context_line":"        net \u003d res[\u0027network\u0027]"},{"line_number":760,"context_line":"        self.assertEqual(net[\u0027id\u0027], net_id)"},{"line_number":761,"context_line":"        self.assertEqual(net[\u0027status\u0027], \"ACTIVE\")"},{"line_number":762,"context_line":"        self.assertTrue(dhcp_notifier.called)"},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"    def test_create_use_defaults(self):"},{"line_number":765,"context_line":"        net_id \u003d _uuid()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_a5cf49b2","line":762,"in_reply_to":"baada198_2ed7a3c0","updated":"2014-07-24 17:37:45.000000000","message":"Done","commit_id":"1a4eff34209044c5405a233b9d24c22bc2a6861a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"39a296fa37c8cbcd5c377c8f262b57697eb72a26","unresolved":false,"context_lines":[{"line_number":518,"context_line":"        self.dhcp_notifier_mock \u003d mock.patch.object("},{"line_number":519,"context_line":"            dhcp_rpc_agent_api.DhcpAgentNotifyAPI, \u0027notify\u0027)"},{"line_number":520,"context_line":"        self.dhcp_notifier \u003d self.dhcp_notifier_mock.start()"},{"line_number":521,"context_line":""},{"line_number":522,"context_line":"    def tearDown(self):"},{"line_number":523,"context_line":"        super(JSONV2TestCase, self).tearDown()"},{"line_number":524,"context_line":"        self.dhcp_notifier \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_3a5b4f87","line":521,"updated":"2014-07-24 20:49:42.000000000","message":"tearDown by the base test class calls stop on all mocks so you can happily cut these 4 lines away :)","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"2e29125cce2bc1bbef562f67fe64d2877e0ce443","unresolved":false,"context_lines":[{"line_number":518,"context_line":"        self.dhcp_notifier_mock \u003d mock.patch.object("},{"line_number":519,"context_line":"            dhcp_rpc_agent_api.DhcpAgentNotifyAPI, \u0027notify\u0027)"},{"line_number":520,"context_line":"        self.dhcp_notifier \u003d self.dhcp_notifier_mock.start()"},{"line_number":521,"context_line":""},{"line_number":522,"context_line":"    def tearDown(self):"},{"line_number":523,"context_line":"        super(JSONV2TestCase, self).tearDown()"},{"line_number":524,"context_line":"        self.dhcp_notifier \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_10bbbfc4","line":521,"in_reply_to":"baada198_3a5b4f87","updated":"2014-07-25 09:18:21.000000000","message":"Done","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"39a296fa37c8cbcd5c377c8f262b57697eb72a26","unresolved":false,"context_lines":[{"line_number":944,"context_line":"        instance \u003d self.plugin.return_value"},{"line_number":945,"context_line":"        instance.get_network.return_value \u003d {\u0027tenant_id\u0027: unicode(tenant_id)}"},{"line_number":946,"context_line":"        instance.get_ports_count.return_value \u003d 1"},{"line_number":947,"context_line":"        instance.create_port.return_value \u003d return_value"},{"line_number":948,"context_line":""},{"line_number":949,"context_line":"        res \u003d self.api.post(_get_path(\u0027ports\u0027, fmt\u003dself.fmt),"},{"line_number":950,"context_line":"                            self.serialize(initial_input),"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_7a50675e","line":947,"updated":"2014-07-24 20:49:42.000000000","message":"A wild newline appears!","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"},{"author":{"_account_id":11825,"name":"Sudhakar Babu Gariganti","email":"sudhakar.gariganti@gmail.com","username":"sudhakar-gariganti"},"change_message_id":"2e29125cce2bc1bbef562f67fe64d2877e0ce443","unresolved":false,"context_lines":[{"line_number":944,"context_line":"        instance \u003d self.plugin.return_value"},{"line_number":945,"context_line":"        instance.get_network.return_value \u003d {\u0027tenant_id\u0027: unicode(tenant_id)}"},{"line_number":946,"context_line":"        instance.get_ports_count.return_value \u003d 1"},{"line_number":947,"context_line":"        instance.create_port.return_value \u003d return_value"},{"line_number":948,"context_line":""},{"line_number":949,"context_line":"        res \u003d self.api.post(_get_path(\u0027ports\u0027, fmt\u003dself.fmt),"},{"line_number":950,"context_line":"                            self.serialize(initial_input),"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_f0b56bd0","line":947,"in_reply_to":"baada198_7a50675e","updated":"2014-07-25 09:18:21.000000000","message":"Done","commit_id":"bab9ca5318cad7b96ffade93378ce50347986f18"}]}
