)]}'
{"neutron/agent/dhcp/agent.py":[{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"9af0b27ba7931e70289490a9702e300eeb3d6ed0","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if network:"},{"line_number":226,"context_line":"            dhcp_port_device_id_on_host \u003d utils.get_dhcp_agent_device_id("},{"line_number":227,"context_line":"                network_id, self.conf.host)"},{"line_number":228,"context_line":"            for port in network.ports:"},{"line_number":229,"context_line":"                if port.device_id \u003d\u003d dhcp_port_device_id_on_host:"},{"line_number":230,"context_line":"                    self.cache.put_port(port)"},{"line_number":231,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_f314e0e9","line":228,"updated":"2015-07-28 08:14:02.000000000","message":"there is another bug #https://bugs.launchpad.net/neutron/+bug/1470612, I think these two bugs can be fixed in this function","commit_id":"7ce766fb323ce88477e605742d7876cbdcf7d14c"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"00e7425fa21dbbed7710d960d06be98841d0d09d","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if network:"},{"line_number":226,"context_line":"            dhcp_port_device_id_on_host \u003d utils.get_dhcp_agent_device_id("},{"line_number":227,"context_line":"                network_id, self.conf.host)"},{"line_number":228,"context_line":"            for port in network.ports:"},{"line_number":229,"context_line":"                if port.device_id \u003d\u003d dhcp_port_device_id_on_host:"},{"line_number":230,"context_line":"                    self.cache.put_port(port)"},{"line_number":231,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_74b19300","line":228,"in_reply_to":"3a50d1a3_456aabb4","updated":"2015-07-28 10:05:44.000000000","message":"Sure @Oleg. Thanks for reviewing the patch.","commit_id":"7ce766fb323ce88477e605742d7876cbdcf7d14c"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"ab07fc3ead32335a397bacef32e2c7e5f6a4fad4","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if network:"},{"line_number":226,"context_line":"            dhcp_port_device_id_on_host \u003d utils.get_dhcp_agent_device_id("},{"line_number":227,"context_line":"                network_id, self.conf.host)"},{"line_number":228,"context_line":"            for port in network.ports:"},{"line_number":229,"context_line":"                if port.device_id \u003d\u003d dhcp_port_device_id_on_host:"},{"line_number":230,"context_line":"                    self.cache.put_port(port)"},{"line_number":231,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_c59c7bc2","line":228,"in_reply_to":"3a50d1a3_f314e0e9","updated":"2015-07-28 08:35:42.000000000","message":"Sure shihanzhang, I\u0027ll look into it. Thanks for sharing and reviewing the patch.","commit_id":"7ce766fb323ce88477e605742d7876cbdcf7d14c"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"25c032e888240a95e1d6c0b8275846ca5a18c17a","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if network:"},{"line_number":226,"context_line":"            dhcp_port_device_id_on_host \u003d utils.get_dhcp_agent_device_id("},{"line_number":227,"context_line":"                network_id, self.conf.host)"},{"line_number":228,"context_line":"            for port in network.ports:"},{"line_number":229,"context_line":"                if port.device_id \u003d\u003d dhcp_port_device_id_on_host:"},{"line_number":230,"context_line":"                    self.cache.put_port(port)"},{"line_number":231,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_456aabb4","line":228,"in_reply_to":"3a50d1a3_f314e0e9","updated":"2015-07-28 08:57:59.000000000","message":"These are separate issues, I\u0027d not combine two fixes in one patch, please feel free to start a dependent patch","commit_id":"7ce766fb323ce88477e605742d7876cbdcf7d14c"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"62233e8f0f98e92a1890fc2c78e2c00cb46c210f","unresolved":false,"context_lines":[{"line_number":243,"context_line":"                if self.call_driver(\u0027enable\u0027, network):"},{"line_number":244,"context_line":"                    dhcp_network_enabled \u003d True"},{"line_number":245,"context_line":"                    self.cache.put(network)"},{"line_number":246,"context_line":"                    self.update_cache_with_dhcp_port_if_created(network.id)"},{"line_number":247,"context_line":"                break"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        if enable_metadata and dhcp_network_enabled:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_664ee270","line":246,"updated":"2015-07-27 20:55:49.000000000","message":"Isn\u0027t this a race? Meaning dhcp port is not yet created when fetching network info from server","commit_id":"7ce766fb323ce88477e605742d7876cbdcf7d14c"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"00e7425fa21dbbed7710d960d06be98841d0d09d","unresolved":false,"context_lines":[{"line_number":243,"context_line":"                if self.call_driver(\u0027enable\u0027, network):"},{"line_number":244,"context_line":"                    dhcp_network_enabled \u003d True"},{"line_number":245,"context_line":"                    self.cache.put(network)"},{"line_number":246,"context_line":"                    self.update_cache_with_dhcp_port_if_created(network.id)"},{"line_number":247,"context_line":"                break"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        if enable_metadata and dhcp_network_enabled:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_54949741","line":246,"in_reply_to":"3a50d1a3_058ee378","updated":"2015-07-28 10:05:44.000000000","message":"I\u0027ll remove \"_if_created\" from the api name. Thanks.","commit_id":"7ce766fb323ce88477e605742d7876cbdcf7d14c"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"96e84c2bdefc1bc9a4d3dd6106d520b5eda82716","unresolved":false,"context_lines":[{"line_number":243,"context_line":"                if self.call_driver(\u0027enable\u0027, network):"},{"line_number":244,"context_line":"                    dhcp_network_enabled \u003d True"},{"line_number":245,"context_line":"                    self.cache.put(network)"},{"line_number":246,"context_line":"                    self.update_cache_with_dhcp_port_if_created(network.id)"},{"line_number":247,"context_line":"                break"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        if enable_metadata and dhcp_network_enabled:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_c7d9e658","line":246,"in_reply_to":"3a50d1a3_664ee270","updated":"2015-07-28 07:44:07.000000000","message":"@Oleg, I\u0027m afraid there is no race condition here.\n\n1. In the caller of this API (i.e., enable_dhcp_helper L211) we query the network info from neutron server. This network info has the associated subnet, but it does not have the dhcp port (as it is not yet created and would be created by the dhcp driver). \n\n2. After checking that dhcp is enabled in the subnet (i.e., L242) we invoke \"enable()\" method of dhcp driver.\n\n3. As part of enable() api, in setup_dhcp_port, dhcp driver creates the dhcp port if not present (i.e., https://github.com/openstack/neutron/blob/master/neutron/agent/linux/dhcp.py#L1042).\n\n4. After returning from call_driver(\u0027enable\u0027..), we query neutron server if any dhcp ports have been created which match the \"dhcp_device_id\" and update the port info in the cache. \n\n5. All the operations are done while holding the lock (@utils.synchronized(\u0027dhcp-agent\u0027)), so there will not be any race.","commit_id":"7ce766fb323ce88477e605742d7876cbdcf7d14c"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"9922ce18bd2ed1fa134c460c8046bc87ff3c9635","unresolved":false,"context_lines":[{"line_number":243,"context_line":"                if self.call_driver(\u0027enable\u0027, network):"},{"line_number":244,"context_line":"                    dhcp_network_enabled \u003d True"},{"line_number":245,"context_line":"                    self.cache.put(network)"},{"line_number":246,"context_line":"                    self.update_cache_with_dhcp_port_if_created(network.id)"},{"line_number":247,"context_line":"                break"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        if enable_metadata and dhcp_network_enabled:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_33aec8e6","line":246,"in_reply_to":"3a50d1a3_c7d9e658","updated":"2015-07-28 08:08:23.000000000","message":"I also think there is no race condition","commit_id":"7ce766fb323ce88477e605742d7876cbdcf7d14c"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"25c032e888240a95e1d6c0b8275846ca5a18c17a","unresolved":false,"context_lines":[{"line_number":243,"context_line":"                if self.call_driver(\u0027enable\u0027, network):"},{"line_number":244,"context_line":"                    dhcp_network_enabled \u003d True"},{"line_number":245,"context_line":"                    self.cache.put(network)"},{"line_number":246,"context_line":"                    self.update_cache_with_dhcp_port_if_created(network.id)"},{"line_number":247,"context_line":"                break"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        if enable_metadata and dhcp_network_enabled:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_058ee378","line":246,"in_reply_to":"3a50d1a3_c7d9e658","updated":"2015-07-28 08:57:59.000000000","message":"Yeah, create_dhcp_port() uses rpc call() and waits for result. Why naming .._if_created then? What are conditions when there is no dhcp port after enabling dhcp on network?","commit_id":"7ce766fb323ce88477e605742d7876cbdcf7d14c"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"62233e8f0f98e92a1890fc2c78e2c00cb46c210f","unresolved":false,"context_lines":[{"line_number":350,"context_line":"            port[\u0027network_id\u0027], self.conf.host)"},{"line_number":351,"context_line":"        return port[\u0027device_id\u0027] \u003d\u003d thishost"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    # Use the update handler for the port create event."},{"line_number":354,"context_line":"    port_create_end \u003d port_update_end"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"    @utils.synchronized(\u0027dhcp-agent\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_467086a4","line":353,"updated":"2015-07-27 20:55:49.000000000","message":"Any idea why this does not work? After server creates dhcp port the agent should be notified, right?","commit_id":"7ce766fb323ce88477e605742d7876cbdcf7d14c"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"96e84c2bdefc1bc9a4d3dd6106d520b5eda82716","unresolved":false,"context_lines":[{"line_number":350,"context_line":"            port[\u0027network_id\u0027], self.conf.host)"},{"line_number":351,"context_line":"        return port[\u0027device_id\u0027] \u003d\u003d thishost"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    # Use the update handler for the port create event."},{"line_number":354,"context_line":"    port_create_end \u003d port_update_end"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"    @utils.synchronized(\u0027dhcp-agent\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_8dbd3f6a","line":353,"in_reply_to":"3a50d1a3_467086a4","updated":"2015-07-28 07:44:07.000000000","message":"According to the current behavior, when the dhcp driver requests for the dhcp port creation, port binding is happening but agent is not getting notified. I\u0027m not an expert in the port_binding sequence so not sure of the exact reasons behind not sending the notification (my guess is that because the agent has requested for the port binding, plugin is avoiding the notification to the agent)","commit_id":"7ce766fb323ce88477e605742d7876cbdcf7d14c"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"9922ce18bd2ed1fa134c460c8046bc87ff3c9635","unresolved":false,"context_lines":[{"line_number":350,"context_line":"            port[\u0027network_id\u0027], self.conf.host)"},{"line_number":351,"context_line":"        return port[\u0027device_id\u0027] \u003d\u003d thishost"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    # Use the update handler for the port create event."},{"line_number":354,"context_line":"    port_create_end \u003d port_update_end"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"    @utils.synchronized(\u0027dhcp-agent\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_d8e223a0","line":353,"in_reply_to":"3a50d1a3_8dbd3f6a","updated":"2015-07-28 08:08:23.000000000","message":"the reason is that now the dhcp notification is just send at api/v2/base.py, but when a dhcp agent create port directly by \u0027self.plugin.create_dhcp_port\u0027, so dhcp agent will not receive notification","commit_id":"7ce766fb323ce88477e605742d7876cbdcf7d14c"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"ab07fc3ead32335a397bacef32e2c7e5f6a4fad4","unresolved":false,"context_lines":[{"line_number":350,"context_line":"            port[\u0027network_id\u0027], self.conf.host)"},{"line_number":351,"context_line":"        return port[\u0027device_id\u0027] \u003d\u003d thishost"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    # Use the update handler for the port create event."},{"line_number":354,"context_line":"    port_create_end \u003d port_update_end"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"    @utils.synchronized(\u0027dhcp-agent\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_733d30dc","line":353,"in_reply_to":"3a50d1a3_d8e223a0","updated":"2015-07-28 08:35:42.000000000","message":"thanks for the info @shihanzhang.","commit_id":"7ce766fb323ce88477e605742d7876cbdcf7d14c"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"bd02cc2615462e995c6263edfdaf7d22b7b1bbd2","unresolved":false,"context_lines":[{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        for subnet in network.subnets:"},{"line_number":242,"context_line":"            if subnet.enable_dhcp:"},{"line_number":243,"context_line":"                if self.call_driver(\u0027enable\u0027, network):"},{"line_number":244,"context_line":"                    dhcp_network_enabled \u003d True"},{"line_number":245,"context_line":"                    self.cache.put(network)"},{"line_number":246,"context_line":"                    self.update_cache_with_dhcp_port(network.id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_70bf26d0","line":243,"updated":"2015-07-29 08:55:00.000000000","message":"I think a more natural way would be if dhcp driver updates \u0027network\u0027 object with dhcp port info once fetches it [0], so that agent cashes it at #245 without additional hooks on agent side. Please let me know what you think about it.\n\n[0] https://github.com/openstack/neutron/blob/master/neutron/agent/linux/dhcp.py#L1061","commit_id":"4012edf7aafea93e35a4b96cf9d8ae3418502e7f"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"30ebf3f70d25613ac38b43971cb4e102c41b1153","unresolved":false,"context_lines":[{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        for subnet in network.subnets:"},{"line_number":242,"context_line":"            if subnet.enable_dhcp:"},{"line_number":243,"context_line":"                if self.call_driver(\u0027enable\u0027, network):"},{"line_number":244,"context_line":"                    dhcp_network_enabled \u003d True"},{"line_number":245,"context_line":"                    self.cache.put(network)"},{"line_number":246,"context_line":"                    self.update_cache_with_dhcp_port(network.id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_d3c1614f","line":243,"in_reply_to":"3a50d1a3_70bf26d0","updated":"2015-07-29 10:17:54.000000000","message":"I like the idea @Oleg, in this approach we can avoid an additional call to the plugin. Thanks for the suggestion.","commit_id":"4012edf7aafea93e35a4b96cf9d8ae3418502e7f"}],"neutron/agent/linux/dhcp.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"975e59d620aff58f979ded885e650255d7d667e6","unresolved":false,"context_lines":[{"line_number":1056,"context_line":""},{"line_number":1057,"context_line":"        return dhcp_port"},{"line_number":1058,"context_line":""},{"line_number":1059,"context_line":"    def update_dhcp_port(self, network, port):"},{"line_number":1060,"context_line":"        for index in range(len(network.ports)):"},{"line_number":1061,"context_line":"            if network.ports[index].id \u003d\u003d port.id:"},{"line_number":1062,"context_line":"                network.ports[index] \u003d port"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_c893eba1","line":1059,"updated":"2015-07-29 12:41:58.000000000","message":"nit: this better be _update_dhcp_port()","commit_id":"bdda9815525a16c6b7fc172b31cc318f405947e2"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"e55cb806a817095c2f5c9341383be152992f3aa0","unresolved":false,"context_lines":[{"line_number":1067,"context_line":"    def setup(self, network):"},{"line_number":1068,"context_line":"        \"\"\"Create and initialize a device for network\u0027s DHCP on this host.\"\"\""},{"line_number":1069,"context_line":"        port \u003d self.setup_dhcp_port(network)"},{"line_number":1070,"context_line":"        self.update_dhcp_port(network, port)"},{"line_number":1071,"context_line":"        interface_name \u003d self.get_interface_name(network, port)"},{"line_number":1072,"context_line":""},{"line_number":1073,"context_line":"        if ip_lib.ensure_device_is_ready(interface_name,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_d31961d2","line":1070,"updated":"2015-07-29 10:23:35.000000000","message":"@Oleg and @Shihanzhang, I\u0027ve verified this fix and it works fine.\n\nI would like to hear your comments if you have any with this implementation, before I can work on the associated test-cases. Thanks.","commit_id":"bdda9815525a16c6b7fc172b31cc318f405947e2"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"975e59d620aff58f979ded885e650255d7d667e6","unresolved":false,"context_lines":[{"line_number":1067,"context_line":"    def setup(self, network):"},{"line_number":1068,"context_line":"        \"\"\"Create and initialize a device for network\u0027s DHCP on this host.\"\"\""},{"line_number":1069,"context_line":"        port \u003d self.setup_dhcp_port(network)"},{"line_number":1070,"context_line":"        self.update_dhcp_port(network, port)"},{"line_number":1071,"context_line":"        interface_name \u003d self.get_interface_name(network, port)"},{"line_number":1072,"context_line":""},{"line_number":1073,"context_line":"        if ip_lib.ensure_device_is_ready(interface_name,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_a8df7f67","line":1070,"in_reply_to":"3a50d1a3_d31961d2","updated":"2015-07-29 12:41:58.000000000","message":"Exactly what I was proposing, thanks.","commit_id":"bdda9815525a16c6b7fc172b31cc318f405947e2"}],"neutron/tests/unit/agent/dhcp/test_agent.py":[{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"e55cb806a817095c2f5c9341383be152992f3aa0","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                            fixed_ips\u003d[fake_fixed_ip2]))"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"fake_ipv6_port \u003d dhcp.DictModel(dict(id\u003d\u002712345678-1234-aaaa-123456789000\u0027,"},{"line_number":113,"context_line":"                     device_owner\u003d\u0027\u0027,"},{"line_number":114,"context_line":"                     mac_address\u003d\u0027aa:bb:cc:dd:ee:99\u0027,"},{"line_number":115,"context_line":"                     network_id\u003d\u002712345678-1234-5678-1234567890ab\u0027,"},{"line_number":116,"context_line":"                     fixed_ips\u003d[fake_fixed_ipv6]))"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_136b491f","line":113,"updated":"2015-07-29 10:23:35.000000000","message":"will revert this change in the next patch.","commit_id":"bdda9815525a16c6b7fc172b31cc318f405947e2"}]}
