)]}'
{"neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py":[{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"7963d89bbaa624820a073dd7cead07c0b0bee63d","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            service_constants.L3_ROUTER_NAT)"},{"line_number":57,"context_line":"        state \u003d agentschedulers_db.get_admin_state_up_filter()"},{"line_number":58,"context_line":"        for router_id in router_ids:"},{"line_number":59,"context_line":"            hosts \u003d plugin.get_hosts_for_router(adminContext, router_id)"},{"line_number":60,"context_line":"            l3_agents \u003d plugin.get_l3_agents(context, active\u003dstate,"},{"line_number":61,"context_line":"                                             filters\u003d{\u0027host\u0027: hosts})"},{"line_number":62,"context_line":"            if shuffle_agents:"},{"line_number":63,"context_line":"                random.shuffle(l3_agents)"},{"line_number":64,"context_line":"            for l3_agent in l3_agents:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a7b0d38_6f07a9ca","line":61,"range":{"start_line":59,"start_character":12,"end_line":61,"end_character":69},"updated":"2015-12-27 08:18:02.000000000","message":"I feel cool with _get_dvr_hosts_for_router, but not here. It makes me feel it is inefficient here and the way get_hosts_for_router works.\n\nBeside _get_dvr_hosts_for_router, get_hosts_for_router will call get_l3_agents_hosting_routers to get dvr_snat agents, then get their hosts, and finally call get_l3_agents again to query agents.\n\nSo it looks like this: get agents -\u003e get hosts -\u003e get agents.\nIt doesn\u0027t make any sense to do like this.\n\n_get_dvr_hosts_for_router seems OK for now, but to make things simpler, I think you need modify it to directly return dvr agents, then combine two parts result with comparing agent_id or agents themselves.","commit_id":"559e40d90881ab0141d6a258e13bdef6e62f67b9"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"13f847aeafb0d1e0a9a0c818c87eff90b905319f","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            service_constants.L3_ROUTER_NAT)"},{"line_number":57,"context_line":"        state \u003d agentschedulers_db.get_admin_state_up_filter()"},{"line_number":58,"context_line":"        for router_id in router_ids:"},{"line_number":59,"context_line":"            hosts \u003d plugin.get_hosts_for_router(adminContext, router_id)"},{"line_number":60,"context_line":"            l3_agents \u003d plugin.get_l3_agents(context, active\u003dstate,"},{"line_number":61,"context_line":"                                             filters\u003d{\u0027host\u0027: hosts})"},{"line_number":62,"context_line":"            if shuffle_agents:"},{"line_number":63,"context_line":"                random.shuffle(l3_agents)"},{"line_number":64,"context_line":"            for l3_agent in l3_agents:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a7b0d38_894f686a","line":61,"range":{"start_line":59,"start_character":12,"end_line":61,"end_character":69},"in_reply_to":"1a7b0d38_6f07a9ca","updated":"2015-12-28 07:51:35.000000000","message":"Fair point, I\u0027ll see how to avoid duplicate work, thanks","commit_id":"559e40d90881ab0141d6a258e13bdef6e62f67b9"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"4e5024677046d68941135f37840502ac354d6ee4","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def _agent_notification(self, context, method, router_ids, operation,"},{"line_number":51,"context_line":"                            shuffle_agents):"},{"line_number":52,"context_line":"        \"\"\"Notify changed routers to hosting l3 agents.\"\"\""},{"line_number":53,"context_line":"        adminContext \u003d context if context.is_admin else context.elevated()"},{"line_number":54,"context_line":"        plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":55,"context_line":"            service_constants.L3_ROUTER_NAT)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a7b0d38_f4590a36","line":52,"updated":"2015-12-29 02:34:48.000000000","message":"I like the changing now, directly use topics.L3_agent and host seems better. Thanks.\n\nnit: both method name and docstring are talking about agent but not host, shall we also need do some update for that?","commit_id":"5954d24a6f5878ee5bb30839ad508faac6eb07dc"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"dd047fcf4d80af29f52bfffdca9348dbf8ebbac4","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def _agent_notification(self, context, method, router_ids, operation,"},{"line_number":51,"context_line":"                            shuffle_agents):"},{"line_number":52,"context_line":"        \"\"\"Notify changed routers to hosting l3 agents.\"\"\""},{"line_number":53,"context_line":"        adminContext \u003d context if context.is_admin else context.elevated()"},{"line_number":54,"context_line":"        plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":55,"context_line":"            service_constants.L3_ROUTER_NAT)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a7b0d38_e8efee84","line":52,"in_reply_to":"1a7b0d38_f4590a36","updated":"2015-12-29 04:28:52.000000000","message":"I don\u0027t think so, we\u0027re still notifying agents, not hosts","commit_id":"5954d24a6f5878ee5bb30839ad508faac6eb07dc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"32c0b7687e97bf991c9b6ad9436c39ed8852d17b","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        # TODO(murali): replace cast with fanout to avoid performance"},{"line_number":82,"context_line":"        # issues at greater scale."},{"line_number":83,"context_line":"        for host in hosts:"},{"line_number":84,"context_line":"            log_topic \u003d \u0027%s.%s\u0027 % (topics.L3_AGENT, host)"},{"line_number":85,"context_line":"            LOG.debug(\u0027Casting message %(method)s with topic %(topic)s\u0027,"},{"line_number":86,"context_line":"                      {\u0027topic\u0027: log_topic, \u0027method\u0027: method})"},{"line_number":87,"context_line":"            dvr_arptable \u003d {\u0027router_id\u0027: router_id,"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_8aa36b00","line":84,"updated":"2016-01-07 10:00:57.000000000","message":"is this backwards compatible? Why was the previous code looking at a topic for each agent?","commit_id":"5954d24a6f5878ee5bb30839ad508faac6eb07dc"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"45aa5b7c1aef6f809a20a89436cab5a2530b49dc","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        # TODO(murali): replace cast with fanout to avoid performance"},{"line_number":82,"context_line":"        # issues at greater scale."},{"line_number":83,"context_line":"        for host in hosts:"},{"line_number":84,"context_line":"            log_topic \u003d \u0027%s.%s\u0027 % (topics.L3_AGENT, host)"},{"line_number":85,"context_line":"            LOG.debug(\u0027Casting message %(method)s with topic %(topic)s\u0027,"},{"line_number":86,"context_line":"                      {\u0027topic\u0027: log_topic, \u0027method\u0027: method})"},{"line_number":87,"context_line":"            dvr_arptable \u003d {\u0027router_id\u0027: router_id,"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_6d9e06ba","line":84,"in_reply_to":"fa69d971_8aa36b00","updated":"2016-01-08 08:26:32.000000000","message":"I don\u0027t know any good reason for it, I\u0027m not aware of l3 agents using other topics so I think it should be safe to use constant (like in _notification_fanout)","commit_id":"5954d24a6f5878ee5bb30839ad508faac6eb07dc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4ec8e1b2cf7747540bd382fe47f4554e75e96d91","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"da6ed579_7808d691","updated":"2016-01-13 20:07:05.000000000","message":"I like the cleanup in this file.  Very nice.","commit_id":"254082ddcdf0d008a83c8a07b5415d6e5fdf32bb"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4ec8e1b2cf7747540bd382fe47f4554e75e96d91","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            for host in hosts:"},{"line_number":61,"context_line":"                LOG.debug(\u0027Notify agent at %(topic)s.%(host)s the message \u0027"},{"line_number":62,"context_line":"                          \u0027%(method)s\u0027,"},{"line_number":63,"context_line":"                          {\u0027topic\u0027: topics.L3_AGENT,"},{"line_number":64,"context_line":"                           \u0027host\u0027: host,"},{"line_number":65,"context_line":"                           \u0027method\u0027: method})"},{"line_number":66,"context_line":"                cctxt \u003d self.client.prepare(topic\u003dtopics.L3_AGENT,"}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_4f5bcf2e","line":63,"range":{"start_line":63,"start_character":36,"end_line":63,"end_character":51},"updated":"2016-01-13 20:07:05.000000000","message":"Note:  I\u0027m not sure why .topic was on the l3_agent in the first place.  I might be forgetting something about how it worked but I thought that all of the agents were using the same topic.  In which case, this change to use a constant is just fine.  Is that right?","commit_id":"254082ddcdf0d008a83c8a07b5415d6e5fdf32bb"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"5e75d22f47daf16c0a3b7461ece468ee8a56fdb6","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            for host in hosts:"},{"line_number":61,"context_line":"                LOG.debug(\u0027Notify agent at %(topic)s.%(host)s the message \u0027"},{"line_number":62,"context_line":"                          \u0027%(method)s\u0027,"},{"line_number":63,"context_line":"                          {\u0027topic\u0027: topics.L3_AGENT,"},{"line_number":64,"context_line":"                           \u0027host\u0027: host,"},{"line_number":65,"context_line":"                           \u0027method\u0027: method})"},{"line_number":66,"context_line":"                cctxt \u003d self.client.prepare(topic\u003dtopics.L3_AGENT,"}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_0116ecf0","line":63,"range":{"start_line":63,"start_character":36,"end_line":63,"end_character":51},"in_reply_to":"da6ed579_4f5bcf2e","updated":"2016-01-14 09:51:17.000000000","message":"I have the same opinion","commit_id":"254082ddcdf0d008a83c8a07b5415d6e5fdf32bb"}],"neutron/db/l3_agentschedulers_db.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4ec8e1b2cf7747540bd382fe47f4554e75e96d91","unresolved":false,"context_lines":[{"line_number":559,"context_line":"    def get_hosts_to_notify(self, context, router_id):"},{"line_number":560,"context_line":"        \"\"\"Returns all hosts to send notification about router update"},{"line_number":561,"context_line":""},{"line_number":562,"context_line":"        Overriden for DVR routers to also return compute hosts with DVR"},{"line_number":563,"context_line":"        serviceable ports"},{"line_number":564,"context_line":"        \"\"\""},{"line_number":565,"context_line":"        state \u003d agentschedulers_db.get_admin_state_up_filter()"}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_d397658e","line":562,"range":{"start_line":562,"start_character":8,"end_line":562,"end_character":33},"updated":"2016-01-13 20:07:05.000000000","message":"nit:  I don\u0027t think it is normal for a base class method to mention where it is overridden.  But, I wouldn\u0027t insist on taking in out.","commit_id":"254082ddcdf0d008a83c8a07b5415d6e5fdf32bb"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"5e75d22f47daf16c0a3b7461ece468ee8a56fdb6","unresolved":false,"context_lines":[{"line_number":559,"context_line":"    def get_hosts_to_notify(self, context, router_id):"},{"line_number":560,"context_line":"        \"\"\"Returns all hosts to send notification about router update"},{"line_number":561,"context_line":""},{"line_number":562,"context_line":"        Overriden for DVR routers to also return compute hosts with DVR"},{"line_number":563,"context_line":"        serviceable ports"},{"line_number":564,"context_line":"        \"\"\""},{"line_number":565,"context_line":"        state \u003d agentschedulers_db.get_admin_state_up_filter()"}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_e68089c2","line":562,"range":{"start_line":562,"start_character":8,"end_line":562,"end_character":33},"in_reply_to":"da6ed579_d397658e","updated":"2016-01-14 09:51:17.000000000","message":"Done","commit_id":"254082ddcdf0d008a83c8a07b5415d6e5fdf32bb"}],"neutron/db/l3_dvrscheduler_db.py":[{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"7864144225999f1919c14c102e691a4ee9aa1e72","unresolved":false,"context_lines":[{"line_number":462,"context_line":""},{"line_number":463,"context_line":"        Used for notifications."},{"line_number":464,"context_line":"        Overriden for DVR routers to also return compute hosts with DVR"},{"line_number":465,"context_line":"        serviceable ports"},{"line_number":466,"context_line":"        \"\"\""},{"line_number":467,"context_line":"        hosts \u003d super(L3_DVRsch_db_mixin, self).get_hosts_for_router("},{"line_number":468,"context_line":"            context, router_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a7b0d38_20b1fd8f","line":465,"range":{"start_line":465,"start_character":20,"end_line":465,"end_character":25},"updated":"2015-12-23 18:03:48.000000000","message":"This doc string says that it returns the hosts with the ports. I only see the hosts being returned.\nAm I missing something.","commit_id":"a04161a456836661e38f5b9c40427ac878e0a0c0"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8997ea8327dff031b813b454b2900cdc052eb0a4","unresolved":false,"context_lines":[{"line_number":462,"context_line":""},{"line_number":463,"context_line":"        Used for notifications."},{"line_number":464,"context_line":"        Overriden for DVR routers to also return compute hosts with DVR"},{"line_number":465,"context_line":"        serviceable ports"},{"line_number":466,"context_line":"        \"\"\""},{"line_number":467,"context_line":"        hosts \u003d super(L3_DVRsch_db_mixin, self).get_hosts_for_router("},{"line_number":468,"context_line":"            context, router_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a7b0d38_25757d97","line":465,"range":{"start_line":465,"start_character":20,"end_line":465,"end_character":25},"in_reply_to":"1a7b0d38_20b1fd8f","updated":"2015-12-24 08:04:01.000000000","message":"It says it returns hosts which have dvr serviceable ports on them","commit_id":"a04161a456836661e38f5b9c40427ac878e0a0c0"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"7963d89bbaa624820a073dd7cead07c0b0bee63d","unresolved":false,"context_lines":[{"line_number":447,"context_line":""},{"line_number":448,"context_line":"        return list(set(hosts))"},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"    def _get_dvr_hosts_for_router(self, context, router_id):"},{"line_number":451,"context_line":"        subnet_ids \u003d self.get_subnet_ids_on_router(context, router_id)"},{"line_number":452,"context_line":"        Binding \u003d ml2_models.PortBinding"},{"line_number":453,"context_line":"        Port \u003d models_v2.Port"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a7b0d38_2f0d21e8","line":450,"range":{"start_line":450,"start_character":8,"end_line":450,"end_character":33},"updated":"2015-12-27 08:18:02.000000000","message":"nit: how about add a docstring here.","commit_id":"559e40d90881ab0141d6a258e13bdef6e62f67b9"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"13f847aeafb0d1e0a9a0c818c87eff90b905319f","unresolved":false,"context_lines":[{"line_number":447,"context_line":""},{"line_number":448,"context_line":"        return list(set(hosts))"},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"    def _get_dvr_hosts_for_router(self, context, router_id):"},{"line_number":451,"context_line":"        subnet_ids \u003d self.get_subnet_ids_on_router(context, router_id)"},{"line_number":452,"context_line":"        Binding \u003d ml2_models.PortBinding"},{"line_number":453,"context_line":"        Port \u003d models_v2.Port"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a7b0d38_29af54e3","line":450,"range":{"start_line":450,"start_character":8,"end_line":450,"end_character":33},"in_reply_to":"1a7b0d38_2f0d21e8","updated":"2015-12-28 07:51:35.000000000","message":"Done","commit_id":"559e40d90881ab0141d6a258e13bdef6e62f67b9"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"8e3e54fda8fd04f1ec59981b555d34e6f767b3be","unresolved":false,"context_lines":[{"line_number":458,"context_line":"        It will first get IDs of all subnets connected to the router and then"},{"line_number":459,"context_line":"        get a set of hosts where all dvr serviceable ports on those subnets"},{"line_number":460,"context_line":"        are bound"},{"line_number":461,"context_line":"        \"\"\""},{"line_number":462,"context_line":"        subnet_ids \u003d self.get_subnet_ids_on_router(context, router_id)"},{"line_number":463,"context_line":"        Binding \u003d ml2_models.PortBinding"},{"line_number":464,"context_line":"        Port \u003d models_v2.Port"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_4d6b3786","line":461,"range":{"start_line":461,"start_character":8,"end_line":461,"end_character":11},"updated":"2016-01-07 18:19:30.000000000","message":"Oleg, is this functionality the same as the get_l3_agent_candidates that we use today for both legacy routers and the dvr routers.\n\nWhat advantage do we have on this function?","commit_id":"5954d24a6f5878ee5bb30839ad508faac6eb07dc"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"45aa5b7c1aef6f809a20a89436cab5a2530b49dc","unresolved":false,"context_lines":[{"line_number":458,"context_line":"        It will first get IDs of all subnets connected to the router and then"},{"line_number":459,"context_line":"        get a set of hosts where all dvr serviceable ports on those subnets"},{"line_number":460,"context_line":"        are bound"},{"line_number":461,"context_line":"        \"\"\""},{"line_number":462,"context_line":"        subnet_ids \u003d self.get_subnet_ids_on_router(context, router_id)"},{"line_number":463,"context_line":"        Binding \u003d ml2_models.PortBinding"},{"line_number":464,"context_line":"        Port \u003d models_v2.Port"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_2db32eeb","line":461,"range":{"start_line":461,"start_character":8,"end_line":461,"end_character":11},"in_reply_to":"fa69d971_4d6b3786","updated":"2016-01-08 08:26:32.000000000","message":"Swami, it\u0027s more about the need, not advantage for now, please see commit message. Can you please clarify your first question? I\u0027m not sure what is your -1 for","commit_id":"5954d24a6f5878ee5bb30839ad508faac6eb07dc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4ec8e1b2cf7747540bd382fe47f4554e75e96d91","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                    context, router_id, candidates\u003d[l3_agent_on_host])"},{"line_number":125,"context_line":"            LOG.debug(\u0027DVR: Handle new service_port on router: %s\u0027, router_id)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        if router_ids:"},{"line_number":128,"context_line":"            self.l3_rpc_notifier.routers_updated_on_host("},{"line_number":129,"context_line":"                context, router_ids, port_host)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_787d36e6","line":127,"range":{"start_line":127,"start_character":11,"end_line":127,"end_character":21},"updated":"2016-01-13 20:07:05.000000000","message":"Is this change related specifically to something else you did in this patch or is it off topic?\n\nnit:  Consider:\n\n  if not router_ids:\n      return\n\nJust to avoid extra indentation and extra changed lines of code.","commit_id":"254082ddcdf0d008a83c8a07b5415d6e5fdf32bb"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"5e75d22f47daf16c0a3b7461ece468ee8a56fdb6","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                    context, router_id, candidates\u003d[l3_agent_on_host])"},{"line_number":125,"context_line":"            LOG.debug(\u0027DVR: Handle new service_port on router: %s\u0027, router_id)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        if router_ids:"},{"line_number":128,"context_line":"            self.l3_rpc_notifier.routers_updated_on_host("},{"line_number":129,"context_line":"                context, router_ids, port_host)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_c99d56bd","line":127,"range":{"start_line":127,"start_character":11,"end_line":127,"end_character":21},"in_reply_to":"da6ed579_787d36e6","updated":"2016-01-14 09:51:17.000000000","message":"It popped up during testing of this patch: if router_ids is empty, notifier sends a noop notification with empty list. It doesn\u0027t hurt but still. I thought it\u0027s a simple check and is not worth a separate patch in the chain.","commit_id":"254082ddcdf0d008a83c8a07b5415d6e5fdf32bb"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4ec8e1b2cf7747540bd382fe47f4554e75e96d91","unresolved":false,"context_lines":[{"line_number":452,"context_line":"            dvr_hosts \u003d self._get_dvr_hosts_for_router(context, router_id)"},{"line_number":453,"context_line":"            dvr_hosts \u003d set(dvr_hosts) - set(hosts)"},{"line_number":454,"context_line":"            state \u003d agentschedulers_db.get_admin_state_up_filter()"},{"line_number":455,"context_line":"            agents \u003d self.get_l3_agents(context, active\u003dstate,"},{"line_number":456,"context_line":"                                        filters\u003d{\u0027host\u0027: dvr_hosts})"},{"line_number":457,"context_line":"            hosts +\u003d [a.host for a in agents]"},{"line_number":458,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_b3e3d132","line":455,"range":{"start_line":455,"start_character":26,"end_line":455,"end_character":39},"updated":"2016-01-13 20:07:05.000000000","message":"Note:  This results in a second query (where the base class performed the first query.  However, since the two queries are pretty different, I\u0027m not sure there is a good way to avoid it.","commit_id":"254082ddcdf0d008a83c8a07b5415d6e5fdf32bb"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4ec8e1b2cf7747540bd382fe47f4554e75e96d91","unresolved":false,"context_lines":[{"line_number":473,"context_line":"        query \u003d context.session.query(Binding.host).distinct()"},{"line_number":474,"context_line":"        query \u003d query.join(Binding.port)"},{"line_number":475,"context_line":"        query \u003d query.join(Port.fixed_ips)"},{"line_number":476,"context_line":"        query \u003d query.filter(IPAllocation.subnet_id.in_(subnet_ids))"},{"line_number":477,"context_line":"        owner_filter \u003d or_("},{"line_number":478,"context_line":"            Port.device_owner.startswith(n_const.DEVICE_OWNER_COMPUTE_PREFIX),"},{"line_number":479,"context_line":"            Port.device_owner.in_("}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_1813da67","line":476,"range":{"start_line":476,"start_character":56,"end_line":476,"end_character":66},"updated":"2016-01-13 20:07:05.000000000","message":"Instead of using two queries, one to get the subnet_ids and the other to get the hosts, do you think it would be worth it to combine them?  It would save a round-trip to the DB and avoid any potential for race conditions between them.  Although I doubt any races will be a problem in this case.","commit_id":"254082ddcdf0d008a83c8a07b5415d6e5fdf32bb"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"5e75d22f47daf16c0a3b7461ece468ee8a56fdb6","unresolved":false,"context_lines":[{"line_number":473,"context_line":"        query \u003d context.session.query(Binding.host).distinct()"},{"line_number":474,"context_line":"        query \u003d query.join(Binding.port)"},{"line_number":475,"context_line":"        query \u003d query.join(Port.fixed_ips)"},{"line_number":476,"context_line":"        query \u003d query.filter(IPAllocation.subnet_id.in_(subnet_ids))"},{"line_number":477,"context_line":"        owner_filter \u003d or_("},{"line_number":478,"context_line":"            Port.device_owner.startswith(n_const.DEVICE_OWNER_COMPUTE_PREFIX),"},{"line_number":479,"context_line":"            Port.device_owner.in_("}],"source_content_type":"text/x-python","patch_set":10,"id":"da6ed579_29e1929a","line":476,"range":{"start_line":476,"start_character":56,"end_line":476,"end_character":66},"in_reply_to":"da6ed579_1813da67","updated":"2016-01-14 09:51:17.000000000","message":"I\u0027m afraid that will be quite a complex query to read (and to write in the first place). So, yeah.. I\u0027m afraid :)","commit_id":"254082ddcdf0d008a83c8a07b5415d6e5fdf32bb"}]}
