)]}'
{"neutron/api/rpc/handlers/dhcp_rpc.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"fdd4c5726d58eea5b0a7fc1dfa4b4a27b40538dc","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        ports \u003d plugin.get_ports(context, filters\u003dfilters)"},{"line_number":147,"context_line":"        # default is to filter subnets based on \u0027enable_dhcp\u0027 flag"},{"line_number":148,"context_line":"        enable_dhcp_filter \u003d kwargs.get(\u0027enable_dhcp_filter\u0027, True)"},{"line_number":149,"context_line":"        if enable_dhcp_filter:"},{"line_number":150,"context_line":"            filters[\u0027enable_dhcp\u0027] \u003d [True]"},{"line_number":151,"context_line":"        # NOTE(kevinbenton): we sort these because the agent builds tags"},{"line_number":152,"context_line":"        # based on position in the list and has to restart the process if"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_f51f4f05","line":149,"updated":"2018-05-11 20:23:15.000000000","message":"This could just be \u0027if kwargs(...):","commit_id":"ce9d4f1164486d2f6f37454df9d3d1c060439299"}],"neutron/tests/unit/api/rpc/handlers/test_dhcp_rpc.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"24597afcca4c490cd9c21993ece36b83c73f813d","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                     \u0027non_local_subnets\u0027: [],"},{"line_number":125,"context_line":"                     \u0027subnets\u0027: network_b_subnets,"},{"line_number":126,"context_line":"                     \u0027ports\u0027: []}]"},{"line_number":127,"context_line":"        self.assertEqual(expected, networks)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    def test_get_active_networks_info_enable_dhcp_filter_false(self):"},{"line_number":130,"context_line":"        self._test_get_active_networks_info_enable_dhcp_filter(False)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_b6378fff","line":127,"updated":"2018-05-14 07:50:26.000000000","message":"I checked this test and it looks for me that this test is useless in current state. Everything is mocked here so even if I called self.callbacks.get_active_networks_info with \"wrong\" value for \"enable_dhcp_filter\" flag, result was as expected:\n\n    (Pdb++) pp self.callbacks.get_active_networks_info(mock.Mock(), host\u003d\u0027host\u0027, enable_dhcp_filter\u003dTrue)\n    [{\u0027id\u0027: \u0027a\u0027, \u0027non_local_subnets\u0027: [], \u0027ports\u0027: [], \u0027subnets\u0027: [{\u0027enable_dhcp\u0027: True, \u0027id\u0027: \u0027d\u0027, \u0027network_id\u0027: \u0027a\u0027}]},\n     {\u0027id\u0027: \u0027b\u0027, \u0027non_local_subnets\u0027: [], \u0027ports\u0027: [], \u0027subnets\u0027: [{\u0027enable_dhcp\u0027: True, \u0027id\u0027: \u0027e\u0027, \u0027network_id\u0027: \u0027b\u0027}, {\u0027enable_dhcp\u0027: False, \u0027id\u0027: \u0027f\u0027, \u0027network_id\u0027: \u0027b\u0027}]}]\n    (Pdb++) pp self.callbacks.get_active_networks_info(mock.Mock(), host\u003d\u0027host\u0027, enable_dhcp_filter\u003dFalse)\n    [{\u0027id\u0027: \u0027a\u0027, \u0027non_local_subnets\u0027: [], \u0027ports\u0027: [], \u0027subnets\u0027: [{\u0027enable_dhcp\u0027: True, \u0027id\u0027: \u0027d\u0027, \u0027network_id\u0027: \u0027a\u0027}]},\n     {\u0027id\u0027: \u0027b\u0027, \u0027non_local_subnets\u0027: [], \u0027ports\u0027: [], \u0027subnets\u0027: [{\u0027enable_dhcp\u0027: True, \u0027id\u0027: \u0027e\u0027, \u0027network_id\u0027: \u0027b\u0027}, {\u0027enable_dhcp\u0027: False, \u0027id\u0027: \u0027f\u0027, \u0027network_id\u0027: \u0027b\u0027}]}]\n\n\nMaybe You should change it to check if mocks were called with proper parameters? Or just remove this test if it\u0027s not testing anything. \nTo confirm that this test is not testing anything I did small change in Your patch:\n\ndiff --git a/neutron/api/rpc/handlers/dhcp_rpc.py b/neutron/api/rpc/handlers/dhcp_rpc.py\nindex acffd2131..1aa2a6a0a 100644\n--- a/neutron/api/rpc/handlers/dhcp_rpc.py\n+++ b/neutron/api/rpc/handlers/dhcp_rpc.py\n@@ -145,8 +145,8 @@ class DhcpRpcCallback(object):\n         filters \u003d {\u0027network_id\u0027: [network[\u0027id\u0027] for network in networks]}\n         ports \u003d plugin.get_ports(context, filters\u003dfilters)\n         # default is to filter subnets based on \u0027enable_dhcp\u0027 flag\n-        if kwargs.get(\u0027enable_dhcp_filter\u0027, True):\n-            filters[\u0027enable_dhcp\u0027] \u003d [True]\n+        #if kwargs.get(\u0027enable_dhcp_filter\u0027, True):\n+        filters[\u0027enable_dhcp\u0027] \u003d [True]\n         # NOTE(kevinbenton): we sort these because the agent builds tags\n         # based on position in the list and has to restart the process if\n         # the order changes.\n\nAnd both tests passed still :)","commit_id":"97720ca07bee7f8075b2184eda649c6a6112c68c"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"fc0ba4bc566ee266f78b578f15fcd16f6eafb672","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                     \u0027non_local_subnets\u0027: [],"},{"line_number":125,"context_line":"                     \u0027subnets\u0027: network_b_subnets,"},{"line_number":126,"context_line":"                     \u0027ports\u0027: []}]"},{"line_number":127,"context_line":"        self.assertEqual(expected, networks)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    def test_get_active_networks_info_enable_dhcp_filter_false(self):"},{"line_number":130,"context_line":"        self._test_get_active_networks_info_enable_dhcp_filter(False)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_5f5027d5","line":127,"in_reply_to":"5f7c97a3_b6378fff","updated":"2018-05-18 02:30:06.000000000","message":"Yes, I probably went a little overboard here, and didn\u0027t realize I had mocked too much.  I\u0027ll just make sure that get_subnets() is called with the correct arguments.","commit_id":"97720ca07bee7f8075b2184eda649c6a6112c68c"}]}
