)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"e51b5560da7e4667a4b050e1d638bd3b9848c071","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"However, other drivers, like the Linux Bridge one, may not be affected by"},{"line_number":17,"context_line":"this limitation, and the existing rule should be relaxed to allow the"},{"line_number":18,"context_line":"operation based on not the driver can support it."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Partially-implements: blueprint vlan-aware-vms"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9ad45d7e_41b67af9","line":18,"range":{"start_line":18,"start_character":16,"end_line":18,"end_character":22},"updated":"2016-08-11 19:11:04.000000000","message":"nit: on whether or not","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4e27b2160c48974e4e6acba7d528f9f4fb10bc2","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"However, other drivers, like the Linux Bridge one, may not be affected by"},{"line_number":17,"context_line":"this limitation, and the existing rule should be relaxed to allow the"},{"line_number":18,"context_line":"operation based on not the driver can support it."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Partially-implements: blueprint vlan-aware-vms"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9ad45d7e_f0ac928d","line":18,"range":{"start_line":18,"start_character":16,"end_line":18,"end_character":22},"in_reply_to":"9ad45d7e_41b67af9","updated":"2016-08-11 21:09:57.000000000","message":"Oh no!!","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"}],"neutron/services/trunk/drivers/base.py":[{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"97fac90d92afc66b9b1c685ca4be7331f6aa2c05","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        return interface in self.interfaces"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def is_agent_compatible(self, agent_type):"},{"line_number":61,"context_line":"        \"\"\"True if the driver is compatibile with the agent type.\"\"\""},{"line_number":62,"context_line":"        return agent_type \u003d\u003d self.agent_type"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def register(self, resource, event, trigger, **kwargs):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_145d2747","line":61,"range":{"start_line":61,"start_character":33,"end_line":61,"end_character":44},"updated":"2016-08-04 21:22:28.000000000","message":"sp","commit_id":"ad823fcc16a1597d7756e8c13cb43310c862cddd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c6adb142bf8e868e6756905dd70c40f196e1a00b","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        return interface in self.interfaces"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def is_agent_compatible(self, agent_type):"},{"line_number":61,"context_line":"        \"\"\"True if the driver is compatibile with the agent type.\"\"\""},{"line_number":62,"context_line":"        return agent_type \u003d\u003d self.agent_type"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def register(self, resource, event, trigger, **kwargs):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_6a047e17","line":61,"range":{"start_line":61,"start_character":33,"end_line":61,"end_character":44},"in_reply_to":"bacf61ea_145d2747","updated":"2016-08-04 21:28:55.000000000","message":"ack","commit_id":"ad823fcc16a1597d7756e8c13cb43310c862cddd"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ff4acf4059a1fd087f2ecfa0be53a9a1b7c46459","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def is_agent_compatible(self, agent_type):"},{"line_number":61,"context_line":"        \"\"\"True if the driver is compatible with the agent type.\"\"\""},{"line_number":62,"context_line":"        return agent_type \u003d\u003d self.agent_type"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def register(self, resource, event, trigger, **kwargs):"},{"line_number":65,"context_line":"        \"\"\"Register the trunk driver."}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_a6ac1aa1","line":62,"updated":"2016-08-10 04:22:24.000000000","message":"☕","commit_id":"5dacc618b1df207965a534ce7a82d9aa8c6794e6"}],"neutron/services/trunk/rules.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"150982022e96ef35ba04714bcc68b3bc818aab77","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":86,"context_line":"        port \u003d core_plugin.get_port(context, self.port_id)"},{"line_number":87,"context_line":"        device_owner \u003d port.get(\u0027device_owner\u0027, \u0027\u0027)"},{"line_number":88,"context_line":"        return port.get(portbindings.HOST_ID) or \\"},{"line_number":89,"context_line":"            device_owner.startswith(n_const.DEVICE_OWNER_COMPUTE_PREFIX)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_14aec7e5","side":"PARENT","line":88,"updated":"2016-08-04 21:00:25.000000000","message":"cannot help it, I had to get rid of it :)","commit_id":"46b6e129ff293672453e886e11922dbf059cd6ee"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"97fac90d92afc66b9b1c685ca4be7331f6aa2c05","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    if not driver.is_interface_compatible(interface):"},{"line_number":69,"context_line":"        return False"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    agents \u003d get_agents_by_host(context, binding_host)"},{"line_number":72,"context_line":"    for agent in agents:"},{"line_number":73,"context_line":"        if driver.is_agent_compatible(agent[\u0027agent_type\u0027]):"},{"line_number":74,"context_line":"            return True"},{"line_number":75,"context_line":"    return False"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"class TrunkPortValidator(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_e79c2710","line":75,"range":{"start_line":71,"start_character":0,"end_line":75,"end_character":16},"updated":"2016-08-04 21:22:28.000000000","message":"If a driver doesn\u0027t require an agent, doesn\u0027t this mean it will always be considered incompatible?","commit_id":"ad823fcc16a1597d7756e8c13cb43310c862cddd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c6adb142bf8e868e6756905dd70c40f196e1a00b","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    if not driver.is_interface_compatible(interface):"},{"line_number":69,"context_line":"        return False"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    agents \u003d get_agents_by_host(context, binding_host)"},{"line_number":72,"context_line":"    for agent in agents:"},{"line_number":73,"context_line":"        if driver.is_agent_compatible(agent[\u0027agent_type\u0027]):"},{"line_number":74,"context_line":"            return True"},{"line_number":75,"context_line":"    return False"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"class TrunkPortValidator(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_6532eff3","line":75,"range":{"start_line":71,"start_character":0,"end_line":75,"end_character":16},"in_reply_to":"bacf61ea_e79c2710","updated":"2016-08-04 21:28:55.000000000","message":"I think you found a flaw in this logic. Let me fix it.","commit_id":"ad823fcc16a1597d7756e8c13cb43310c862cddd"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"1b7bced52ae25915f65027db2e20b50f557cd178","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    if not is_interface_compatible:"},{"line_number":70,"context_line":"        return False"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    agents \u003d get_agents_by_host(context, binding_host)"},{"line_number":73,"context_line":"    for agent in agents:"},{"line_number":74,"context_line":"        if driver.is_agent_compatible(agent[\u0027agent_type\u0027]):"},{"line_number":75,"context_line":"            break"},{"line_number":76,"context_line":"    return is_interface_compatible"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"class TrunkPortValidator(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_bd0df090","line":76,"range":{"start_line":72,"start_character":4,"end_line":76,"end_character":34},"updated":"2016-08-08 15:42:15.000000000","message":"What if a port was bound on a host that *used to* have a compatible agent, but that agent has since been deleted?\n\nThe for loop won\u0027t iterate, and this method will return True. Will that be an issue?\n\nI think this is less tricky and should avoid the above problem:\n\n if not driver.agent_type:\n     return True\n else:\n     for agent in agents:\n         if driver.is_agent_compatible(agent[\u0027agent_type\u0027]):\n             return True\n     return False","commit_id":"cfbb27eaf11bf50aaacdc41603856d5217fbe44b"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"cf29566ba4095e9da4a6e5ab981fc711d1465c6d","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    if not is_interface_compatible:"},{"line_number":70,"context_line":"        return False"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    agents \u003d get_agents_by_host(context, binding_host)"},{"line_number":73,"context_line":"    for agent in agents:"},{"line_number":74,"context_line":"        if driver.is_agent_compatible(agent[\u0027agent_type\u0027]):"},{"line_number":75,"context_line":"            break"},{"line_number":76,"context_line":"    return is_interface_compatible"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"class TrunkPortValidator(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad45d7e_ec35a8f7","line":76,"range":{"start_line":72,"start_character":4,"end_line":76,"end_character":34},"in_reply_to":"9ad45d7e_a5890bcd","updated":"2016-08-08 18:07:09.000000000","message":"Yes, this is very corner-case indeed :) but IMO makes the for-loop easier to read.","commit_id":"cfbb27eaf11bf50aaacdc41603856d5217fbe44b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ca54f660026b222886254367518aa63655055be2","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    if not is_interface_compatible:"},{"line_number":70,"context_line":"        return False"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    agents \u003d get_agents_by_host(context, binding_host)"},{"line_number":73,"context_line":"    for agent in agents:"},{"line_number":74,"context_line":"        if driver.is_agent_compatible(agent[\u0027agent_type\u0027]):"},{"line_number":75,"context_line":"            break"},{"line_number":76,"context_line":"    return is_interface_compatible"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"class TrunkPortValidator(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad45d7e_368ffd24","line":76,"range":{"start_line":72,"start_character":4,"end_line":76,"end_character":34},"in_reply_to":"bacf61ea_bd0df090","updated":"2016-08-09 01:01:46.000000000","message":"Hang on, let me see if I understand the use correctly, because I am no longer sure your suggestion makes sense. Besides, if I were to write a test, I need to establish the preconditions.\n\nA port is bound with vif type F to host H. The host runs agent of type B now, but it used to run agent of type A, There are two registered drivers that both support F, and are agent-based and use agent of types A and B. One can support bound trunking the other cannot. Alternatively, the two registered drivers both support F but one is agent-based and the other isn\u0027t. Did I get it correctly? \n\nI think of both cases, the former case is hopeless, in that we cannot spot the conflict, for the latter, I suppose we can if we assumed to make the driver incompatible in case it\u0027s agentless, but only if we went from agent-based to agentless.","commit_id":"cfbb27eaf11bf50aaacdc41603856d5217fbe44b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3ca0f754973d7202203639288781f1c6b421f950","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    if not is_interface_compatible:"},{"line_number":70,"context_line":"        return False"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    agents \u003d get_agents_by_host(context, binding_host)"},{"line_number":73,"context_line":"    for agent in agents:"},{"line_number":74,"context_line":"        if driver.is_agent_compatible(agent[\u0027agent_type\u0027]):"},{"line_number":75,"context_line":"            break"},{"line_number":76,"context_line":"    return is_interface_compatible"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"class TrunkPortValidator(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad45d7e_a5890bcd","line":76,"range":{"start_line":72,"start_character":4,"end_line":76,"end_character":34},"in_reply_to":"bacf61ea_bd0df090","updated":"2016-08-08 16:15:47.000000000","message":"It won\u0027t hurt to be more defensive, though I consider this very corner case, because if an admin switches agents on a host and doesn\u0027t clean up the host record, he/she does deserve to be punished :)\n\nLet me look into your loop. We should still return based on whether on not the vif type is compliant.","commit_id":"cfbb27eaf11bf50aaacdc41603856d5217fbe44b"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d10f365e96f1a86216e05470697c8fb10f0eb7ad","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    if driver.agent_type:"},{"line_number":76,"context_line":"        for agent in get_agents_by_host(context, binding_host):"},{"line_number":77,"context_line":"            if driver.is_agent_compatible(agent[\u0027agent_type\u0027]):"},{"line_number":78,"context_line":"                break"},{"line_number":79,"context_line":"    return is_interface_compatible"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9ad45d7e_bbd3ad37","line":78,"updated":"2016-08-09 15:38:57.000000000","message":"did you mean to return something here or set is_interface_compatible ?","commit_id":"0bdab2abf1c75b4eb05b9d1147872f3accf957aa"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2f6ac2e7b54f75423b865fda818ad7c608027a95","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    if driver.agent_type:"},{"line_number":76,"context_line":"        for agent in get_agents_by_host(context, binding_host):"},{"line_number":77,"context_line":"            if driver.is_agent_compatible(agent[\u0027agent_type\u0027]):"},{"line_number":78,"context_line":"                break"},{"line_number":79,"context_line":"    return is_interface_compatible"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9ad45d7e_8a3014ea","line":78,"in_reply_to":"9ad45d7e_bbd3ad37","updated":"2016-08-09 16:02:22.000000000","message":"um...let me check this once more.","commit_id":"0bdab2abf1c75b4eb05b9d1147872f3accf957aa"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"55ed3c21e78d3b6d48c28471c00155414f7acfb3","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    # For agent-based drivers, check that both the interface and the agents are"},{"line_number":78,"context_line":"    # compatible."},{"line_number":79,"context_line":"    if is_interface_compatible:"},{"line_number":80,"context_line":"        for agent in get_agents_by_host(context, binding_host):"},{"line_number":81,"context_line":"            if driver.is_agent_compatible(agent[\u0027agent_type\u0027]):"},{"line_number":82,"context_line":"                return True"},{"line_number":83,"context_line":"    return False"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_cbb7a984","line":80,"updated":"2016-08-09 18:52:42.000000000","message":"make get_agents_by_host take the agent_type and use that in the filters passed into get_agents","commit_id":"5dacc618b1df207965a534ce7a82d9aa8c6794e6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f16588482b67b54fc6661a79f92b1a31b7bdca59","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    # For agent-based drivers, check that both the interface and the agents are"},{"line_number":78,"context_line":"    # compatible."},{"line_number":79,"context_line":"    if is_interface_compatible:"},{"line_number":80,"context_line":"        for agent in get_agents_by_host(context, binding_host):"},{"line_number":81,"context_line":"            if driver.is_agent_compatible(agent[\u0027agent_type\u0027]):"},{"line_number":82,"context_line":"                return True"},{"line_number":83,"context_line":"    return False"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_ae87e3d5","line":80,"in_reply_to":"9ad45d7e_cbb7a984","updated":"2016-08-09 19:14:16.000000000","message":"ack","commit_id":"5dacc618b1df207965a534ce7a82d9aa8c6794e6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"af378075aa41e9a4f988e8b065481c055fb62228","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        # associated to the driver itself."},{"line_number":108,"context_line":"        driver \u003d ["},{"line_number":109,"context_line":"            driver for driver in trunk_plugin.registered_drivers"},{"line_number":110,"context_line":"            if utils.is_driver_compatible("},{"line_number":111,"context_line":"                context, driver, vif_type, binding_host)"},{"line_number":112,"context_line":"        ]"},{"line_number":113,"context_line":"        if driver:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ad45d7e_73639942","line":110,"updated":"2016-08-11 17:08:34.000000000","message":"if my comment on next file makes sense, we don\u0027t need this method \"is_driver_compatible\", we could simply do:\n\ndriver \u003d [driver for driver in trunk_plugin.registered_drivers if driver.is_interface_compatible(vif_type)]","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4e27b2160c48974e4e6acba7d528f9f4fb10bc2","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        # associated to the driver itself."},{"line_number":108,"context_line":"        driver \u003d ["},{"line_number":109,"context_line":"            driver for driver in trunk_plugin.registered_drivers"},{"line_number":110,"context_line":"            if utils.is_driver_compatible("},{"line_number":111,"context_line":"                context, driver, vif_type, binding_host)"},{"line_number":112,"context_line":"        ]"},{"line_number":113,"context_line":"        if driver:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ad45d7e_7098a26a","line":110,"in_reply_to":"9ad45d7e_73639942","updated":"2016-08-11 21:09:57.000000000","message":"It does, but the logic here is correct, I believe.","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"af378075aa41e9a4f988e8b065481c055fb62228","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                context, driver, vif_type, binding_host)"},{"line_number":112,"context_line":"        ]"},{"line_number":113,"context_line":"        if driver:"},{"line_number":114,"context_line":"            # NOTE: there should never be more than one driver serving"},{"line_number":115,"context_line":"            # a given trunk port."},{"line_number":116,"context_line":"            return driver[0].can_trunk_bound_port"},{"line_number":117,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ad45d7e_10f7b359","line":114,"updated":"2016-08-11 17:08:34.000000000","message":"consider raising then?","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4e27b2160c48974e4e6acba7d528f9f4fb10bc2","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                context, driver, vif_type, binding_host)"},{"line_number":112,"context_line":"        ]"},{"line_number":113,"context_line":"        if driver:"},{"line_number":114,"context_line":"            # NOTE: there should never be more than one driver serving"},{"line_number":115,"context_line":"            # a given trunk port."},{"line_number":116,"context_line":"            return driver[0].can_trunk_bound_port"},{"line_number":117,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ad45d7e_f0e65242","line":114,"in_reply_to":"9ad45d7e_10f7b359","updated":"2016-08-11 21:09:57.000000000","message":"I am on the fence here; I can swing over one way or the other and I chose to be a little more permissive; if we want to be more cautious, then an exception is the way to go.","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"}],"neutron/services/trunk/utils.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"af378075aa41e9a4f988e8b065481c055fb62228","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    # compatible."},{"line_number":50,"context_line":"    return ("},{"line_number":51,"context_line":"        is_interface_compatible and"},{"line_number":52,"context_line":"        are_agent_types_available_on_host("},{"line_number":53,"context_line":"            context, [driver.agent_type], binding_host))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ad45d7e_b398716b","line":52,"range":{"start_line":52,"start_character":8,"end_line":52,"end_character":41},"updated":"2016-08-11 17:08:34.000000000","message":"why is this check needed? If the port is bound, I assume that there\u0027s an agent capable of handling that vif_type on that host. What am I missing?","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4e27b2160c48974e4e6acba7d528f9f4fb10bc2","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    # compatible."},{"line_number":50,"context_line":"    return ("},{"line_number":51,"context_line":"        is_interface_compatible and"},{"line_number":52,"context_line":"        are_agent_types_available_on_host("},{"line_number":53,"context_line":"            context, [driver.agent_type], binding_host))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ad45d7e_d0998e7a","line":52,"range":{"start_line":52,"start_character":8,"end_line":52,"end_character":41},"in_reply_to":"9ad45d7e_9ba61fac","updated":"2016-08-11 21:09:57.000000000","message":"@Rawlin: this check has nothing to do with your comment. Hopefully the explaination above cleared this up. I can keep this as a note in the code.","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"d3328e3a2211151321466e04700e5f0137a9a8e5","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    # compatible."},{"line_number":50,"context_line":"    return ("},{"line_number":51,"context_line":"        is_interface_compatible and"},{"line_number":52,"context_line":"        are_agent_types_available_on_host("},{"line_number":53,"context_line":"            context, [driver.agent_type], binding_host))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ad45d7e_9ba61fac","line":52,"range":{"start_line":52,"start_character":8,"end_line":52,"end_character":41},"in_reply_to":"9ad45d7e_b398716b","updated":"2016-08-11 18:33:20.000000000","message":"I had a comment on an earlier patch about the possibility of there being a bound port on a certain host where the port\u0027s corresponding agent has since been deleted. It\u0027s very edge-case, but this check is defensive.","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4e27b2160c48974e4e6acba7d528f9f4fb10bc2","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    # compatible."},{"line_number":50,"context_line":"    return ("},{"line_number":51,"context_line":"        is_interface_compatible and"},{"line_number":52,"context_line":"        are_agent_types_available_on_host("},{"line_number":53,"context_line":"            context, [driver.agent_type], binding_host))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ad45d7e_f0c77261","line":52,"range":{"start_line":52,"start_character":8,"end_line":52,"end_character":41},"in_reply_to":"9ad45d7e_b398716b","updated":"2016-08-11 21:09:57.000000000","message":"This logic stems from the fact that the way Neutron is architected we don\u0027t have a univocal mapping between VIF type and the Driver serving it, in that the same vif type can be supported by multiple drivers. Think about the situation where you have OVS and OVN in the same deployment. In order to uniquely identify the driver, you can\u0027t simply look at the vif type, and you need to look at whether the host to which the port is bound is actually managed by one driver or the other.","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"4edac331b4478722e1aa0da464c1189d80a94aa9","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    # compatible."},{"line_number":50,"context_line":"    return ("},{"line_number":51,"context_line":"        is_interface_compatible and"},{"line_number":52,"context_line":"        are_agent_types_available_on_host("},{"line_number":53,"context_line":"            context, [driver.agent_type], binding_host))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ad45d7e_a4177f43","line":52,"range":{"start_line":52,"start_character":8,"end_line":52,"end_character":41},"in_reply_to":"9ad45d7e_f0c77261","updated":"2016-08-11 21:23:53.000000000","message":"Aye, that makes sense.","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"2c1cf5449bef9e22bf06061d774cef681799d6e5","unresolved":false,"context_lines":[{"line_number":24,"context_line":"            [:constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def are_agent_types_available_on_host(context, agent_types, host):"},{"line_number":28,"context_line":"    \"\"\"Return true if agent types are present on the host.\"\"\""},{"line_number":29,"context_line":"    core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":30,"context_line":"    if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"}],"source_content_type":"text/x-python","patch_set":11,"id":"9ad45d7e_3c954588","line":27,"range":{"start_line":27,"start_character":18,"end_line":27,"end_character":19},"updated":"2016-08-12 10:40:01.000000000","message":"why plural, it seems we only have one agent_type","commit_id":"42f2ba88a58c04c0c119ec434acef2efe6589f06"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df14f415013044fcdd713f2055020f7774207902","unresolved":false,"context_lines":[{"line_number":24,"context_line":"            [:constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def are_agent_types_available_on_host(context, agent_types, host):"},{"line_number":28,"context_line":"    \"\"\"Return true if agent types are present on the host.\"\"\""},{"line_number":29,"context_line":"    core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":30,"context_line":"    if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"}],"source_content_type":"text/x-python","patch_set":11,"id":"9ad45d7e_422ac52d","line":27,"range":{"start_line":27,"start_character":18,"end_line":27,"end_character":19},"in_reply_to":"9ad45d7e_3c954588","updated":"2016-08-12 15:15:45.000000000","message":"because the filter can accept multiple agent types. Why restrict it, when it may be convenient later on? It was like this before, perhaps I should switch to hosts too since the filter can accept plurals for the host field too, but poteto, potato!","commit_id":"42f2ba88a58c04c0c119ec434acef2efe6589f06"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fa60e524c925d59d0e7f7b6536a0ef1e8a4abe12","unresolved":false,"context_lines":[{"line_number":24,"context_line":"            [:constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def are_agent_types_available_on_host(context, agent_types, host):"},{"line_number":28,"context_line":"    \"\"\"Return true if agent types are present on the host.\"\"\""},{"line_number":29,"context_line":"    core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":30,"context_line":"    if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"}],"source_content_type":"text/x-python","patch_set":11,"id":"9ad45d7e_e6b5c431","line":27,"range":{"start_line":27,"start_character":18,"end_line":27,"end_character":19},"in_reply_to":"9ad45d7e_422ac52d","updated":"2016-08-12 17:16:13.000000000","message":"Um, I think I understand now...let me do that a follow up?","commit_id":"42f2ba88a58c04c0c119ec434acef2efe6589f06"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"2c1cf5449bef9e22bf06061d774cef681799d6e5","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    # same deployment. In order to uniquely identify the driver, we cannot"},{"line_number":49,"context_line":"    # simply look at the vif type, and we need to look at whether the host"},{"line_number":50,"context_line":"    # to which the port is bound is actually managed by one driver or the"},{"line_number":51,"context_line":"    # other."},{"line_number":52,"context_line":"    is_interface_compatible \u003d driver.is_interface_compatible(interface)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    # For an agentless driver, only interface compatibility is required."}],"source_content_type":"text/x-python","patch_set":11,"id":"9ad45d7e_1c5a0151","line":51,"updated":"2016-08-12 10:40:01.000000000","message":"I see the point now. With the current code for every driver we are querying the db to see if an agent of type driver.agent_type is running on that host. Anyway since the port is bound and we already know which agent has bound it, wouldn\u0027t it be more reasonable to query the db only once to get the agent_type of the agent that bound the port and then loop through the drivers to see which driver is compatible with the agent_type?","commit_id":"42f2ba88a58c04c0c119ec434acef2efe6589f06"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df14f415013044fcdd713f2055020f7774207902","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    # same deployment. In order to uniquely identify the driver, we cannot"},{"line_number":49,"context_line":"    # simply look at the vif type, and we need to look at whether the host"},{"line_number":50,"context_line":"    # to which the port is bound is actually managed by one driver or the"},{"line_number":51,"context_line":"    # other."},{"line_number":52,"context_line":"    is_interface_compatible \u003d driver.is_interface_compatible(interface)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    # For an agentless driver, only interface compatibility is required."}],"source_content_type":"text/x-python","patch_set":11,"id":"9ad45d7e_823b1d38","line":51,"in_reply_to":"9ad45d7e_1c5a0151","updated":"2016-08-12 15:15:45.000000000","message":"If you tell me how we get to know the agent type by the binding details I\u0027d love to do it, but from what I can tell, I don\u0027t have that unless I join agent and host, etc which means not using the plugin API. Besides how many drivers do we need to have in the deployment for this to be a practical problem?\n\n +-------------+---------------+------+-----+---------+-------+\n | Field       | Type          | Null | Key | Default | Extra | \n +-------------+---------------+------+-----+---------+-------+\n | port_id     | varchar(36)   | NO   | PRI | NULL    |       |\n | host        | varchar(255)  | NO   |     |         |       |\n | vif_type    | varchar(64)   | NO   |     | NULL    |       |\n | vnic_type   | varchar(64)   | NO   |     | normal  |       |\n | profile     | varchar(4095) | NO   |     |         |       |\n | vif_details | varchar(4095) | NO   |     |         |       |\n +-------------+---------------+------+-----+---------+-------+","commit_id":"42f2ba88a58c04c0c119ec434acef2efe6589f06"}],"neutron/tests/unit/services/trunk/fakes.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ca3058ffac1d00a50552804a1e594c127d23cc6b","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    @classmethod"},{"line_number":35,"context_line":"    def create(cls):"},{"line_number":36,"context_line":"        return FakeDriver(\u0027foo_name2\u0027, (\u0027foo_intf2\u0027,), (\u0027foo_seg_types\u0027,))"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"class FakeDriverCanTrunkBoundPort(base.DriverBase):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_d6bcd7dd","line":36,"updated":"2016-08-12 04:46:41.000000000","message":"FakeDriver2\n\nI think in general it would be safer in these creates if you use the passed in cls variable.","commit_id":"05b373145e0c3a2e5a21e6df53a9b4a67304e44b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"eaf1a18f491f7946c722e104f577a7b2a106593f","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    @classmethod"},{"line_number":35,"context_line":"    def create(cls):"},{"line_number":36,"context_line":"        return FakeDriver(\u0027foo_name2\u0027, (\u0027foo_intf2\u0027,), (\u0027foo_seg_types\u0027,))"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"class FakeDriverCanTrunkBoundPort(base.DriverBase):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_d62e9741","line":36,"updated":"2016-08-12 04:44:21.000000000","message":"FakeDrivers2","commit_id":"05b373145e0c3a2e5a21e6df53a9b4a67304e44b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0465d9a12a2064e7976683cc577d98d788f13065","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    @classmethod"},{"line_number":35,"context_line":"    def create(cls):"},{"line_number":36,"context_line":"        return FakeDriver(\u0027foo_name2\u0027, (\u0027foo_intf2\u0027,), (\u0027foo_seg_types\u0027,))"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"class FakeDriverCanTrunkBoundPort(base.DriverBase):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_96c7ff62","line":36,"in_reply_to":"9ad45d7e_d6bcd7dd","updated":"2016-08-12 04:47:44.000000000","message":"good point","commit_id":"05b373145e0c3a2e5a21e6df53a9b4a67304e44b"}],"neutron/tests/unit/services/trunk/test_rules.py":[{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"e51b5560da7e4667a4b050e1d638bd3b9848c071","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            port[\u0027port\u0027][\u0027binding:host_id\u0027] \u003d \u0027host\u0027"},{"line_number":194,"context_line":"            core_plugin.update_port(self.context, port[\u0027port\u0027][\u0027id\u0027], port)"},{"line_number":195,"context_line":"            validator \u003d rules.TrunkPortValidator(port[\u0027port\u0027][\u0027id\u0027])"},{"line_number":196,"context_line":"            # port cannot be trunked because of binding mismatch"},{"line_number":197,"context_line":"            self.assertFalse(validator.can_be_trunked(self.context))"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def test_can_be_trunked_returns_true(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ad45d7e_1e9e9db8","line":196,"range":{"start_line":196,"start_character":12,"end_line":196,"end_character":64},"updated":"2016-08-11 19:11:04.000000000","message":"Is this because the port doesn\u0027t get a vif_type due to the actual portbinding process not occurring?","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4e27b2160c48974e4e6acba7d528f9f4fb10bc2","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            port[\u0027port\u0027][\u0027binding:host_id\u0027] \u003d \u0027host\u0027"},{"line_number":194,"context_line":"            core_plugin.update_port(self.context, port[\u0027port\u0027][\u0027id\u0027], port)"},{"line_number":195,"context_line":"            validator \u003d rules.TrunkPortValidator(port[\u0027port\u0027][\u0027id\u0027])"},{"line_number":196,"context_line":"            # port cannot be trunked because of binding mismatch"},{"line_number":197,"context_line":"            self.assertFalse(validator.can_be_trunked(self.context))"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def test_can_be_trunked_returns_true(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ad45d7e_f075b231","line":196,"range":{"start_line":196,"start_character":12,"end_line":196,"end_character":64},"in_reply_to":"9ad45d7e_1e9e9db8","updated":"2016-08-11 21:09:57.000000000","message":"ya-ha, the vif_type is binding_failed.","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"4edac331b4478722e1aa0da464c1189d80a94aa9","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            port[\u0027port\u0027][\u0027binding:host_id\u0027] \u003d \u0027host\u0027"},{"line_number":194,"context_line":"            core_plugin.update_port(self.context, port[\u0027port\u0027][\u0027id\u0027], port)"},{"line_number":195,"context_line":"            validator \u003d rules.TrunkPortValidator(port[\u0027port\u0027][\u0027id\u0027])"},{"line_number":196,"context_line":"            # port cannot be trunked because of binding mismatch"},{"line_number":197,"context_line":"            self.assertFalse(validator.can_be_trunked(self.context))"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def test_can_be_trunked_returns_true(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ad45d7e_4457a3c9","line":196,"range":{"start_line":196,"start_character":12,"end_line":196,"end_character":64},"in_reply_to":"9ad45d7e_f075b231","updated":"2016-08-11 21:23:53.000000000","message":"ok right, I knew it fails without an OVS agent registered for instance, but I didn\u0027t realize it gets \u0027binding_failed\u0027 as the vif_type in the UTs. That\u0027s good to know.","commit_id":"fbd87f0a70aed95e885255df63dbb0c92b104d9b"}]}
