)]}'
{"neutron/callbacks/resources.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c362edd7f7c4a02f98da0d1c310d8c6c54a641bc","unresolved":false,"context_lines":[{"line_number":31,"context_line":"SUBNET_GATEWAY \u003d \u0027subnet_gateway\u0027"},{"line_number":32,"context_line":"SUBNETPOOL_ADDRESS_SCOPE \u003d \u0027subnetpool_address_scope\u0027"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"# String literals representing other resources."},{"line_number":35,"context_line":"# callback resource for notifying to ovsdb handler"},{"line_number":36,"context_line":"OVSDB \u003d \u0027ovsdb\u0027"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_01095d31","line":34,"updated":"2016-09-06 15:34:19.000000000","message":"please put it back to where it was, we\u0027re trying to be cohesive and keep everything close to where it\u0027s used. OVSDB is not as pervasive as the other resources.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7a42a35f55c1273498495395d8c4b8215ad59489","unresolved":false,"context_lines":[{"line_number":31,"context_line":"SUBNET_GATEWAY \u003d \u0027subnet_gateway\u0027"},{"line_number":32,"context_line":"SUBNETPOOL_ADDRESS_SCOPE \u003d \u0027subnetpool_address_scope\u0027"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"# String literals representing other resources."},{"line_number":35,"context_line":"# callback resource for notifying to ovsdb handler"},{"line_number":36,"context_line":"OVSDB \u003d \u0027ovsdb\u0027"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_65d4f446","line":34,"in_reply_to":"9a89bdaa_01095d31","updated":"2016-09-06 15:35:45.000000000","message":"Don\u0027t respin just yet. Please give me a chance to have a thorough review.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":31,"context_line":"SUBNET_GATEWAY \u003d \u0027subnet_gateway\u0027"},{"line_number":32,"context_line":"SUBNETPOOL_ADDRESS_SCOPE \u003d \u0027subnetpool_address_scope\u0027"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"# String literals representing other resources."},{"line_number":35,"context_line":"# callback resource for notifying to ovsdb handler"},{"line_number":36,"context_line":"OVSDB \u003d \u0027ovsdb\u0027"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_6e085192","line":34,"in_reply_to":"9a89bdaa_65d4f446","updated":"2016-09-06 16:59:33.000000000","message":"We have other callback resources introduced for trunks. I think it\u0027s better if they stay local to the trunk module or closer to where they are applied (see [1] for other examples). Historically, string literals have always been added to a \u0027constants\u0027, module. If we want to relocate those into a \u0027resources\u0027 module under the module of use (e.g. \u0027trunk\u0027 or openvswitch), perhaps that improves both readability and cohesiveness, but it goes beyond the scope of the patch obviously. As for this one, I\u0027d avoid to make this module bloat with a set of incohesive resources.\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/services/trunk/constants.py#L65","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a3c086bdb0e82cb1331f8dc530677a36ee685fc0","unresolved":false,"context_lines":[{"line_number":31,"context_line":"SUBNET_GATEWAY \u003d \u0027subnet_gateway\u0027"},{"line_number":32,"context_line":"SUBNETPOOL_ADDRESS_SCOPE \u003d \u0027subnetpool_address_scope\u0027"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"# String literals representing other resources."},{"line_number":35,"context_line":"# callback resource for notifying to ovsdb handler"},{"line_number":36,"context_line":"OVSDB \u003d \u0027ovsdb\u0027"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_5a642348","line":34,"in_reply_to":"9a89bdaa_6e085192","updated":"2016-09-06 19:29:28.000000000","message":"Done","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"}],"neutron/plugins/ml2/drivers/openvswitch/agent/common/constants.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"42abe8df7addda6c34710c943d73ac5ca1d13c3a","unresolved":false,"context_lines":[{"line_number":147,"context_line":"OVS_BRIDGE_NAME \u003d \u0027ovs_bridge_name\u0027"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"# callback resource for notifying to ovsdb handler"},{"line_number":150,"context_line":"OVSDB_RESOURCE \u003d \u0027ovsdb\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a89bdaa_e1980b1e","line":150,"updated":"2016-09-06 11:08:25.000000000","message":"why is this not in the callback resources? What happens if and when the callbacks are finally moved to the neutron-lib. Will this cause a random breakage?","commit_id":"8aee36332e520b4cdda15d841f709478e485033a"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"037429e2c44dabdf567bdeed9cb70a5ec8636165","unresolved":false,"context_lines":[{"line_number":147,"context_line":"OVS_BRIDGE_NAME \u003d \u0027ovs_bridge_name\u0027"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"# callback resource for notifying to ovsdb handler"},{"line_number":150,"context_line":"OVSDB_RESOURCE \u003d \u0027ovsdb\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a89bdaa_73bbece5","line":150,"in_reply_to":"9a89bdaa_e1980b1e","updated":"2016-09-06 11:55:33.000000000","message":"Done","commit_id":"8aee36332e520b4cdda15d841f709478e485033a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":146,"context_line":"# callback resource for setting \u0027bridge_name\u0027 in the \u0027binding:vif_details\u0027"},{"line_number":147,"context_line":"OVS_BRIDGE_NAME \u003d \u0027ovs_bridge_name\u0027"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"# callback resource for notifying to ovsdb handler"},{"line_number":150,"context_line":"OVSDB_RESOURCE \u003d \u0027ovsdb\u0027"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_dc38eea2","line":149,"updated":"2016-09-07 18:55:51.000000000","message":"I am ok with these here for now, we can find them a better home later on.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"}],"neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"bf13235ba92cba2ca902e5e9bd47ad7914c11619","unresolved":false,"context_lines":[{"line_number":1871,"context_line":"                                          updated_ports_copy))"},{"line_number":1872,"context_line":"            ports_to_ignore \u003d (port_info[\u0027current\u0027] |"},{"line_number":1873,"context_line":"                               ancillary_port_info[\u0027current\u0027])"},{"line_number":1874,"context_line":"            #TODO(rossella_s): need to define a new event?"},{"line_number":1875,"context_line":"            registry.notify("},{"line_number":1876,"context_line":"                OVSDB_RESOURCE,"},{"line_number":1877,"context_line":"                callback_events.AFTER_READ,"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_0247e977","line":1874,"updated":"2016-08-03 21:04:48.000000000","message":"How is AFTER_READ insufficient? Seems like it fits nicely.","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"87d99a7efe75a8ff7297cf9bcac1acfa172bf0e9","unresolved":false,"context_lines":[{"line_number":1871,"context_line":"                                          updated_ports_copy))"},{"line_number":1872,"context_line":"            ports_to_ignore \u003d (port_info[\u0027current\u0027] |"},{"line_number":1873,"context_line":"                               ancillary_port_info[\u0027current\u0027])"},{"line_number":1874,"context_line":"            #TODO(rossella_s): need to define a new event?"},{"line_number":1875,"context_line":"            registry.notify("},{"line_number":1876,"context_line":"                OVSDB_RESOURCE,"},{"line_number":1877,"context_line":"                callback_events.AFTER_READ,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_a72bcb93","line":1874,"in_reply_to":"bacf61ea_0247e977","updated":"2016-08-12 16:58:37.000000000","message":"Done","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"cd7c0be0fc887ad4fa07aa493f8eb972cc1996af","unresolved":false,"context_lines":[{"line_number":1876,"context_line":"                OVSDB_RESOURCE,"},{"line_number":1877,"context_line":"                callback_events.AFTER_READ,"},{"line_number":1878,"context_line":"                self,"},{"line_number":1879,"context_line":"                ovsdb_events\u003d(polling_manager.get_last_round_events()),"},{"line_number":1880,"context_line":"                lvid\u003dself.local_vlan_map,"},{"line_number":1881,"context_line":"                ports_to_ignore\u003dports_to_ignore)"},{"line_number":1882,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_ba767403","line":1879,"range":{"start_line":1879,"start_character":46,"end_line":1879,"end_character":67},"updated":"2016-08-11 22:09:16.000000000","message":"I\u0027m not able to find this method on the polling_manager. Is this a new method to be implemented or should this just be events from L1865?","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"87d99a7efe75a8ff7297cf9bcac1acfa172bf0e9","unresolved":false,"context_lines":[{"line_number":1876,"context_line":"                OVSDB_RESOURCE,"},{"line_number":1877,"context_line":"                callback_events.AFTER_READ,"},{"line_number":1878,"context_line":"                self,"},{"line_number":1879,"context_line":"                ovsdb_events\u003d(polling_manager.get_last_round_events()),"},{"line_number":1880,"context_line":"                lvid\u003dself.local_vlan_map,"},{"line_number":1881,"context_line":"                ports_to_ignore\u003dports_to_ignore)"},{"line_number":1882,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_07173755","line":1879,"range":{"start_line":1879,"start_character":46,"end_line":1879,"end_character":67},"in_reply_to":"9ad45d7e_ba767403","updated":"2016-08-12 16:58:37.000000000","message":"Done","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"73f92469ce8f7fff18b8df109dbbacb958f44a07","unresolved":false,"context_lines":[{"line_number":2020,"context_line":"                              {\u0027iter_num\u0027: self.iter_num,"},{"line_number":2021,"context_line":"                               \u0027elapsed\u0027: time.time() - start})"},{"line_number":2022,"context_line":"                    if sync:"},{"line_number":2023,"context_line":"                        registry.notify(resources.AGENT,"},{"line_number":2024,"context_line":"                                        RESYNC_EVENT,"},{"line_number":2025,"context_line":"                                        self)"},{"line_number":2026,"context_line":"                    # Save updated ports dict to perform rollback in"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_78ede98a","line":2023,"range":{"start_line":2023,"start_character":40,"end_line":2023,"end_character":49},"updated":"2016-08-08 21:32:11.000000000","message":"See https://review.openstack.org/#/c/347466/1/neutron/services/trunk/drivers/openvswitch/agent/ovsdb_handler.py and L43 above. I think this is the wrong resources import. This should reference resources from neutron.callbacks.","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"228b8ea1c6a1b24e456e7319542d8336af1bf897","unresolved":false,"context_lines":[{"line_number":1873,"context_line":"                OVSDB_RESOURCE,"},{"line_number":1874,"context_line":"                callback_events.AFTER_READ,"},{"line_number":1875,"context_line":"                self,"},{"line_number":1876,"context_line":"                ovsdb_events\u003d(polling_manager.get_last_round_events()),"},{"line_number":1877,"context_line":"                ports_to_ignore\u003dports_to_ignore)"},{"line_number":1878,"context_line":""},{"line_number":1879,"context_line":"        return (port_info, ancillary_port_info, consecutive_resyncs,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ac371cc_8be7ce3f","line":1876,"updated":"2016-08-14 11:27:32.000000000","message":"do we need the extra brackets here?","commit_id":"b0ecd41051b901fe3d062b005b9bddd18b37602e"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a8ffd37c99baadb2843ca74e2936ce59a292f9d0","unresolved":false,"context_lines":[{"line_number":1873,"context_line":"                OVSDB_RESOURCE,"},{"line_number":1874,"context_line":"                callback_events.AFTER_READ,"},{"line_number":1875,"context_line":"                self,"},{"line_number":1876,"context_line":"                ovsdb_events\u003d(polling_manager.get_last_round_events()),"},{"line_number":1877,"context_line":"                ports_to_ignore\u003dports_to_ignore)"},{"line_number":1878,"context_line":""},{"line_number":1879,"context_line":"        return (port_info, ancillary_port_info, consecutive_resyncs,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_ae5b2df5","line":1876,"updated":"2016-08-23 01:35:21.000000000","message":"I am thinking that if we use \u0027events\u0027 variable we may not need get_last_round_events() after all.","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fbb109dc1c8a7be74c4e8384fd7173d4089f79b6","unresolved":false,"context_lines":[{"line_number":1873,"context_line":"                OVSDB_RESOURCE,"},{"line_number":1874,"context_line":"                callback_events.AFTER_READ,"},{"line_number":1875,"context_line":"                self,"},{"line_number":1876,"context_line":"                ovsdb_events\u003d(polling_manager.get_last_round_events()),"},{"line_number":1877,"context_line":"                ports_to_ignore\u003dports_to_ignore)"},{"line_number":1878,"context_line":""},{"line_number":1879,"context_line":"        return (port_info, ancillary_port_info, consecutive_resyncs,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_3bf25d07","line":1876,"in_reply_to":"1ac06dbe_ae5b2df5","updated":"2016-08-24 15:51:21.000000000","message":"I was thinking that too :)","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":1873,"context_line":"                callback_resources.OVSDB,"},{"line_number":1874,"context_line":"                callback_events.AFTER_READ,"},{"line_number":1875,"context_line":"                self,"},{"line_number":1876,"context_line":"                ovsdb_events\u003devents)"},{"line_number":1877,"context_line":""},{"line_number":1878,"context_line":"        return (port_info, ancillary_port_info, consecutive_resyncs,"},{"line_number":1879,"context_line":"                ports_not_ready_yet)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_ce6ebd2e","line":1876,"updated":"2016-09-06 16:59:33.000000000","message":"just a thought: in case \u0027events\u0027 gets mutated by other threads, should we make a deepcopy here before passing it on? It\u0027s probably overly cautious, but better safe than sorry?  What do you think?","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a3c086bdb0e82cb1331f8dc530677a36ee685fc0","unresolved":false,"context_lines":[{"line_number":1873,"context_line":"                callback_resources.OVSDB,"},{"line_number":1874,"context_line":"                callback_events.AFTER_READ,"},{"line_number":1875,"context_line":"                self,"},{"line_number":1876,"context_line":"                ovsdb_events\u003devents)"},{"line_number":1877,"context_line":""},{"line_number":1878,"context_line":"        return (port_info, ancillary_port_info, consecutive_resyncs,"},{"line_number":1879,"context_line":"                ports_not_ready_yet)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_fa07b719","line":1876,"in_reply_to":"9a89bdaa_ce6ebd2e","updated":"2016-09-06 19:29:28.000000000","message":"By other threads you mean subscribers? If we\u0027d pass a deepcopy here and first subscriber modifies events, other subscribers will get modified events anyway, won\u0027t they?","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"441414048349fbacbc3611576d779ebd3dbc4cf7","unresolved":false,"context_lines":[{"line_number":1873,"context_line":"                callback_resources.OVSDB,"},{"line_number":1874,"context_line":"                callback_events.AFTER_READ,"},{"line_number":1875,"context_line":"                self,"},{"line_number":1876,"context_line":"                ovsdb_events\u003devents)"},{"line_number":1877,"context_line":""},{"line_number":1878,"context_line":"        return (port_info, ancillary_port_info, consecutive_resyncs,"},{"line_number":1879,"context_line":"                ports_not_ready_yet)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_1d837057","line":1876,"in_reply_to":"9a89bdaa_fa07b719","updated":"2016-09-06 19:53:17.000000000","message":"Just to be sure, let me state first that subscribers are not meant to modify the payload, otherwise that may cause side effects as callbacks could unintentionally interfere with one another. I made this comment thinking about the existing codepath of the OVS agent, where \u0027events\u0027 may be changed without callbacks knowing.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":1872,"context_line":"                constants.OVSDB_RESOURCE,"},{"line_number":1873,"context_line":"                callback_events.AFTER_READ,"},{"line_number":1874,"context_line":"                self,"},{"line_number":1875,"context_line":"                ovsdb_events\u003devents)"},{"line_number":1876,"context_line":""},{"line_number":1877,"context_line":"        return (port_info, ancillary_port_info, consecutive_resyncs,"},{"line_number":1878,"context_line":"                ports_not_ready_yet)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_9c6ae67f","line":1875,"updated":"2016-09-07 18:55:51.000000000","message":"did you give any thought to what I said in PS16 and finally ruled out that the deepcopy was not necessary?","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":1872,"context_line":"                constants.OVSDB_RESOURCE,"},{"line_number":1873,"context_line":"                callback_events.AFTER_READ,"},{"line_number":1874,"context_line":"                self,"},{"line_number":1875,"context_line":"                ovsdb_events\u003devents)"},{"line_number":1876,"context_line":""},{"line_number":1877,"context_line":"        return (port_info, ancillary_port_info, consecutive_resyncs,"},{"line_number":1878,"context_line":"                ports_not_ready_yet)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_faf4d25b","line":1875,"in_reply_to":"9a89bdaa_9c6ae67f","updated":"2016-09-08 14:16:27.000000000","message":"I went through code and I don\u0027t see where we could modify it concurrently.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"}],"neutron/services/trunk/constants.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a8ffd37c99baadb2843ca74e2936ce59a292f9d0","unresolved":false,"context_lines":[{"line_number":25,"context_line":"# the trunk resources (i.e. adding/removing sub-ports)."},{"line_number":26,"context_line":"ACTIVE_STATUS \u003d \u0027ACTIVE\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"# The trunk is down, the VM that was using the trunk was deleted"},{"line_number":29,"context_line":"DOWN_STATUS \u003d \u0027DOWN\u0027"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"# The server has acknowledged the user request: a user has asked to either"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_2e161df1","line":28,"updated":"2016-08-23 01:35:21.000000000","message":"Um, this is an interesting state. I wonder why we would make a distinction between a trunk that has never been instantiated and a trunk that has been instantiated (i.e. associated to a VM only temporarily).\n\nLet me think about this a bit more, perhaps we can simply consider an unbound trunk still in ACTIVE state.","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"d94895e7c63a1c3d5262eb420298080a5cabf07e","unresolved":false,"context_lines":[{"line_number":65,"context_line":"SUBPORTS \u003d \u0027subports\u0027"},{"line_number":66,"context_line":"TRUNK \u003d \u0027trunk\u0027"},{"line_number":67,"context_line":"TRUNK_PLUGIN \u003d \u0027trunk_plugin\u0027"},{"line_number":68,"context_line":"TRUNK_BRIDGE_PREFIX \u003d \u0027tbr-\u0027"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"# String literals for segmentation types"}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_1c9c5e68","line":68,"range":{"start_line":68,"start_character":0,"end_line":68,"end_character":28},"updated":"2016-08-16 17:01:01.000000000","message":"This constant already exists in neutron.services.trunk.drivers.openvswitch.constants","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"3a0d7906baf3794789fc6c2f4d4491da390e4cb9","unresolved":false,"context_lines":[{"line_number":65,"context_line":"SUBPORTS \u003d \u0027subports\u0027"},{"line_number":66,"context_line":"TRUNK \u003d \u0027trunk\u0027"},{"line_number":67,"context_line":"TRUNK_PLUGIN \u003d \u0027trunk_plugin\u0027"},{"line_number":68,"context_line":"TRUNK_BRIDGE_PREFIX \u003d \u0027tbr-\u0027"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"# String literals for segmentation types"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_29109c56","line":68,"range":{"start_line":68,"start_character":0,"end_line":68,"end_character":28},"in_reply_to":"3ac371cc_1c9c5e68","updated":"2016-08-23 18:34:39.000000000","message":"Done","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e2d38acdad52fa85a6f5118e65b6556cd283b45","unresolved":false,"context_lines":[{"line_number":25,"context_line":"# the trunk resources (i.e. adding/removing sub-ports)."},{"line_number":26,"context_line":"ACTIVE_STATUS \u003d \u0027ACTIVE\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"# The trunk is down, the VM that was using the trunk was deleted"},{"line_number":29,"context_line":"DOWN_STATUS \u003d \u0027DOWN\u0027"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"# The server has acknowledged the user request: a user has asked to either"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_f711bfb0","line":28,"updated":"2016-08-31 23:36:23.000000000","message":"Since [1], we don\u0027t need this anymore. I am actually surprised we didn\u0027t get a merge conflict.\n\n[1] https://review.openstack.org/#/c/356134/","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":25,"context_line":"# the trunk resources (i.e. adding/removing sub-ports)."},{"line_number":26,"context_line":"ACTIVE_STATUS \u003d \u0027ACTIVE\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"# The trunk is down, the VM that was using the trunk was deleted"},{"line_number":29,"context_line":"DOWN_STATUS \u003d \u0027DOWN\u0027"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"# The server has acknowledged the user request: a user has asked to either"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_5968ce21","line":28,"in_reply_to":"fa7ab95a_f711bfb0","updated":"2016-09-01 10:02:33.000000000","message":"Done","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"}],"neutron/services/trunk/drivers/openvswitch/agent/driver.py":[{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"8507f6e1ca9b6b8ba83666c33b44697a9da041ad","unresolved":false,"context_lines":[{"line_number":25,"context_line":"class OVSTrunkSkeleton(agent.TrunkSkeleton):"},{"line_number":26,"context_line":"    \"\"\"It processes Neutron Server events to create the physical resources"},{"line_number":27,"context_line":"    associated to a logical trunk in response to user initiated API events"},{"line_number":28,"context_line":"    (such as  trunk subport add/remove). It collaborates with the OVSDBHandler"},{"line_number":29,"context_line":"    to implement the trunk control plane."},{"line_number":30,"context_line":"    \"\"\""},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9a89bdaa_54d265d3","line":28,"range":{"start_line":28,"start_character":12,"end_line":28,"end_character":15},"updated":"2016-09-06 05:49:14.000000000","message":"double space","commit_id":"78515b0aa8c3cae5b84ee030b75d8e4b3a03ee97"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"641d0edf2ad024cf963205b0cea216591ff8e5b5","unresolved":false,"context_lines":[{"line_number":25,"context_line":"class OVSTrunkSkeleton(agent.TrunkSkeleton):"},{"line_number":26,"context_line":"    \"\"\"It processes Neutron Server events to create the physical resources"},{"line_number":27,"context_line":"    associated to a logical trunk in response to user initiated API events"},{"line_number":28,"context_line":"    (such as  trunk subport add/remove). It collaborates with the OVSDBHandler"},{"line_number":29,"context_line":"    to implement the trunk control plane."},{"line_number":30,"context_line":"    \"\"\""},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9a89bdaa_097283ad","line":28,"range":{"start_line":28,"start_character":12,"end_line":28,"end_character":15},"in_reply_to":"9a89bdaa_54d265d3","updated":"2016-09-06 07:31:46.000000000","message":"Done","commit_id":"78515b0aa8c3cae5b84ee030b75d8e4b3a03ee97"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"776635575062aaafe496c4c47158fdf095d30709","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    # make this setup conditional based on server-side capabilities."},{"line_number":53,"context_line":"    global TRUNK_SKELETON"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    manager \u003d trunk_manager.TrunkManager(agent.br_int)"},{"line_number":56,"context_line":"    handler \u003d ovsdb_handler.OVSDBHandler(manager)"},{"line_number":57,"context_line":"    TRUNK_SKELETON \u003d OVSTrunkSkeleton(handler)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_23b812c8","line":55,"range":{"start_line":55,"start_character":41,"end_line":55,"end_character":53},"updated":"2016-09-06 23:38:38.000000000","message":"This should be agent.int_br:\n\n AttributeError: \u0027OVSNeutronAgent\u0027 object has no attribute \u0027br_int\u0027","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f83cc68e142a067fbf99c92b12073ac1c492c6fc","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    # make this setup conditional based on server-side capabilities."},{"line_number":53,"context_line":"    global TRUNK_SKELETON"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    manager \u003d trunk_manager.TrunkManager(agent.br_int)"},{"line_number":56,"context_line":"    handler \u003d ovsdb_handler.OVSDBHandler(manager)"},{"line_number":57,"context_line":"    TRUNK_SKELETON \u003d OVSTrunkSkeleton(handler)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_1fdb2850","line":55,"range":{"start_line":55,"start_character":41,"end_line":55,"end_character":53},"in_reply_to":"9a89bdaa_11a898da","updated":"2016-09-07 18:30:49.000000000","message":"It would be nice have a property called \u0027integration_bridge\u0027 thus to avoid confusion br_int (data plane name) vs int_br (programmatic name).","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"14ad75a96ff81f46763b1cade4fde1516b406414","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    # make this setup conditional based on server-side capabilities."},{"line_number":53,"context_line":"    global TRUNK_SKELETON"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    manager \u003d trunk_manager.TrunkManager(agent.br_int)"},{"line_number":56,"context_line":"    handler \u003d ovsdb_handler.OVSDBHandler(manager)"},{"line_number":57,"context_line":"    TRUNK_SKELETON \u003d OVSTrunkSkeleton(handler)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_7fda74e9","line":55,"range":{"start_line":55,"start_character":41,"end_line":55,"end_character":53},"in_reply_to":"9a89bdaa_1fdb2850","updated":"2016-09-07 18:39:50.000000000","message":"\u003e integration_bridge\n\nI\u0027d +1 that, but should be handled outside this patch of course.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"20f1846a02bb6c8bde772d1d26229867a08a5ce7","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    # make this setup conditional based on server-side capabilities."},{"line_number":53,"context_line":"    global TRUNK_SKELETON"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    manager \u003d trunk_manager.TrunkManager(agent.br_int)"},{"line_number":56,"context_line":"    handler \u003d ovsdb_handler.OVSDBHandler(manager)"},{"line_number":57,"context_line":"    TRUNK_SKELETON \u003d OVSTrunkSkeleton(handler)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_23f01267","line":55,"range":{"start_line":55,"start_character":41,"end_line":55,"end_character":53},"in_reply_to":"9a89bdaa_23b812c8","updated":"2016-09-06 23:49:32.000000000","message":"I have been thinking that it\u0027s probably best this is wrapped into a property to make public access more robust!","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ef2e19cc7493910e8f91b593da1c0c3288bea430","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    # make this setup conditional based on server-side capabilities."},{"line_number":53,"context_line":"    global TRUNK_SKELETON"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    manager \u003d trunk_manager.TrunkManager(agent.br_int)"},{"line_number":56,"context_line":"    handler \u003d ovsdb_handler.OVSDBHandler(manager)"},{"line_number":57,"context_line":"    TRUNK_SKELETON \u003d OVSTrunkSkeleton(handler)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_11a898da","line":55,"range":{"start_line":55,"start_character":41,"end_line":55,"end_character":53},"in_reply_to":"9a89bdaa_23f01267","updated":"2016-09-07 11:57:01.000000000","message":"You mean supporting both? I think programmer should know what attribute he needs to use. Shame on me, we need better tests.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77067252c91cce284fa36bf02eb393d0638ad979","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    # make this setup conditional based on server-side capabilities."},{"line_number":53,"context_line":"    global TRUNK_SKELETON"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    manager \u003d trunk_manager.TrunkManager(agent.br_int)"},{"line_number":56,"context_line":"    handler \u003d ovsdb_handler.OVSDBHandler(manager)"},{"line_number":57,"context_line":"    TRUNK_SKELETON \u003d OVSTrunkSkeleton(handler)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_9b0bc37c","line":55,"range":{"start_line":55,"start_character":41,"end_line":55,"end_character":53},"in_reply_to":"9a89bdaa_7fda74e9","updated":"2016-09-07 22:13:28.000000000","message":"https://review.openstack.org/#/c/367011/","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"}],"neutron/services/trunk/drivers/openvswitch/agent/ovsdb_handler.py":[{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"cf42c29ca7017739c03dfe8a789f4601c29cb819","unresolved":false,"context_lines":[{"line_number":26,"context_line":"class OVSDBHandler(object):"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def __init__(self):"},{"line_number":29,"context_line":"        super(OVSDBHandler, self).__init__()"},{"line_number":30,"context_line":"        registry.subscribe(self.process_trunk_ports,"},{"line_number":31,"context_line":"                           ovs_neutron_agent.OVSDB_RESOURCE,"},{"line_number":32,"context_line":"                           events.AFTER_READ)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_3fc5e63c","line":29,"range":{"start_line":29,"start_character":8,"end_line":29,"end_character":44},"updated":"2016-08-03 20:12:31.000000000","message":"this isn\u0027t needed","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"87d99a7efe75a8ff7297cf9bcac1acfa172bf0e9","unresolved":false,"context_lines":[{"line_number":26,"context_line":"class OVSDBHandler(object):"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def __init__(self):"},{"line_number":29,"context_line":"        super(OVSDBHandler, self).__init__()"},{"line_number":30,"context_line":"        registry.subscribe(self.process_trunk_ports,"},{"line_number":31,"context_line":"                           ovs_neutron_agent.OVSDB_RESOURCE,"},{"line_number":32,"context_line":"                           events.AFTER_READ)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_807b6ef4","line":29,"range":{"start_line":29,"start_character":8,"end_line":29,"end_character":44},"in_reply_to":"bacf61ea_3fc5e63c","updated":"2016-08-12 16:58:37.000000000","message":"Done","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"850df1732b922314ddd70438c7d03fa18464914e","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"        #TODO(rossella_s) find a smart way of getting br-int or use the conf"},{"line_number":37,"context_line":"        # file"},{"line_number":38,"context_line":"        self.br_int \u003d None"},{"line_number":39,"context_line":"        self.local_vlan_map \u003d {}"},{"line_number":40,"context_line":"        self.trunk_manager \u003d trunk_manager.TrunkManager()"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_edb16848","line":38,"updated":"2016-08-06 01:10:04.000000000","message":"should this be simply:\n\n  cfg.conf.OVS.integration_bridge?","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"87d99a7efe75a8ff7297cf9bcac1acfa172bf0e9","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"        #TODO(rossella_s) find a smart way of getting br-int or use the conf"},{"line_number":37,"context_line":"        # file"},{"line_number":38,"context_line":"        self.br_int \u003d None"},{"line_number":39,"context_line":"        self.local_vlan_map \u003d {}"},{"line_number":40,"context_line":"        self.trunk_manager \u003d trunk_manager.TrunkManager()"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_677393e8","line":38,"in_reply_to":"bacf61ea_edb16848","updated":"2016-08-12 16:58:37.000000000","message":"I passed it as param","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"bf13235ba92cba2ca902e5e9bd47ad7914c11619","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        self.local_vlan_map \u003d {}"},{"line_number":40,"context_line":"        self.trunk_manager \u003d trunk_manager.TrunkManager()"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def process_trunk_ports(self, resource, event, trigger, ovsdb_events, lvid,"},{"line_number":43,"context_line":"                            ports_to_ignore):"},{"line_number":44,"context_line":"        #TODO(rossella_s) it\u0027s not great to pass the local_vlan_map around and"},{"line_number":45,"context_line":"        # trunk is not the only feature that might require those data."}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_7d6766b7","line":42,"range":{"start_line":42,"start_character":74,"end_line":42,"end_character":78},"updated":"2016-08-03 21:04:48.000000000","message":"nit: Can we rename this? The name doesn\u0027t convey that this is the local vid map.","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"850df1732b922314ddd70438c7d03fa18464914e","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        self.local_vlan_map \u003d {}"},{"line_number":40,"context_line":"        self.trunk_manager \u003d trunk_manager.TrunkManager()"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def process_trunk_ports(self, resource, event, trigger, ovsdb_events, lvid,"},{"line_number":43,"context_line":"                            ports_to_ignore):"},{"line_number":44,"context_line":"        #TODO(rossella_s) it\u0027s not great to pass the local_vlan_map around and"},{"line_number":45,"context_line":"        # trunk is not the only feature that might require those data."}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_adc810a9","line":42,"updated":"2016-08-06 01:10:04.000000000","message":"you don\u0027t seem to use the ovsdb_events here. I thought this was what you needed in order to identify a trunk port from its properties such as the fact that is plugged into a bridge that\u0027s not the integration bridge, or in other words that matched the naming convention tbr-bla","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"aa44cb0a4e915fd73612545a4d57000ee7395d62","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        self.local_vlan_map \u003d {}"},{"line_number":40,"context_line":"        self.trunk_manager \u003d trunk_manager.TrunkManager()"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def process_trunk_ports(self, resource, event, trigger, ovsdb_events, lvid,"},{"line_number":43,"context_line":"                            ports_to_ignore):"},{"line_number":44,"context_line":"        #TODO(rossella_s) it\u0027s not great to pass the local_vlan_map around and"},{"line_number":45,"context_line":"        # trunk is not the only feature that might require those data."}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_e9e2b59e","line":42,"in_reply_to":"bacf61ea_adc810a9","updated":"2016-08-08 19:34:51.000000000","message":"oh, I think events is ovsdb_events, my bad.","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"aa44cb0a4e915fd73612545a4d57000ee7395d62","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        # trunk is not the only feature that might require those data."},{"line_number":46,"context_line":"        # We need to find a better way to access it."},{"line_number":47,"context_line":"        self.local_vlan_map \u003d lvid"},{"line_number":48,"context_line":"        for port in events[\u0027added\u0027]:"},{"line_number":49,"context_line":"            # when a VM is spawned using a port associated to a trunk, the"},{"line_number":50,"context_line":"            # corresponding tap will be plugged into a trunk bridge, so it\u0027s"},{"line_number":51,"context_line":"            # going to be ignored by the agent main loop (since it\u0027s not on"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_695fe572","line":48,"updated":"2016-08-08 19:34:51.000000000","message":"The objective of this loop is to identify the trunk parent ports affected by a \u0027boot\u0027 or \u0027delete\u0027 operation for a VM. Another potential lookup strategy could be the following, and I wonder if it\u0027s slightly cleaner/more robust:\n\nAs for added ports, spawn a lookup handler for added ports that does the following: for each port added, match its name with the bridge name convention used for trunk bridges, ie. do a regex match (in fact, for each bridge creation an internal port named after the bridge is created too). From there, list the ports for the bridge and find the Neutron trunk parent port UUID; before proceeding with the trunk creation, update the external-ids to mark that the port is a parent in a trunk (e.g. can store the bridge name alongside a bool marker).\n\nAs for removed ports, spawn a lookup handler for removed ports that does the following: for each port removed, check if it\u0027s parent in a trunk, and if it is, get the bridge it belongs to, and proceed with destroying the trunk.\n\nThoughts?","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"87d99a7efe75a8ff7297cf9bcac1acfa172bf0e9","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        # trunk is not the only feature that might require those data."},{"line_number":46,"context_line":"        # We need to find a better way to access it."},{"line_number":47,"context_line":"        self.local_vlan_map \u003d lvid"},{"line_number":48,"context_line":"        for port in events[\u0027added\u0027]:"},{"line_number":49,"context_line":"            # when a VM is spawned using a port associated to a trunk, the"},{"line_number":50,"context_line":"            # corresponding tap will be plugged into a trunk bridge, so it\u0027s"},{"line_number":51,"context_line":"            # going to be ignored by the agent main loop (since it\u0027s not on"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_cc4d44c6","line":48,"in_reply_to":"9ad45d7e_695fe572","updated":"2016-08-12 16:58:37.000000000","message":"OK for the added port. For the deleted port, I don\u0027t want to issue a query for every port that gets deleted. We could use the bridge name actually and do the regex check again.","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"bf13235ba92cba2ca902e5e9bd47ad7914c11619","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            if \u0027attached-mac\u0027 in port.get(\u0027external_ids\u0027, []):"},{"line_number":56,"context_line":"                #TODO(rossella_s) portid_from_external_ids should be static, it"},{"line_number":57,"context_line":"                # doesn\u0027t depend on any particular bridge!"},{"line_number":58,"context_line":"                iface_id \u003d self.br_int.portid_from_external_ids("},{"line_number":59,"context_line":"                    port[\u0027external_ids\u0027])"},{"line_number":60,"context_line":"                if iface_id and iface_id not in ports_to_ignore:"},{"line_number":61,"context_line":"                    self.create_trunk(iface_id)"},{"line_number":62,"context_line":"        for port in events[\u0027removed\u0027]:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_bdeb9e11","line":59,"range":{"start_line":58,"start_character":16,"end_line":59,"end_character":41},"updated":"2016-08-03 21:04:48.000000000","message":"Why are we looking at br-int for the iface_id? I see the above TODO, so maybe it has some relation to my question.","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"850df1732b922314ddd70438c7d03fa18464914e","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                iface_id \u003d self.br_int.portid_from_external_ids("},{"line_number":65,"context_line":"                    port[\u0027external_ids\u0027])"},{"line_number":66,"context_line":"                if iface_id and iface_id not in ports_to_ignore:"},{"line_number":67,"context_line":"                    self.remove_trunk_port()"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def _get_internal_vlan(self, network_id, port_id):"},{"line_number":70,"context_line":"        lvm \u003d self.local_vlan_map.get(network_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_2dbd4002","line":67,"updated":"2016-08-06 01:10:04.000000000","message":"this doesn\u0027t look to be implemented, but that aside, I thought your cue to know that a trunk port being gone was the fact that it belonged to a bridge that matches the naming convention tbr-blabla","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"850df1732b922314ddd70438c7d03fa18464914e","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_by_port_id(iface_id)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        if trunk is None:"},{"line_number":84,"context_line":"            LOG.into(\"Port %s, has not trunk associated.\", iface_id)"},{"line_number":85,"context_line":"            return"},{"line_number":86,"context_line":"        # TODO(rossella_s) we need an easy way to get the network id"},{"line_number":87,"context_line":"        # from trunk and subport"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_ed4de83e","line":84,"updated":"2016-08-06 01:10:04.000000000","message":"this should probably be an error condition.","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"87d99a7efe75a8ff7297cf9bcac1acfa172bf0e9","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_by_port_id(iface_id)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        if trunk is None:"},{"line_number":84,"context_line":"            LOG.into(\"Port %s, has not trunk associated.\", iface_id)"},{"line_number":85,"context_line":"            return"},{"line_number":86,"context_line":"        # TODO(rossella_s) we need an easy way to get the network id"},{"line_number":87,"context_line":"        # from trunk and subport"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad45d7e_6c5a5852","line":84,"in_reply_to":"bacf61ea_ed4de83e","updated":"2016-08-12 16:58:37.000000000","message":"yes now that we have modified the behavior of process_trunk_port","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"bf13235ba92cba2ca902e5e9bd47ad7914c11619","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        # TODO(rossella_s) we need an easy way to get the network id"},{"line_number":87,"context_line":"        # from trunk and subport"},{"line_number":88,"context_line":"        network_id \u003d None"},{"line_number":89,"context_line":"        lvid \u003d self._get_internal_vlan(network_id, trunk[\u0027id\u0027])"},{"line_number":90,"context_line":"        self.trunk_manager.create_trunk(trunk, lvid)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        for subport in trunk.sub_ports:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_bd91de48","line":89,"range":{"start_line":89,"start_character":51,"end_line":89,"end_character":62},"updated":"2016-08-03 21:04:48.000000000","message":"I wonder if it makes sense to pass iface_id instead of the trunk ID. The ID passed here is only for including it on an exception, I wonder if using the port ID instead of the trunk ID might be a better starting point for debugging.","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"bf13235ba92cba2ca902e5e9bd47ad7914c11619","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            # TODO(rossella_s) we need an easy way to get the network id"},{"line_number":94,"context_line":"            # from trunk and subport"},{"line_number":95,"context_line":"            network_id \u003d None"},{"line_number":96,"context_line":"            lvid \u003d self._get_internal_vlan(network_id, subport[\u0027id\u0027])"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"            self.trunk_manager.add_sub_port(subport, lvid)"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_7dbf66aa","line":96,"range":{"start_line":96,"start_character":55,"end_line":96,"end_character":68},"updated":"2016-08-03 21:04:48.000000000","message":"Subports don\u0027t have an ID, they will have a port_id, trunk_id, segmentation_type, and segmentation_id. Perhaps we should pass \"subport[\u0027port_id\u0027]\" instead.","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"850df1732b922314ddd70438c7d03fa18464914e","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            # TODO(rossella_s) we need an easy way to get the network id"},{"line_number":94,"context_line":"            # from trunk and subport"},{"line_number":95,"context_line":"            network_id \u003d None"},{"line_number":96,"context_line":"            lvid \u003d self._get_internal_vlan(network_id, subport[\u0027id\u0027])"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"            self.trunk_manager.add_sub_port(subport, lvid)"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_cdf624d6","line":96,"in_reply_to":"bacf61ea_7dbf66aa","updated":"2016-08-06 01:10:04.000000000","message":"before going here we may want to issue an update_subport_bindings. I envisioned these steps:\n\n a) agent gets trunk details\n b) agent updates subports bindings\n c) agent creates trunk and subports\n\nB and C can happen concurrently, and we\u0027d need to wait for both to complete.\n\nOnce B and C depending, depending on the result, update trunk status, done.","commit_id":"4d006bb531991beab3452f7a4802abd018b7fedf"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"228b8ea1c6a1b24e456e7319542d8336af1bf897","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, iface_id)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if trunk is None:"},{"line_number":86,"context_line":"            LOG.error(_LE(\"Port %s, has not trunk associated.\"), iface_id)"},{"line_number":87,"context_line":"            return"},{"line_number":88,"context_line":"        # FIXME(rossella_s) we need to get the mac address for the parent port!"},{"line_number":89,"context_line":"        # if the port ovo were merged (https://review.openstack.org/253641) it"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ac371cc_abd44a47","line":86,"range":{"start_line":86,"start_character":40,"end_line":86,"end_character":43},"updated":"2016-08-14 11:27:32.000000000","message":"not \u003d\u003e no","commit_id":"b0ecd41051b901fe3d062b005b9bddd18b37602e"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"282c13fead1e472117829442e634e8f65211ab83","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def is_trunk_bridge(port_name):"},{"line_number":33,"context_line":"    return port_name.startswith(t_const.TRUNK_BR_PREFIX)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class OVSDBHandler(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_1c33a9ac","line":33,"range":{"start_line":33,"start_character":32,"end_line":33,"end_character":55},"updated":"2016-08-22 19:09:54.000000000","message":"already exists: neutron.services.trunk.drivers.openvswitch.constants","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"65fc0fc398f1b68ff2a95b7b5ef4cba9015b12b7","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def is_trunk_bridge(port_name):"},{"line_number":33,"context_line":"    return port_name.startswith(t_const.TRUNK_BR_PREFIX)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class OVSDBHandler(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_87b46682","line":33,"range":{"start_line":33,"start_character":32,"end_line":33,"end_character":55},"in_reply_to":"1ac06dbe_1c33a9ac","updated":"2016-08-22 19:13:55.000000000","message":"Err, disregard, this is actually using the correct constant that already exists, so just the added constant in this PS needs to be removed.","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"282c13fead1e472117829442e634e8f65211ab83","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            # incorrectly listed in the current ports. Current ports are passed"},{"line_number":58,"context_line":"            # to this method as ports_to_ignore so the trunk will never be"},{"line_number":59,"context_line":"            # created."},{"line_number":60,"context_line":"            if is_trunk_bridge(port_event[\u0027name\u0027]):"},{"line_number":61,"context_line":"                # this is the trunk bridge"},{"line_number":62,"context_line":"                # TODO(rossella_s) add the bridge name in the external ids so"},{"line_number":63,"context_line":"                # that it\u0027s easier to perform the deletion. Check if it\u0027s"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_e78b9a66","line":60,"range":{"start_line":60,"start_character":15,"end_line":60,"end_character":51},"updated":"2016-08-22 19:09:54.000000000","message":"I don\u0027t know how inefficient this might be yet, but rather than relying upon the bridge\u0027s local port, we could use [1] to get the port\u0027s bridge name and check against that. It might be not that bad efficiency, because it\u0027s only adding one constant operation per added port on the system.\n\nThat would save us from the case where a VM was recreated with the same trunk, but the trunk bridge wasn\u0027t deleted properly when the VM was first deleted. I.e. if the trunk bridge didn\u0027t get re-created, then there wouldn\u0027t be a \"tbr-*\" port in the list of added ports to rely upon. Like my comment below, using [1] seems more robust against failure.\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/agent/common/ovs_lib.py#L126","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"d94895e7c63a1c3d5262eb420298080a5cabf07e","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            # created."},{"line_number":60,"context_line":"            if is_trunk_bridge(port_event[\u0027name\u0027]):"},{"line_number":61,"context_line":"                # this is the trunk bridge"},{"line_number":62,"context_line":"                # TODO(rossella_s) add the bridge name in the external ids so"},{"line_number":63,"context_line":"                # that it\u0027s easier to perform the deletion. Check if it\u0027s"},{"line_number":64,"context_line":"                # possible to modify the external_ids without having to delete"},{"line_number":65,"context_line":"                # and create the ovs port"}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_a2dec43c","line":62,"range":{"start_line":62,"start_character":18,"end_line":62,"end_character":35},"updated":"2016-08-16 17:01:01.000000000","message":"This TODO looks like it\u0027s already been done below, but I suggest using get_bridge_for_iface [1] rather than relying upon setting bridge_name in the external_ids. Using that method seems more robust/less prone to races and saves us from setting bridge_name unnecessarily.\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/agent/common/ovs_lib.py#L126","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"8d62b6ea8dbe5f111f3a32198b3487cdf9fc3773","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                # possible to modify the external_ids without having to delete"},{"line_number":65,"context_line":"                # and create the ovs port"},{"line_number":66,"context_line":"                trunk_br \u003d ovs_lib.OVSBridge(port_event[\u0027name\u0027])"},{"line_number":67,"context_line":"                trunk_br_ports \u003d trunk_br.get_ports_attributes("},{"line_number":68,"context_line":"                    \u0027Interface\u0027, columns\u003d[\u0027name\u0027, \u0027external_ids\u0027],"},{"line_number":69,"context_line":"                    if_exists\u003dTrue)"},{"line_number":70,"context_line":"                for trunk_br_port in trunk_br_ports:"},{"line_number":71,"context_line":"                    # don\u0027t consider the port named like the bridge"},{"line_number":72,"context_line":"                    if port_event[\u0027name\u0027] !\u003d trunk_br_port[\u0027name\u0027]:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_33880671","line":69,"range":{"start_line":67,"start_character":16,"end_line":69,"end_character":35},"updated":"2016-08-23 18:41:37.000000000","message":"I think this might be susceptible to a race condition where the \"tbr-*\" bridge has been created but the vif port hasn\u0027t come up yet. If the vif port hasn\u0027t showed up by L67, then the trunk won\u0027t be created properly. I think that adds some more fuel to the fire for working [1] into here like I\u0027ve done in [2].\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/agent/common/ovs_lib.py#L126\n[2] https://review.openstack.org/#/c/358900/1/neutron/services/trunk/drivers/openvswitch/agent/ovsdb_handler.py@67","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"7600512a4765de53d0f3aa8a6015ffd5436058e5","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                    # don\u0027t consider the port named like the bridge"},{"line_number":72,"context_line":"                    if port_event[\u0027name\u0027] !\u003d trunk_br_port[\u0027name\u0027]:"},{"line_number":73,"context_line":"                        self.create_trunk(trunk_br, **trunk_br_port)"},{"line_number":74,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":75,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":76,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":77,"context_line":"                iface_id \u003d self.br_int.portid_from_external_ids("}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_bca25097","line":74,"updated":"2016-08-22 20:41:11.000000000","message":"The notification we get here will be in regards to the qvo port, not port LOCAL (the port that carries the bridge name). As written, this assumes that the qvo port has the bridge name set in the external_ids. This is not done anywhere because os-vif doesn\u0027t set it. So when it comes time to delete the VM, we get the OVSDB event for the qvo port being removed, but it never had bridge_name set. This means we ignore the event and the trunk bridge gets left around. This needs some more thought since we don\u0027t want to introduce an RPC round-trip on every port delete to see if it\u0027s associated with a trunk or not.","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"d94895e7c63a1c3d5262eb420298080a5cabf07e","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                    if port_event[\u0027name\u0027] !\u003d trunk_br_port[\u0027name\u0027]:"},{"line_number":73,"context_line":"                        self.create_trunk(trunk_br, **trunk_br_port)"},{"line_number":74,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":75,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":76,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":77,"context_line":"                iface_id \u003d self.br_int.portid_from_external_ids("},{"line_number":78,"context_line":"                    port_event[\u0027external_ids\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_02f9984d","line":75,"range":{"start_line":75,"start_character":12,"end_line":75,"end_character":71},"updated":"2016-08-16 17:01:01.000000000","message":"see suggestion on L62","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"315d4f011baed30e9afe1331fae3c9ef37b4bc12","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                    if port_event[\u0027name\u0027] !\u003d trunk_br_port[\u0027name\u0027]:"},{"line_number":73,"context_line":"                        self.create_trunk(trunk_br, **trunk_br_port)"},{"line_number":74,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":75,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":76,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":77,"context_line":"                iface_id \u003d self.br_int.portid_from_external_ids("},{"line_number":78,"context_line":"                    port_event[\u0027external_ids\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_bc2410c5","line":75,"range":{"start_line":75,"start_character":12,"end_line":75,"end_character":71},"in_reply_to":"3ac371cc_02f9984d","updated":"2016-08-22 21:12:14.000000000","message":"Actually, using [1] will return None here because the vif port will already have been removed at this point. So, we can\u0027t rely upon [1] for deleting the trunk bridge, but we can use it during trunk creation above.\n\nIf we change [2] to create the trunk bridge using the parent port id rather than the trunk id, this would be very easy. That\u0027s how I originally generated the trunk bridge name, but I later changed it to use the trunk id.\n\nWe could just grab the iface_id like on L77, and delete a bridge named \"utils.gen_trunk_br_name(iface_id)\" if it exists (via the TrunkManager, which would need updated for this).\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/agent/common/ovs_lib.py#L126\n[2] https://github.com/openstack/neutron/blob/master/neutron/services/trunk/utils.py#L22","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"d94895e7c63a1c3d5262eb420298080a5cabf07e","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        for subport in trunk[\u0027sub_ports\u0027]:"},{"line_number":85,"context_line":"            self.trunk_manager.remove_sub_port(trunk[\u0027id\u0027], subport[\u0027port_id\u0027])"},{"line_number":86,"context_line":"        self.trunk_manager.remove_trunk(trunk[\u0027id\u0027], trunk[\u0027port_id\u0027])"},{"line_number":87,"context_line":"        self.trunk_rpc.update_trunk_status(trunk[\u0027id\u0027],"},{"line_number":88,"context_line":"                                           constants.DOWN_STATUS)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def create_trunk(self, trunk_br, **port):"},{"line_number":91,"context_line":"        ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_0255181c","line":88,"range":{"start_line":87,"start_character":43,"end_line":88,"end_character":64},"updated":"2016-08-16 17:01:01.000000000","message":"missing context arg","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"3a0d7906baf3794789fc6c2f4d4491da390e4cb9","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        for subport in trunk[\u0027sub_ports\u0027]:"},{"line_number":85,"context_line":"            self.trunk_manager.remove_sub_port(trunk[\u0027id\u0027], subport[\u0027port_id\u0027])"},{"line_number":86,"context_line":"        self.trunk_manager.remove_trunk(trunk[\u0027id\u0027], trunk[\u0027port_id\u0027])"},{"line_number":87,"context_line":"        self.trunk_rpc.update_trunk_status(trunk[\u0027id\u0027],"},{"line_number":88,"context_line":"                                           constants.DOWN_STATUS)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def create_trunk(self, trunk_br, **port):"},{"line_number":91,"context_line":"        ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_6d0bbf24","line":88,"range":{"start_line":87,"start_character":43,"end_line":88,"end_character":64},"in_reply_to":"3ac371cc_0255181c","updated":"2016-08-23 18:34:39.000000000","message":"Done","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"0c7911c806786d9605d561809afd413ce347b846","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def create_trunk(self, trunk_br, **port):"},{"line_number":91,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":92,"context_line":"        #TODO(rossella_s): don\u0027t want to depend on"},{"line_number":93,"context_line":"        # https://review.openstack.org/#/c/347662, fix this when the patch"},{"line_number":94,"context_line":"        # merges"},{"line_number":95,"context_line":"        parent_port_id \u003d trunk_br.portid_from_external_ids("}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_98fe8c36","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":25},"updated":"2016-08-16 21:46:02.000000000","message":"you need a space after # : \"# TODO...\"","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"0c7911c806786d9605d561809afd413ce347b846","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def create_trunk(self, trunk_br, **port):"},{"line_number":91,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":92,"context_line":"        #TODO(rossella_s): don\u0027t want to depend on"},{"line_number":93,"context_line":"        # https://review.openstack.org/#/c/347662, fix this when the patch"},{"line_number":94,"context_line":"        # merges"},{"line_number":95,"context_line":"        parent_port_id \u003d trunk_br.portid_from_external_ids("},{"line_number":96,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":97,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_a278792c","line":94,"range":{"start_line":93,"start_character":1,"end_line":94,"end_character":16},"updated":"2016-08-16 21:46:02.000000000","message":"347662 merged.","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"3a0d7906baf3794789fc6c2f4d4491da390e4cb9","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def create_trunk(self, trunk_br, **port):"},{"line_number":91,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":92,"context_line":"        #TODO(rossella_s): don\u0027t want to depend on"},{"line_number":93,"context_line":"        # https://review.openstack.org/#/c/347662, fix this when the patch"},{"line_number":94,"context_line":"        # merges"},{"line_number":95,"context_line":"        parent_port_id \u003d trunk_br.portid_from_external_ids("},{"line_number":96,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":97,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_ed17af42","line":94,"range":{"start_line":93,"start_character":1,"end_line":94,"end_character":16},"in_reply_to":"3ac371cc_a278792c","updated":"2016-08-23 18:34:39.000000000","message":"Done","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"d94895e7c63a1c3d5262eb420298080a5cabf07e","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        if trunk is None:"},{"line_number":100,"context_line":"            LOG.error(_LE(\"Port %s, has not trunk associated.\"),"},{"line_number":101,"context_line":"                      parent_port_id)"},{"line_number":102,"context_line":"            return"},{"line_number":103,"context_line":"        self.trunk_manager.create_trunk("}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_028d187b","line":100,"range":{"start_line":100,"start_character":26,"end_line":100,"end_character":62},"updated":"2016-08-16 17:01:01.000000000","message":"unnecessary comma, and s/not/no/","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"3a0d7906baf3794789fc6c2f4d4491da390e4cb9","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        if trunk is None:"},{"line_number":100,"context_line":"            LOG.error(_LE(\"Port %s, has not trunk associated.\"),"},{"line_number":101,"context_line":"                      parent_port_id)"},{"line_number":102,"context_line":"            return"},{"line_number":103,"context_line":"        self.trunk_manager.create_trunk("}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_4d29a389","line":100,"range":{"start_line":100,"start_character":26,"end_line":100,"end_character":62},"in_reply_to":"3ac371cc_028d187b","updated":"2016-08-23 18:34:39.000000000","message":"Done","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"d94895e7c63a1c3d5262eb420298080a5cabf07e","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                \u0027attached-mac\u0027))"},{"line_number":106,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":107,"context_line":"        # name"},{"line_number":108,"context_line":"        port[\u0027external_ids\u0027][\u0027bridge_name\u0027] \u003d trunk_br.br_name"},{"line_number":109,"context_line":"        trunk_br.add_attrs_to_port("},{"line_number":110,"context_line":"            port[\u0027name\u0027], (\u0027external_ids\u0027, port[\u0027external_ids\u0027]))"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        subports \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":113,"context_line":"            ctx, trunk[\u0027sub_ports\u0027])[trunk[\u0027id\u0027]]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_e28a7cbe","line":110,"range":{"start_line":108,"start_character":8,"end_line":110,"end_character":65},"updated":"2016-08-16 17:01:01.000000000","message":"see suggestion on L62","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"3a0d7906baf3794789fc6c2f4d4491da390e4cb9","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                \u0027attached-mac\u0027))"},{"line_number":106,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":107,"context_line":"        # name"},{"line_number":108,"context_line":"        port[\u0027external_ids\u0027][\u0027bridge_name\u0027] \u003d trunk_br.br_name"},{"line_number":109,"context_line":"        trunk_br.add_attrs_to_port("},{"line_number":110,"context_line":"            port[\u0027name\u0027], (\u0027external_ids\u0027, port[\u0027external_ids\u0027]))"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        subports \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":113,"context_line":"            ctx, trunk[\u0027sub_ports\u0027])[trunk[\u0027id\u0027]]"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_f0df84d3","line":110,"range":{"start_line":108,"start_character":8,"end_line":110,"end_character":65},"in_reply_to":"3ac371cc_e28a7cbe","updated":"2016-08-23 18:34:39.000000000","message":"I updated this to use trunk_br.set_db_attribute instead.","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"a26aba37b232a7370869c6e527839a2c29a52fdf","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        subports_mac \u003d {p[\u0027id\u0027]: p[\u0027mac_address\u0027] for p in subports}"},{"line_number":115,"context_line":"        for subport in trunk[\u0027sub_ports\u0027]:"},{"line_number":116,"context_line":"            self.trunk_manager.add_sub_port(trunk[\u0027id\u0027], subport[\u0027port_id\u0027],"},{"line_number":117,"context_line":"                                            subport[\u0027segmentation_id\u0027],"},{"line_number":118,"context_line":"                                            subports_mac[subport[\u0027port_id\u0027]])"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        self.trunk_rpc.update_trunk_status(trunk[\u0027id\u0027],"},{"line_number":121,"context_line":"                                           constants.ACTIVE_STATUS)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_a23eb025","line":118,"range":{"start_line":117,"start_character":44,"end_line":118,"end_character":77},"updated":"2016-08-22 19:32:14.000000000","message":"The current TrunkManager has these args swapped.","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"3a0d7906baf3794789fc6c2f4d4491da390e4cb9","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        subports_mac \u003d {p[\u0027id\u0027]: p[\u0027mac_address\u0027] for p in subports}"},{"line_number":115,"context_line":"        for subport in trunk[\u0027sub_ports\u0027]:"},{"line_number":116,"context_line":"            self.trunk_manager.add_sub_port(trunk[\u0027id\u0027], subport[\u0027port_id\u0027],"},{"line_number":117,"context_line":"                                            subport[\u0027segmentation_id\u0027],"},{"line_number":118,"context_line":"                                            subports_mac[subport[\u0027port_id\u0027]])"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        self.trunk_rpc.update_trunk_status(trunk[\u0027id\u0027],"},{"line_number":121,"context_line":"                                           constants.ACTIVE_STATUS)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_8d1f1b5a","line":118,"range":{"start_line":117,"start_character":44,"end_line":118,"end_character":77},"in_reply_to":"1ac06dbe_a23eb025","updated":"2016-08-23 18:34:39.000000000","message":"Done","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"d94895e7c63a1c3d5262eb420298080a5cabf07e","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                                            subport[\u0027segmentation_id\u0027],"},{"line_number":118,"context_line":"                                            subports_mac[subport[\u0027port_id\u0027]])"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        self.trunk_rpc.update_trunk_status(trunk[\u0027id\u0027],"},{"line_number":121,"context_line":"                                           constants.ACTIVE_STATUS)"},{"line_number":122,"context_line":"        LOG.info(_LI(\"Added trunk : %s\"), trunk[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_62196c88","line":121,"range":{"start_line":120,"start_character":43,"end_line":121,"end_character":66},"updated":"2016-08-16 17:01:01.000000000","message":"missing context arg","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"3a0d7906baf3794789fc6c2f4d4491da390e4cb9","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                                            subport[\u0027segmentation_id\u0027],"},{"line_number":118,"context_line":"                                            subports_mac[subport[\u0027port_id\u0027]])"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        self.trunk_rpc.update_trunk_status(trunk[\u0027id\u0027],"},{"line_number":121,"context_line":"                                           constants.ACTIVE_STATUS)"},{"line_number":122,"context_line":"        LOG.info(_LI(\"Added trunk : %s\"), trunk[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_ad3817d4","line":121,"range":{"start_line":120,"start_character":43,"end_line":121,"end_character":66},"in_reply_to":"3ac371cc_62196c88","updated":"2016-08-23 18:34:39.000000000","message":"Done","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"78930e5bd0191518fa4a25942738e0eb516dc1b8","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            # incorrectly listed in the current ports. Current ports are passed"},{"line_number":58,"context_line":"            # to this method as ports_to_ignore so the trunk will never be"},{"line_number":59,"context_line":"            # created."},{"line_number":60,"context_line":"            if is_trunk_bridge(port_event[\u0027name\u0027]):"},{"line_number":61,"context_line":"                # this is the trunk bridge"},{"line_number":62,"context_line":"                trunk_br \u003d ovs_lib.OVSBridge(port_event[\u0027name\u0027])"},{"line_number":63,"context_line":"                trunk_br_ports \u003d trunk_br.get_ports_attributes("},{"line_number":64,"context_line":"                    \u0027Interface\u0027, columns\u003d[\u0027name\u0027, \u0027external_ids\u0027],"},{"line_number":65,"context_line":"                    if_exists\u003dTrue)"},{"line_number":66,"context_line":"                for trunk_br_port in trunk_br_ports:"},{"line_number":67,"context_line":"                    # don\u0027t consider the port named like the bridge"},{"line_number":68,"context_line":"                    if port_event[\u0027name\u0027] !\u003d trunk_br_port[\u0027name\u0027]:"},{"line_number":69,"context_line":"                        self.create_trunk(trunk_br, **trunk_br_port)"},{"line_number":70,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":71,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":72,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1ac06dbe_9e51bfdb","line":69,"range":{"start_line":60,"start_character":12,"end_line":69,"end_character":68},"updated":"2016-08-24 16:04:04.000000000","message":"I mentioned a possible race condition here where the VM\u0027s vif port hasn\u0027t been created by the time we run L63. If that happens, the trunk won\u0027t be created properly. To fix this, I recommend checking for the vif port being added the grabbing the bridge name that it\u0027s on. I\u0027ve illustrated that here [1].\n\nMy review [1] also changes the way trunk bridges are named, using the trunk port_id rather than trunk_id, so that the trunk bridge can be deleted easily after the vif port has been removed. Alternatively, we could still set bridge_name in the vif port\u0027s external_ids like done on L102, then check if a vif port has bridge_name set in order to delete the trunk bridge.\n\nI prefer just renaming the trunk bridge using port_id, because we\u0027d be treading into Nova/KVM territory by changing the vif port\u0027s external_ids.\n\n[1] https://review.openstack.org/#/c/358900/4/neutron/services/trunk/drivers/openvswitch/agent/ovsdb_handler.py@52","commit_id":"fb4c7e02db84a96280f9c629bce820ccef0d6e82"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"61ad2add72c09f3fe6862a0aec79754356113e3e","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            # incorrectly listed in the current ports. Current ports are passed"},{"line_number":58,"context_line":"            # to this method as ports_to_ignore so the trunk will never be"},{"line_number":59,"context_line":"            # created."},{"line_number":60,"context_line":"            if is_trunk_bridge(port_event[\u0027name\u0027]):"},{"line_number":61,"context_line":"                # this is the trunk bridge"},{"line_number":62,"context_line":"                trunk_br \u003d ovs_lib.OVSBridge(port_event[\u0027name\u0027])"},{"line_number":63,"context_line":"                trunk_br_ports \u003d trunk_br.get_ports_attributes("},{"line_number":64,"context_line":"                    \u0027Interface\u0027, columns\u003d[\u0027name\u0027, \u0027external_ids\u0027],"},{"line_number":65,"context_line":"                    if_exists\u003dTrue)"},{"line_number":66,"context_line":"                for trunk_br_port in trunk_br_ports:"},{"line_number":67,"context_line":"                    # don\u0027t consider the port named like the bridge"},{"line_number":68,"context_line":"                    if port_event[\u0027name\u0027] !\u003d trunk_br_port[\u0027name\u0027]:"},{"line_number":69,"context_line":"                        self.create_trunk(trunk_br, **trunk_br_port)"},{"line_number":70,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":71,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":72,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1ac06dbe_c44a3327","line":69,"range":{"start_line":60,"start_character":12,"end_line":69,"end_character":68},"in_reply_to":"1ac06dbe_9e51bfdb","updated":"2016-08-24 23:01:34.000000000","message":"After looking further into renaming the trunk bridge using the port_id, I\u0027ve found that we\u0027d need to also pass the parent port id in the \"push\" notification that occurs when a subport has been created, and the RPC push API doesn\u0027t allow that the way it\u0027s built.\n\nSo, I think we may be forced to set bridge_name in the vif port\u0027s external_ids in order to delete the trunk bridge later, but I still say that we should be using get_bridge_for_iface() when checking ports in ovsdb_events[\u0027added\u0027].","commit_id":"fb4c7e02db84a96280f9c629bce820ccef0d6e82"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"718a3a30949fe4356f8fb270b08fa26c839ece95","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            # incorrectly listed in the current ports. Current ports are passed"},{"line_number":58,"context_line":"            # to this method as ports_to_ignore so the trunk will never be"},{"line_number":59,"context_line":"            # created."},{"line_number":60,"context_line":"            if is_trunk_bridge(port_event[\u0027name\u0027]):"},{"line_number":61,"context_line":"                # this is the trunk bridge"},{"line_number":62,"context_line":"                trunk_br \u003d ovs_lib.OVSBridge(port_event[\u0027name\u0027])"},{"line_number":63,"context_line":"                trunk_br_ports \u003d trunk_br.get_ports_attributes("},{"line_number":64,"context_line":"                    \u0027Interface\u0027, columns\u003d[\u0027name\u0027, \u0027external_ids\u0027],"},{"line_number":65,"context_line":"                    if_exists\u003dTrue)"},{"line_number":66,"context_line":"                for trunk_br_port in trunk_br_ports:"},{"line_number":67,"context_line":"                    # don\u0027t consider the port named like the bridge"},{"line_number":68,"context_line":"                    if port_event[\u0027name\u0027] !\u003d trunk_br_port[\u0027name\u0027]:"},{"line_number":69,"context_line":"                        self.create_trunk(trunk_br, **trunk_br_port)"},{"line_number":70,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":71,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":72,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1ac06dbe_fbdb4eeb","line":69,"range":{"start_line":60,"start_character":12,"end_line":69,"end_character":68},"in_reply_to":"1ac06dbe_c44a3327","updated":"2016-08-25 18:35:06.000000000","message":"I just updated [1] to remove my changes that renamed the trunk bridge using the port_id. I don\u0027t think we\u0027ll be able to avoid setting bridge_name in the vif port\u0027s external_ids, but my suggestion does avoid the race condition I mentioned above.\n\n[1] https://review.openstack.org/#/c/358900/7/neutron/services/trunk/drivers/openvswitch/agent/ovsdb_handler.py","commit_id":"fb4c7e02db84a96280f9c629bce820ccef0d6e82"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"61ad2add72c09f3fe6862a0aec79754356113e3e","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        trunk_br.set_db_attribute("},{"line_number":103,"context_line":"            \u0027Interface\u0027, port[\u0027name\u0027], \u0027external_ids\u0027, port[\u0027external_ids\u0027])"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        subports \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":106,"context_line":"            ctx, trunk[\u0027sub_ports\u0027])[trunk[\u0027id\u0027]]"},{"line_number":107,"context_line":"        subports_mac \u003d {p[\u0027id\u0027]: p[\u0027mac_address\u0027] for p in subports}"},{"line_number":108,"context_line":"        for subport in trunk[\u0027sub_ports\u0027]:"},{"line_number":109,"context_line":"            self.trunk_manager.add_sub_port(trunk[\u0027id\u0027], subport[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"1ac06dbe_44d2c335","line":106,"range":{"start_line":105,"start_character":8,"end_line":106,"end_character":49},"updated":"2016-08-24 23:01:34.000000000","message":"This blocking operation could take over an hour if there are 4k subports to update bindings for. During that time, the agent is completely tied up. I think we need to consider making L105-115 asynchronous within the agent.","commit_id":"fb4c7e02db84a96280f9c629bce820ccef0d6e82"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"718a3a30949fe4356f8fb270b08fa26c839ece95","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        trunk_br.set_db_attribute("},{"line_number":103,"context_line":"            \u0027Interface\u0027, port[\u0027name\u0027], \u0027external_ids\u0027, port[\u0027external_ids\u0027])"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        subports \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":106,"context_line":"            ctx, trunk[\u0027sub_ports\u0027])[trunk[\u0027id\u0027]]"},{"line_number":107,"context_line":"        subports_mac \u003d {p[\u0027id\u0027]: p[\u0027mac_address\u0027] for p in subports}"},{"line_number":108,"context_line":"        for subport in trunk[\u0027sub_ports\u0027]:"},{"line_number":109,"context_line":"            self.trunk_manager.add_sub_port(trunk[\u0027id\u0027], subport[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"1ac06dbe_aefeb668","line":106,"range":{"start_line":105,"start_character":8,"end_line":106,"end_character":49},"in_reply_to":"1ac06dbe_44d2c335","updated":"2016-08-25 18:35:06.000000000","message":"Another benefit of making this asynchronous would be that the OVS agent would have a chance to finish processing the \u0027tpi\u0027 port on br-int, which would give the VM connectivity over the parent port at least and make it accessible (fulfill its DHCP request). Nova would also be notified that the port has become active, so it can continue whatever it needs to do with the VM to make it active.","commit_id":"fb4c7e02db84a96280f9c629bce820ccef0d6e82"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e2d38acdad52fa85a6f5118e65b6556cd283b45","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def is_port_device(port_name):"},{"line_number":44,"context_line":"    \"\"\"Filter out bridge name and patch ports.\"\"\""},{"line_number":45,"context_line":"    prefix \u003d port_name[:4]"},{"line_number":46,"context_line":"    return prefix !\u003d t_const.TRUNK_BR_PREFIX and prefix[:2] not in ["},{"line_number":47,"context_line":"        trunk_manager.TrunkParentPort.DEV_PREFIX,"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_d5aaf318","line":44,"updated":"2016-08-31 23:36:23.000000000","message":"This takes a name and check if it matches a condition, it\u0027s not filtering per se, in other words, the docstring is a bit confusing. What about we flip this and say:\n\n  is_trunk_service_port(port_name):\n    \"\"\"True if the port is any of the ports used to realize a trunk.\"\"\"\n    return prefix \u003d\u003d t_const.TRUNK_BR_PREFIX or prefix[:2] in (...)\n\nthen down below we can negate.","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def is_port_device(port_name):"},{"line_number":44,"context_line":"    \"\"\"Filter out bridge name and patch ports.\"\"\""},{"line_number":45,"context_line":"    prefix \u003d port_name[:4]"},{"line_number":46,"context_line":"    return prefix !\u003d t_const.TRUNK_BR_PREFIX and prefix[:2] not in ["},{"line_number":47,"context_line":"        trunk_manager.TrunkParentPort.DEV_PREFIX,"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_b4255faf","line":44,"in_reply_to":"fa7ab95a_d5aaf318","updated":"2016-09-01 10:02:33.000000000","message":"Done","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"c1a08561bade909cdf3a4b2b1a14ac61df02f275","unresolved":false,"context_lines":[{"line_number":43,"context_line":"def is_port_device(port_name):"},{"line_number":44,"context_line":"    \"\"\"Filter out bridge name and patch ports.\"\"\""},{"line_number":45,"context_line":"    prefix \u003d port_name[:4]"},{"line_number":46,"context_line":"    return prefix !\u003d t_const.TRUNK_BR_PREFIX and prefix[:2] not in ["},{"line_number":47,"context_line":"        trunk_manager.TrunkParentPort.DEV_PREFIX,"},{"line_number":48,"context_line":"        trunk_manager.SubPort.DEV_PREFIX]"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_593a8e35","line":46,"range":{"start_line":46,"start_character":11,"end_line":46,"end_character":44},"updated":"2016-09-01 08:40:38.000000000","message":"not is_trunk_bridge(port_name) is better?","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":43,"context_line":"def is_port_device(port_name):"},{"line_number":44,"context_line":"    \"\"\"Filter out bridge name and patch ports.\"\"\""},{"line_number":45,"context_line":"    prefix \u003d port_name[:4]"},{"line_number":46,"context_line":"    return prefix !\u003d t_const.TRUNK_BR_PREFIX and prefix[:2] not in ["},{"line_number":47,"context_line":"        trunk_manager.TrunkParentPort.DEV_PREFIX,"},{"line_number":48,"context_line":"        trunk_manager.SubPort.DEV_PREFIX]"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_96630041","line":46,"range":{"start_line":46,"start_character":11,"end_line":46,"end_character":44},"in_reply_to":"fa7ab95a_593a8e35","updated":"2016-09-01 10:02:33.000000000","message":"It is, Done","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"071df9f4ecb3bba585741feefb7a0fa8f9ae29cd","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                           events.AFTER_READ)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def process_trunk_ports(self, resource, event, trigger, ovsdb_events,"},{"line_number":70,"context_line":"                            ports_to_ignore):"},{"line_number":71,"context_line":"        \"\"\"Process added and removed ports coming from ovsdb monitor.\"\"\""},{"line_number":72,"context_line":"        LOG.debug(\"Processing ovsdb events %s\", ovsdb_events)"},{"line_number":73,"context_line":"        for port_event in ovsdb_events[\u0027added\u0027]:"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_96022008","line":70,"range":{"start_line":70,"start_character":28,"end_line":70,"end_character":43},"updated":"2016-09-01 08:56:25.000000000","message":"are you using this?","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                           events.AFTER_READ)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def process_trunk_ports(self, resource, event, trigger, ovsdb_events,"},{"line_number":70,"context_line":"                            ports_to_ignore):"},{"line_number":71,"context_line":"        \"\"\"Process added and removed ports coming from ovsdb monitor.\"\"\""},{"line_number":72,"context_line":"        LOG.debug(\"Processing ovsdb events %s\", ovsdb_events)"},{"line_number":73,"context_line":"        for port_event in ovsdb_events[\u0027added\u0027]:"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_76c75c12","line":70,"range":{"start_line":70,"start_character":28,"end_line":70,"end_character":43},"in_reply_to":"fa7ab95a_96022008","updated":"2016-09-01 10:02:33.000000000","message":"Nope. Done","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"071df9f4ecb3bba585741feefb7a0fa8f9ae29cd","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    def process_trunk_ports(self, resource, event, trigger, ovsdb_events,"},{"line_number":70,"context_line":"                            ports_to_ignore):"},{"line_number":71,"context_line":"        \"\"\"Process added and removed ports coming from ovsdb monitor.\"\"\""},{"line_number":72,"context_line":"        LOG.debug(\"Processing ovsdb events %s\", ovsdb_events)"},{"line_number":73,"context_line":"        for port_event in ovsdb_events[\u0027added\u0027]:"},{"line_number":74,"context_line":"            if is_trunk_bridge(port_event[\u0027name\u0027]):"},{"line_number":75,"context_line":"                trunk_br \u003d ovs_lib.OVSBridge(port_event[\u0027name\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_94185b77","line":72,"updated":"2016-09-01 08:56:25.000000000","message":"this log message doesn\u0027t add much info since the ovsdb_events are the same processed by the ovs agent, these are all the events :/ I would add a debug message at line 75","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    def process_trunk_ports(self, resource, event, trigger, ovsdb_events,"},{"line_number":70,"context_line":"                            ports_to_ignore):"},{"line_number":71,"context_line":"        \"\"\"Process added and removed ports coming from ovsdb monitor.\"\"\""},{"line_number":72,"context_line":"        LOG.debug(\"Processing ovsdb events %s\", ovsdb_events)"},{"line_number":73,"context_line":"        for port_event in ovsdb_events[\u0027added\u0027]:"},{"line_number":74,"context_line":"            if is_trunk_bridge(port_event[\u0027name\u0027]):"},{"line_number":75,"context_line":"                trunk_br \u003d ovs_lib.OVSBridge(port_event[\u0027name\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_96bf805f","line":72,"in_reply_to":"fa7ab95a_94185b77","updated":"2016-09-01 10:02:33.000000000","message":"I think this remains here by mistake, I added much more log messages when debugging functional tests.","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"c1a08561bade909cdf3a4b2b1a14ac61df02f275","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                    self.handle_new_trunk_bridge, trunk_br)"},{"line_number":78,"context_line":"                # As there is active waiting for port to appear, it\u0027s handled"},{"line_number":79,"context_line":"                # in a separate greenthread."},{"line_number":80,"context_line":"                eventlet.spawn_n(process_trunk_bridge)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":83,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_140c4b3a","line":80,"range":{"start_line":80,"start_character":33,"end_line":80,"end_character":54},"updated":"2016-09-01 08:40:38.000000000","message":"Cannot it be just spawn_n(self.handle_new_trunk_bridge, trunk_br) without using functools.partial?","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                    self.handle_new_trunk_bridge, trunk_br)"},{"line_number":78,"context_line":"                # As there is active waiting for port to appear, it\u0027s handled"},{"line_number":79,"context_line":"                # in a separate greenthread."},{"line_number":80,"context_line":"                eventlet.spawn_n(process_trunk_bridge)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":83,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_561c18c1","line":80,"range":{"start_line":80,"start_character":33,"end_line":80,"end_character":54},"in_reply_to":"fa7ab95a_140c4b3a","updated":"2016-09-01 10:02:33.000000000","message":"It can, but as per eventlet documentation passing functions without parameters is faster.","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"846e837874da023df6f993e6e676730af8f4087c","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                    self.handle_new_trunk_bridge, trunk_br)"},{"line_number":78,"context_line":"                # As there is active waiting for port to appear, it\u0027s handled"},{"line_number":79,"context_line":"                # in a separate greenthread."},{"line_number":80,"context_line":"                eventlet.spawn_n(process_trunk_bridge)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":83,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_b4d35c37","line":80,"range":{"start_line":80,"start_character":33,"end_line":80,"end_character":54},"in_reply_to":"fa7ab95a_3bc2e234","updated":"2016-09-02 08:54:00.000000000","message":"I actually haven\u0027t done any comparison of speed, I blindly trusted documentation and either it doesn\u0027t mention what the performance penalty is. That said, I\u0027m not against avoiding using partial functions.","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"b02a9efad56689a3d74cdc8eee25fc72ea7811f8","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                    self.handle_new_trunk_bridge, trunk_br)"},{"line_number":78,"context_line":"                # As there is active waiting for port to appear, it\u0027s handled"},{"line_number":79,"context_line":"                # in a separate greenthread."},{"line_number":80,"context_line":"                eventlet.spawn_n(process_trunk_bridge)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":83,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_3bc2e234","line":80,"range":{"start_line":80,"start_character":33,"end_line":80,"end_character":54},"in_reply_to":"fa7ab95a_561c18c1","updated":"2016-09-02 08:08:58.000000000","message":"I looked at the code and am not quite convinced as functool.partial gives some overhead.\n\nIs the speed so important here? IMO, uses of functool.partial make the code somewhat difficult to read.","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"72fa6c16b950350eff00bdb5aa5c9f78cf982b4b","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":85,"context_line":"                iface_id \u003d self.br_int.portid_from_external_ids("},{"line_number":86,"context_line":"                    port_event[\u0027external_ids\u0027])"},{"line_number":87,"context_line":"                self.remove_trunk_port(iface_id)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def handle_new_trunk_bridge(self, bridge):"},{"line_number":90,"context_line":"        \"\"\"Create trunk bridge based on parent port ID.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_0c3c662e","line":87,"range":{"start_line":87,"start_character":21,"end_line":87,"end_character":38},"updated":"2016-08-31 17:46:43.000000000","message":"We might also want to make this call asynchronous as well, because removing patch ports might keep the OVS agent spinning for quite some time when the number of subports is high (we\u0027ve seen around 20 mins for 1k subports in devstack using the vsctl interface, but take that with a grain of salt).","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":85,"context_line":"                iface_id \u003d self.br_int.portid_from_external_ids("},{"line_number":86,"context_line":"                    port_event[\u0027external_ids\u0027])"},{"line_number":87,"context_line":"                self.remove_trunk_port(iface_id)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def handle_new_trunk_bridge(self, bridge):"},{"line_number":90,"context_line":"        \"\"\"Create trunk bridge based on parent port ID.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_5490934e","line":87,"range":{"start_line":87,"start_character":21,"end_line":87,"end_character":38},"in_reply_to":"fa7ab95a_0c3c662e","updated":"2016-09-01 10:02:33.000000000","message":"Done","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"72fa6c16b950350eff00bdb5aa5c9f78cf982b4b","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        bridge_has_port_predicate \u003d functools.partial("},{"line_number":92,"context_line":"            bridge_has_instance_port, bridge)"},{"line_number":93,"context_line":"        try:"},{"line_number":94,"context_line":"            common_utils.wait_until_true("},{"line_number":95,"context_line":"                bridge_has_port_predicate,"},{"line_number":96,"context_line":"                timeout\u003dWAIT_FOR_PORT_TIMEOUT)"},{"line_number":97,"context_line":"        except eventlet.TimeoutError:"},{"line_number":98,"context_line":"            self.handle_no_port(bridge)"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_a9e60ce6","line":96,"range":{"start_line":94,"start_character":12,"end_line":96,"end_character":46},"updated":"2016-08-31 17:46:43.000000000","message":"This addresses the race condition while allowing us to clean up the trunk bridge if Nova doesn\u0027t place instance port within 20 seconds. I think this is alright, but would we want to make the timeout a configurable option?","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        bridge_has_port_predicate \u003d functools.partial("},{"line_number":92,"context_line":"            bridge_has_instance_port, bridge)"},{"line_number":93,"context_line":"        try:"},{"line_number":94,"context_line":"            common_utils.wait_until_true("},{"line_number":95,"context_line":"                bridge_has_port_predicate,"},{"line_number":96,"context_line":"                timeout\u003dWAIT_FOR_PORT_TIMEOUT)"},{"line_number":97,"context_line":"        except eventlet.TimeoutError:"},{"line_number":98,"context_line":"            self.handle_no_port(bridge)"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_744917d0","line":96,"range":{"start_line":94,"start_character":12,"end_line":96,"end_character":46},"in_reply_to":"fa7ab95a_35a4ffb7","updated":"2016-09-01 10:02:33.000000000","message":"Given that this is running in its own greenthread we can afford to wait longer rather than shorter without having impact on agent processing. So yeah, maybe 60s is safer. 60 is default for wait_until_true but I think it\u0027s better to be explicit and set our won constant here.","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e2d38acdad52fa85a6f5118e65b6556cd283b45","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        bridge_has_port_predicate \u003d functools.partial("},{"line_number":92,"context_line":"            bridge_has_instance_port, bridge)"},{"line_number":93,"context_line":"        try:"},{"line_number":94,"context_line":"            common_utils.wait_until_true("},{"line_number":95,"context_line":"                bridge_has_port_predicate,"},{"line_number":96,"context_line":"                timeout\u003dWAIT_FOR_PORT_TIMEOUT)"},{"line_number":97,"context_line":"        except eventlet.TimeoutError:"},{"line_number":98,"context_line":"            self.handle_no_port(bridge)"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_35a4ffb7","line":96,"range":{"start_line":94,"start_character":12,"end_line":96,"end_character":46},"in_reply_to":"fa7ab95a_a9e60ce6","updated":"2016-08-31 23:36:23.000000000","message":"This is to handle the potential issue where the bridge is left dangling when the VM failed to come up, and hence gets cleaned up.\n\nLet\u0027s consider carefully if we do need a configuration option, because we already have a gazillion of them, and I\u0027d rather not add one unless we absolutely have to.\n\nThis is the timeout to detect how long it takes between bridge creation (os-vif responsibility) and tap plugging (libvirt\u0027s responsibility). How long can it take so that we can comfortably say that nova/libvirt failed? Before we have evidence that this is indeed in need of tuning (which sucks anyway as we\u0027d need to bump the agent to apply the change unless we made this a SIGHUP option), can we be more conservative and say 60 seconds to start with?","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"071df9f4ecb3bba585741feefb7a0fa8f9ae29cd","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        except eventlet.TimeoutError:"},{"line_number":98,"context_line":"            self.handle_no_port(bridge)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        trunk_br_ports \u003d bridge.get_ports_attributes("},{"line_number":101,"context_line":"            \u0027Interface\u0027, columns\u003d[\u0027name\u0027, \u0027external_ids\u0027],"},{"line_number":102,"context_line":"            if_exists\u003dTrue)"},{"line_number":103,"context_line":"        for trunk_br_port in trunk_br_ports:"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_1401ab6a","line":100,"range":{"start_line":100,"start_character":25,"end_line":100,"end_character":52},"updated":"2016-09-01 08:56:25.000000000","message":"here we issue another query to ovsdb...we could modify bridge_has_instance_port to return the port attributes directly if the port device is there, None otherwise. So we could simplify the following lines too, removing the loop at line 103","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        except eventlet.TimeoutError:"},{"line_number":98,"context_line":"            self.handle_no_port(bridge)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        trunk_br_ports \u003d bridge.get_ports_attributes("},{"line_number":101,"context_line":"            \u0027Interface\u0027, columns\u003d[\u0027name\u0027, \u0027external_ids\u0027],"},{"line_number":102,"context_line":"            if_exists\u003dTrue)"},{"line_number":103,"context_line":"        for trunk_br_port in trunk_br_ports:"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_4a77073a","line":100,"range":{"start_line":100,"start_character":25,"end_line":100,"end_character":52},"in_reply_to":"fa7ab95a_1401ab6a","updated":"2016-09-01 10:02:33.000000000","message":"The bridge_has_instance_port is wrapped by wait_until_true - so we can\u0027t get the last result back from wait_until_true. Also it would mean to change bridge_has_instance_port to fetch the columns from ovsdb as we\u0027re interested in external_ids later.\n\nI\u0027d rather separate this functionality and have dedicated methods/functions for specific uses. I don\u0027t think that generalizing bridge_has_instance_port would help us much here.","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e2d38acdad52fa85a6f5118e65b6556cd283b45","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            if_exists\u003dTrue)"},{"line_number":103,"context_line":"        for trunk_br_port in trunk_br_ports:"},{"line_number":104,"context_line":"            if is_port_device(trunk_br_port[\u0027name\u0027]):"},{"line_number":105,"context_line":"                self.create_trunk(bridge, trunk_br_port)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def handle_no_port(self, bridge):"},{"line_number":108,"context_line":"        \"\"\"Error handling routine that occurs when port doesn\u0027t appear on"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_d5811391","line":105,"updated":"2016-08-31 23:36:23.000000000","message":"we could break out of the loop here now right?","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            if_exists\u003dTrue)"},{"line_number":103,"context_line":"        for trunk_br_port in trunk_br_ports:"},{"line_number":104,"context_line":"            if is_port_device(trunk_br_port[\u0027name\u0027]):"},{"line_number":105,"context_line":"                self.create_trunk(bridge, trunk_br_port)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def handle_no_port(self, bridge):"},{"line_number":108,"context_line":"        \"\"\"Error handling routine that occurs when port doesn\u0027t appear on"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_14860bdb","line":105,"in_reply_to":"fa7ab95a_d5811391","updated":"2016-09-01 10:02:33.000000000","message":"Done","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"72fa6c16b950350eff00bdb5aa5c9f78cf982b4b","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        It removes the trunk bridge as no port was plugged in within given"},{"line_number":112,"context_line":"        timeout."},{"line_number":113,"context_line":"        \"\"\""},{"line_number":114,"context_line":"        LOG.error(_LE(\u0027No port appeard on bridge %(br_name)s in %(timeout)d \u0027"},{"line_number":115,"context_line":"                      \u0027seconds. Cleaning up the bridge\u0027),"},{"line_number":116,"context_line":"                  {\u0027br_name\u0027: bridge.br_name,"},{"line_number":117,"context_line":"                   \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_0937f8e3","line":114,"range":{"start_line":114,"start_character":31,"end_line":114,"end_character":38},"updated":"2016-08-31 17:46:43.000000000","message":"appeared","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        It removes the trunk bridge as no port was plugged in within given"},{"line_number":112,"context_line":"        timeout."},{"line_number":113,"context_line":"        \"\"\""},{"line_number":114,"context_line":"        LOG.error(_LE(\u0027No port appeard on bridge %(br_name)s in %(timeout)d \u0027"},{"line_number":115,"context_line":"                      \u0027seconds. Cleaning up the bridge\u0027),"},{"line_number":116,"context_line":"                  {\u0027br_name\u0027: bridge.br_name,"},{"line_number":117,"context_line":"                   \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_544fb3bd","line":114,"range":{"start_line":114,"start_character":31,"end_line":114,"end_character":38},"in_reply_to":"fa7ab95a_0937f8e3","updated":"2016-09-01 10:02:33.000000000","message":"Done","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"72fa6c16b950350eff00bdb5aa5c9f78cf982b4b","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                      \u0027seconds. Cleaning up the bridge\u0027),"},{"line_number":116,"context_line":"                  {\u0027br_name\u0027: bridge.br_name,"},{"line_number":117,"context_line":"                   \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"},{"line_number":118,"context_line":"        bridge.destroy()"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def remove_trunk_port(self, iface_id):"},{"line_number":121,"context_line":"        ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_09ad3831","line":118,"updated":"2016-08-31 17:46:43.000000000","message":"Should we set the trunk status to ERROR here? If this happens, how would the user recover it? Delete the VM and retry booting it?","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e2d38acdad52fa85a6f5118e65b6556cd283b45","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                      \u0027seconds. Cleaning up the bridge\u0027),"},{"line_number":116,"context_line":"                  {\u0027br_name\u0027: bridge.br_name,"},{"line_number":117,"context_line":"                   \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"},{"line_number":118,"context_line":"        bridge.destroy()"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def remove_trunk_port(self, iface_id):"},{"line_number":121,"context_line":"        ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_d506731f","line":118,"in_reply_to":"fa7ab95a_09ad3831","updated":"2016-08-31 23:36:23.000000000","message":"There\u0027s no way we can find the trunk uniquely at this point, because we don\u0027t know the port associated to it. We can only ensure we don\u0027t leak bridges and the user can delete his/her VM and retry.\n\nWe could potentially handle a ERROR status in [1], in case we hit VIF_FAILED or whatever, but I am not 100% clear of the failure mode, so I\u0027d rather err on the side of caution and leave things as they are, until we learn a bit more :)\n\n[1] https://review.openstack.org/#/c/361481/","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e2d38acdad52fa85a6f5118e65b6556cd283b45","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                   \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"},{"line_number":118,"context_line":"        bridge.destroy()"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def remove_trunk_port(self, iface_id):"},{"line_number":121,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":122,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, iface_id)"},{"line_number":123,"context_line":"        if trunk is None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_5009912b","line":120,"updated":"2016-08-31 23:36:23.000000000","message":"can you flip the order of these methods for readability purposes? dostring would be nice.","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                   \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"},{"line_number":118,"context_line":"        bridge.destroy()"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def remove_trunk_port(self, iface_id):"},{"line_number":121,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":122,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, iface_id)"},{"line_number":123,"context_line":"        if trunk is None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_3935c7d9","line":120,"in_reply_to":"fa7ab95a_5009912b","updated":"2016-09-01 10:02:33.000000000","message":"Done","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e2d38acdad52fa85a6f5118e65b6556cd283b45","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def remove_trunk_port(self, iface_id):"},{"line_number":121,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":122,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, iface_id)"},{"line_number":123,"context_line":"        if trunk is None:"},{"line_number":124,"context_line":"            LOG.error(_LE(\"Port %s has no trunk associated\"), iface_id)"},{"line_number":125,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_507c3172","line":122,"updated":"2016-08-31 23:36:23.000000000","message":"you sure we need this call? What if we stored the trunk id alogside the bridge name down below?","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ca920d1083bc9334851526b78282ff7419032341","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def remove_trunk_port(self, iface_id):"},{"line_number":121,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":122,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, iface_id)"},{"line_number":123,"context_line":"        if trunk is None:"},{"line_number":124,"context_line":"            LOG.error(_LE(\"Port %s has no trunk associated\"), iface_id)"},{"line_number":125,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_c7967b3d","line":122,"in_reply_to":"fa7ab95a_34b06f8b","updated":"2016-09-02 03:12:47.000000000","message":"I mean we could store the trunk id the same way we stored the bridge name and avoid to go back to the server to require the trunk_id","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def remove_trunk_port(self, iface_id):"},{"line_number":121,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":122,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, iface_id)"},{"line_number":123,"context_line":"        if trunk is None:"},{"line_number":124,"context_line":"            LOG.error(_LE(\"Port %s has no trunk associated\"), iface_id)"},{"line_number":125,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_34b06f8b","line":122,"in_reply_to":"fa7ab95a_507c3172","updated":"2016-09-01 10:02:33.000000000","message":"We call it to fetch subports - used at L127","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"252a754cad83f941aa41abea7a164de4a5f5f1dd","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def remove_trunk_port(self, iface_id):"},{"line_number":121,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":122,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, iface_id)"},{"line_number":123,"context_line":"        if trunk is None:"},{"line_number":124,"context_line":"            LOG.error(_LE(\"Port %s has no trunk associated\"), iface_id)"},{"line_number":125,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_d4a620c0","line":122,"in_reply_to":"fa7ab95a_c7967b3d","updated":"2016-09-02 08:56:13.000000000","message":"But you will still need to call into server to obtain subports - so you want to save the payload sent over the wire?","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e2d38acdad52fa85a6f5118e65b6556cd283b45","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        self.trunk_rpc.update_trunk_status(ctx, trunk.id,"},{"line_number":132,"context_line":"                                           constants.DOWN_STATUS)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def create_trunk(self, trunk_br, port):"},{"line_number":135,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":136,"context_line":"        parent_port_id \u003d trunk_br.portid_from_external_ids("},{"line_number":137,"context_line":"            port[\u0027external_ids\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_d01da167","line":134,"updated":"2016-08-31 23:36:23.000000000","message":"docstring would be nice.","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        self.trunk_rpc.update_trunk_status(ctx, trunk.id,"},{"line_number":132,"context_line":"                                           constants.DOWN_STATUS)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def create_trunk(self, trunk_br, port):"},{"line_number":135,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":136,"context_line":"        parent_port_id \u003d trunk_br.portid_from_external_ids("},{"line_number":137,"context_line":"            port[\u0027external_ids\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_ea237ba5","line":134,"in_reply_to":"fa7ab95a_d01da167","updated":"2016-09-01 10:02:33.000000000","message":"Done","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e2d38acdad52fa85a6f5118e65b6556cd283b45","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        if trunk is None:"},{"line_number":141,"context_line":"            LOG.error(_LE(\"Port %s has no trunk associated.\"),"},{"line_number":142,"context_line":"                      parent_port_id)"},{"line_number":143,"context_line":"            return"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_d034c1df","line":141,"updated":"2016-08-31 23:36:23.000000000","message":"so much work for nothing! :)","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        if trunk is None:"},{"line_number":141,"context_line":"            LOG.error(_LE(\"Port %s has no trunk associated.\"),"},{"line_number":142,"context_line":"                      parent_port_id)"},{"line_number":143,"context_line":"            return"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_d95bfbf4","line":141,"in_reply_to":"fa7ab95a_d034c1df","updated":"2016-09-01 10:02:33.000000000","message":"This code is never gonna be triggered :) Which makes me wonder that we should cover this case with unittest.","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e2d38acdad52fa85a6f5118e65b6556cd283b45","unresolved":false,"context_lines":[{"line_number":146,"context_line":"            trunk.id, trunk.port_id, port[\u0027external_ids\u0027].get("},{"line_number":147,"context_line":"                \u0027attached-mac\u0027))"},{"line_number":148,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":149,"context_line":"        # name"},{"line_number":150,"context_line":"        port[\u0027external_ids\u0027][\u0027bridge_name\u0027] \u003d trunk_br.br_name"},{"line_number":151,"context_line":"        trunk_br.set_db_attribute("},{"line_number":152,"context_line":"            \u0027Interface\u0027, port[\u0027name\u0027], \u0027external_ids\u0027, port[\u0027external_ids\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_d04be157","line":149,"updated":"2016-08-31 23:36:23.000000000","message":"can we comment when it\u0027s used, ie. when we remove like 82?","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":146,"context_line":"            trunk.id, trunk.port_id, port[\u0027external_ids\u0027].get("},{"line_number":147,"context_line":"                \u0027attached-mac\u0027))"},{"line_number":148,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":149,"context_line":"        # name"},{"line_number":150,"context_line":"        port[\u0027external_ids\u0027][\u0027bridge_name\u0027] \u003d trunk_br.br_name"},{"line_number":151,"context_line":"        trunk_br.set_db_attribute("},{"line_number":152,"context_line":"            \u0027Interface\u0027, port[\u0027name\u0027], \u0027external_ids\u0027, port[\u0027external_ids\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_2aac8334","line":149,"in_reply_to":"fa7ab95a_d04be157","updated":"2016-09-01 10:02:33.000000000","message":"Done","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e2d38acdad52fa85a6f5118e65b6556cd283b45","unresolved":false,"context_lines":[{"line_number":161,"context_line":"                                            subport.segmentation_id)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"        self.trunk_rpc.update_trunk_status(ctx, trunk.id,"},{"line_number":164,"context_line":"                                           constants.ACTIVE_STATUS)"},{"line_number":165,"context_line":"        LOG.debug(\"Added trunk: %s\", trunk.id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_1074699a","line":164,"updated":"2016-08-31 23:36:23.000000000","message":"woot?","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0438ced5658fd4e0a2a9674499ed7c13ddcb269f","unresolved":false,"context_lines":[{"line_number":161,"context_line":"                                            subport.segmentation_id)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"        self.trunk_rpc.update_trunk_status(ctx, trunk.id,"},{"line_number":164,"context_line":"                                           constants.ACTIVE_STATUS)"},{"line_number":165,"context_line":"        LOG.debug(\"Added trunk: %s\", trunk.id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_8a74af9c","line":164,"in_reply_to":"fa7ab95a_1074699a","updated":"2016-09-01 10:02:33.000000000","message":"Wow, a loot? Do you mean it should not be called?","commit_id":"fcecccf8ffaa7e85c0ec47b46afbdc99cb77a8c1"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"9c1f557459bb51e8f69e614a89b6ab4f5be2c86d","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"WAIT_FOR_PORT_TIMEOUT \u003d 60"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def is_trunk_bridge(port_name):"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_ef31a6ee","line":36,"updated":"2016-09-01 20:00:26.000000000","message":"I think this is a reasonable default timeout. I also appreciate not having to make this configurable.","commit_id":"ea3891f4855a6b692a485f133636891d13b3032f"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"9c1f557459bb51e8f69e614a89b6ab4f5be2c86d","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    return port_name.startswith(t_const.TRUNK_BR_PREFIX)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def is_trunk_service_port(port_name):"},{"line_number":44,"context_line":"    \"\"\"True if the port is any of the ports used to realize a trunk.\"\"\""},{"line_number":45,"context_line":"    return not is_trunk_bridge(port_name) and port_name[:2] not in ("},{"line_number":46,"context_line":"        trunk_manager.TrunkParentPort.DEV_PREFIX,"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_fc03260e","line":43,"range":{"start_line":43,"start_character":4,"end_line":43,"end_character":25},"updated":"2016-09-01 20:00:26.000000000","message":"You changed the name of the function, but the end result is still the same as what it was before. I see the following on the trunk bridge:\n\nservice ports: tbr-*, tpt-*, spt-*\nvif port: anything else\n\nThis method still returns True if the port is a vif port. Did you mean to negate this like in Armando\u0027s comment on PS7?","commit_id":"ea3891f4855a6b692a485f133636891d13b3032f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"db8d916e2d3ab0e40014a68e98e8a9da9fe0860e","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    return port_name.startswith(t_const.TRUNK_BR_PREFIX)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def is_trunk_service_port(port_name):"},{"line_number":44,"context_line":"    \"\"\"True if the port is any of the ports used to realize a trunk.\"\"\""},{"line_number":45,"context_line":"    return not is_trunk_bridge(port_name) and port_name[:2] not in ("},{"line_number":46,"context_line":"        trunk_manager.TrunkParentPort.DEV_PREFIX,"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_0d497260","line":43,"range":{"start_line":43,"start_character":4,"end_line":43,"end_character":25},"in_reply_to":"fa7ab95a_fc03260e","updated":"2016-09-01 20:17:58.000000000","message":"Ah, I read it wrong. I missed the negate part :( Thanks","commit_id":"ea3891f4855a6b692a485f133636891d13b3032f"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"9c1f557459bb51e8f69e614a89b6ab4f5be2c86d","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        It removes the trunk bridge as no port was plugged in within given"},{"line_number":112,"context_line":"        timeout."},{"line_number":113,"context_line":"        \"\"\""},{"line_number":114,"context_line":"        LOG.error(_LE(\u0027No port appeared on bridge %(br_name)s in %(timeout)d \u0027"},{"line_number":115,"context_line":"                      \u0027seconds. Cleaning up the bridge\u0027),"},{"line_number":116,"context_line":"                  {\u0027br_name\u0027: bridge.br_name,"},{"line_number":117,"context_line":"                   \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_32bdb568","line":114,"range":{"start_line":114,"start_character":43,"end_line":114,"end_character":49},"updated":"2016-09-01 20:00:26.000000000","message":"I think we should be more specific and say \"trunk bridge\", so it doesn\u0027t seem like we do this for *any* bridge.","commit_id":"ea3891f4855a6b692a485f133636891d13b3032f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"db8d916e2d3ab0e40014a68e98e8a9da9fe0860e","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        It removes the trunk bridge as no port was plugged in within given"},{"line_number":112,"context_line":"        timeout."},{"line_number":113,"context_line":"        \"\"\""},{"line_number":114,"context_line":"        LOG.error(_LE(\u0027No port appeared on bridge %(br_name)s in %(timeout)d \u0027"},{"line_number":115,"context_line":"                      \u0027seconds. Cleaning up the bridge\u0027),"},{"line_number":116,"context_line":"                  {\u0027br_name\u0027: bridge.br_name,"},{"line_number":117,"context_line":"                   \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_0dbc1205","line":114,"range":{"start_line":114,"start_character":43,"end_line":114,"end_character":49},"in_reply_to":"fa7ab95a_32bdb568","updated":"2016-09-01 20:17:58.000000000","message":"Done","commit_id":"ea3891f4855a6b692a485f133636891d13b3032f"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"9c1f557459bb51e8f69e614a89b6ab4f5be2c86d","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                   \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"},{"line_number":118,"context_line":"        bridge.destroy()"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def create_trunk(self, trunk_br, port):"},{"line_number":121,"context_line":"        \"\"\"Wire trunk bridge with integration bridge."},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        The method calls into trunk manager to create patch ports for trunk and"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_52a799bc","line":120,"range":{"start_line":120,"start_character":27,"end_line":120,"end_character":35},"updated":"2016-09-01 20:00:26.000000000","message":"nit: since the only attribute of trunk_br used is its name, should we just pass the trunk_br.br_name here and stick to using self.br_int as the API like on L164?","commit_id":"ea3891f4855a6b692a485f133636891d13b3032f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"db8d916e2d3ab0e40014a68e98e8a9da9fe0860e","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                   \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"},{"line_number":118,"context_line":"        bridge.destroy()"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def create_trunk(self, trunk_br, port):"},{"line_number":121,"context_line":"        \"\"\"Wire trunk bridge with integration bridge."},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        The method calls into trunk manager to create patch ports for trunk and"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_edf7eed0","line":120,"range":{"start_line":120,"start_character":27,"end_line":120,"end_character":35},"in_reply_to":"fa7ab95a_52a799bc","updated":"2016-09-01 20:17:58.000000000","message":"I\u0027d rather use bridge with operations that are related to it. It\u0027s semantically correct and also there could be bugs like https://bugs.launchpad.net/neutron/+bug/1616815","commit_id":"ea3891f4855a6b692a485f133636891d13b3032f"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"9c1f557459bb51e8f69e614a89b6ab4f5be2c86d","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        :param trunk_br: The trunk bridge."},{"line_number":127,"context_line":"        :param port: Parent port dict."},{"line_number":128,"context_line":"        \"\"\""},{"line_number":129,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":130,"context_line":"        parent_port_id \u003d trunk_br.portid_from_external_ids("},{"line_number":131,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":132,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        if trunk is None:"},{"line_number":135,"context_line":"            LOG.error(_LE(\"Port %s has no trunk associated.\"),"},{"line_number":136,"context_line":"                      parent_port_id)"},{"line_number":137,"context_line":"            return"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        self.trunk_manager.create_trunk("},{"line_number":140,"context_line":"            trunk.id, trunk.port_id, port[\u0027external_ids\u0027].get("}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_523dd98d","line":137,"range":{"start_line":129,"start_character":8,"end_line":137,"end_character":18},"updated":"2016-09-01 20:00:26.000000000","message":"nit: this is basically of copy of L176-180, except that retrieving the parent_port_id is moved into this method.\n\nIf we get rid of handle_deleted_trunk() and instead call remove_trunk_port() directly with the port_event, we could move L129-137 into a shared helper method and reuse it here and in remove_trunk_port().\n\n ctx, trunk \u003d self._get_trunk(port[\u0027external_ids\u0027])\n if trunk is None:\n     return","commit_id":"ea3891f4855a6b692a485f133636891d13b3032f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"db8d916e2d3ab0e40014a68e98e8a9da9fe0860e","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        :param trunk_br: The trunk bridge."},{"line_number":127,"context_line":"        :param port: Parent port dict."},{"line_number":128,"context_line":"        \"\"\""},{"line_number":129,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":130,"context_line":"        parent_port_id \u003d trunk_br.portid_from_external_ids("},{"line_number":131,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":132,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        if trunk is None:"},{"line_number":135,"context_line":"            LOG.error(_LE(\"Port %s has no trunk associated.\"),"},{"line_number":136,"context_line":"                      parent_port_id)"},{"line_number":137,"context_line":"            return"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        self.trunk_manager.create_trunk("},{"line_number":140,"context_line":"            trunk.id, trunk.port_id, port[\u0027external_ids\u0027].get("}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_8dfbc27a","line":137,"range":{"start_line":129,"start_character":8,"end_line":137,"end_character":18},"in_reply_to":"fa7ab95a_523dd98d","updated":"2016-09-01 20:17:58.000000000","message":"Hm, I don\u0027t think it will save us much as we\u0027ll eventually need to also pass trunk bridge and double check that trunk is None. You\u0027re right that we don\u0027t need to have handle_deleted_trunk() separately and move portid_from_extenral_ids inside of remove_trunk_port.","commit_id":"ea3891f4855a6b692a485f133636891d13b3032f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2839c4e97cee11fdbacea9032cc18c62e000f73b","unresolved":false,"context_lines":[{"line_number":52,"context_line":"       prefix."},{"line_number":53,"context_line":"    \"\"\""},{"line_number":54,"context_line":"    ifaces \u003d bridge.get_iface_name_list()"},{"line_number":55,"context_line":"    return bool([iface for iface in ifaces"},{"line_number":56,"context_line":"                 if not is_trunk_service_port(iface)])"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_07d0631e","line":55,"updated":"2016-09-02 03:12:07.000000000","message":"could have been any() rather than bool but it\u0027s not important.","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0859a399bf994ed42651c325cb9e6fa0679b09c2","unresolved":false,"context_lines":[{"line_number":52,"context_line":"       prefix."},{"line_number":53,"context_line":"    \"\"\""},{"line_number":54,"context_line":"    ifaces \u003d bridge.get_iface_name_list()"},{"line_number":55,"context_line":"    return bool([iface for iface in ifaces"},{"line_number":56,"context_line":"                 if not is_trunk_service_port(iface)])"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_149b2867","line":55,"in_reply_to":"fa7ab95a_07d0631e","updated":"2016-09-02 10:09:37.000000000","message":"Done","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"9db902f541f2712a21cb752e2eaaa100c67b4b40","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                # in a separate greenthread."},{"line_number":80,"context_line":"                eventlet.spawn_n(process_trunk_bridge)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":83,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":84,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":85,"context_line":"                remove_trunk \u003d functools.partial("}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_dd656345","line":82,"updated":"2016-09-02 09:42:54.000000000","message":"trunk create/remove happen concurrently without any locks?\nisn\u0027t this potentially racy?","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"554d8b54fb494f7686a0cd38cdffacf509705ba9","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                # in a separate greenthread."},{"line_number":80,"context_line":"                eventlet.spawn_n(process_trunk_bridge)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":83,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":84,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":85,"context_line":"                remove_trunk \u003d functools.partial("}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_5f7e9d6a","line":82,"in_reply_to":"fa7ab95a_43a410a5","updated":"2016-09-02 14:31:37.000000000","message":"Done","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0859a399bf994ed42651c325cb9e6fa0679b09c2","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                # in a separate greenthread."},{"line_number":80,"context_line":"                eventlet.spawn_n(process_trunk_bridge)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":83,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":84,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":85,"context_line":"                remove_trunk \u003d functools.partial("}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_43a410a5","line":82,"in_reply_to":"fa7ab95a_dd656345","updated":"2016-09-02 10:09:37.000000000","message":"You mean that we can add a trunk port and immediately delete it and it can happen that \u0027added\u0027 is not processed yet and we start processing \u0027delete\u0027? Hmm, good point.","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"efacaee4c8aec09333125f6318331d5be4783ea3","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":131,"context_line":"        parent_port_id \u003d trunk_br.portid_from_external_ids("},{"line_number":132,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":133,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        if trunk is None:"},{"line_number":136,"context_line":"            LOG.error(_LE(\"Port %s has no trunk associated.\"),"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_27256708","line":133,"updated":"2016-09-02 03:19:06.000000000","message":"this could raise a remote error, though I can\u0027t see any sensible handling.","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"554d8b54fb494f7686a0cd38cdffacf509705ba9","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":131,"context_line":"        parent_port_id \u003d trunk_br.portid_from_external_ids("},{"line_number":132,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":133,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        if trunk is None:"},{"line_number":136,"context_line":"            LOG.error(_LE(\"Port %s has no trunk associated.\"),"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_c5aada70","line":133,"in_reply_to":"fa7ab95a_27256708","updated":"2016-09-02 14:31:37.000000000","message":"Done, not sure if sensible though :)","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"efacaee4c8aec09333125f6318331d5be4783ea3","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":144,"context_line":"        # name so we can easily get the name of trunk bridge once port is"},{"line_number":145,"context_line":"        # removed"},{"line_number":146,"context_line":"        port[\u0027external_ids\u0027][\u0027bridge_name\u0027] \u003d trunk_br.br_name"},{"line_number":147,"context_line":"        trunk_br.set_db_attribute("},{"line_number":148,"context_line":"            \u0027Interface\u0027, port[\u0027name\u0027], \u0027external_ids\u0027, port[\u0027external_ids\u0027])"},{"line_number":149,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_c732fb5d","line":146,"updated":"2016-09-02 03:19:06.000000000","message":"have you considered storing trunk.id too so that we can avoid fetching it when we remove the trunk?","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0d4142ca2edc7d01c17e9f4cd96efa3264b57164","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":144,"context_line":"        # name so we can easily get the name of trunk bridge once port is"},{"line_number":145,"context_line":"        # removed"},{"line_number":146,"context_line":"        port[\u0027external_ids\u0027][\u0027bridge_name\u0027] \u003d trunk_br.br_name"},{"line_number":147,"context_line":"        trunk_br.set_db_attribute("},{"line_number":148,"context_line":"            \u0027Interface\u0027, port[\u0027name\u0027], \u0027external_ids\u0027, port[\u0027external_ids\u0027])"},{"line_number":149,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_e40e073c","line":146,"in_reply_to":"fa7ab95a_84eb7bdb","updated":"2016-09-02 12:09:31.000000000","message":"I tried to store the list of subports to ovsdb as well so we don\u0027t need to issue any rpc call to server during removal, it revealed a bug in native ovsdb interface - https://bugs.launchpad.net/neutron/+bug/1619637. I got a workaround though.","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"eeed30fea77c74be81f03302508ae694ace2b105","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":144,"context_line":"        # name so we can easily get the name of trunk bridge once port is"},{"line_number":145,"context_line":"        # removed"},{"line_number":146,"context_line":"        port[\u0027external_ids\u0027][\u0027bridge_name\u0027] \u003d trunk_br.br_name"},{"line_number":147,"context_line":"        trunk_br.set_db_attribute("},{"line_number":148,"context_line":"            \u0027Interface\u0027, port[\u0027name\u0027], \u0027external_ids\u0027, port[\u0027external_ids\u0027])"},{"line_number":149,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_84eb7bdb","line":146,"in_reply_to":"fa7ab95a_c732fb5d","updated":"2016-09-02 11:56:08.000000000","message":"we need to fetch the trunk anyway to get the subport. What would help me in dealing with the resync is storing the parent port id. When a resync happens, the agent might miss the port delete event and I have no way to retrieve the parent port id.","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"efacaee4c8aec09333125f6318331d5be4783ea3","unresolved":false,"context_lines":[{"line_number":148,"context_line":"            \u0027Interface\u0027, port[\u0027name\u0027], \u0027external_ids\u0027, port[\u0027external_ids\u0027])"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        subport_bindings \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":151,"context_line":"            ctx, trunk.sub_ports)"},{"line_number":152,"context_line":"        subports \u003d subport_bindings.get(trunk.id, [])"},{"line_number":153,"context_line":"        subports_mac \u003d {p[\u0027id\u0027]: p[\u0027mac_address\u0027] for p in subports}"},{"line_number":154,"context_line":"        for subport in trunk.sub_ports:"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_273e4728","line":151,"updated":"2016-09-02 03:19:06.000000000","message":"this should probably be wrapped into an except and if we fail we should delete the trunk?","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"554d8b54fb494f7686a0cd38cdffacf509705ba9","unresolved":false,"context_lines":[{"line_number":148,"context_line":"            \u0027Interface\u0027, port[\u0027name\u0027], \u0027external_ids\u0027, port[\u0027external_ids\u0027])"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        subport_bindings \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":151,"context_line":"            ctx, trunk.sub_ports)"},{"line_number":152,"context_line":"        subports \u003d subport_bindings.get(trunk.id, [])"},{"line_number":153,"context_line":"        subports_mac \u003d {p[\u0027id\u0027]: p[\u0027mac_address\u0027] for p in subports}"},{"line_number":154,"context_line":"        for subport in trunk.sub_ports:"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_85cb7252","line":151,"in_reply_to":"fa7ab95a_273e4728","updated":"2016-09-02 14:31:37.000000000","message":"Done","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0859a399bf994ed42651c325cb9e6fa0679b09c2","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        The method calls into trunk manager to remove patch ports on"},{"line_number":167,"context_line":"        integration bridge side and to delete the trunk bridge."},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        :param parent_port_id: The ID of trunk parent port."},{"line_number":170,"context_line":"        \"\"\""},{"line_number":171,"context_line":"        parent_port_id \u003d self.br_int.portid_from_external_ids("},{"line_number":172,"context_line":"            port[\u0027external_ids\u0027])"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_e8d8a355","line":169,"range":{"start_line":169,"start_character":15,"end_line":169,"end_character":59},"updated":"2016-09-02 10:09:37.000000000","message":"I\u0027m such a liar","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"efacaee4c8aec09333125f6318331d5be4783ea3","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        parent_port_id \u003d self.br_int.portid_from_external_ids("},{"line_number":172,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":173,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":174,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":175,"context_line":"        if trunk is None:"},{"line_number":176,"context_line":"            LOG.error(_LE(\"Port %s has no trunk associated\"), parent_port_id)"},{"line_number":177,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_076f832b","line":174,"range":{"start_line":174,"start_character":41,"end_line":174,"end_character":42},"updated":"2016-09-02 03:19:06.000000000","message":"see comment 146","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"efacaee4c8aec09333125f6318331d5be4783ea3","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            self.trunk_manager.remove_sub_port(trunk.id, subport.port_id)"},{"line_number":181,"context_line":"        self.trunk_manager.remove_trunk(trunk.id, trunk.port_id)"},{"line_number":182,"context_line":"        LOG.debug(\"Deleted trunk: %s\", trunk.id)"},{"line_number":183,"context_line":"        self.trunk_rpc.update_trunk_status(ctx, trunk.id,"},{"line_number":184,"context_line":"                                           constants.DOWN_STATUS)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_c7575b58","line":183,"updated":"2016-09-02 03:19:06.000000000","message":"don\u0027t need this, this is handled server side as soon as the parent port becomes unbound. This helps us avoid races, e.g. two agents racing with each other during VM migration.","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0859a399bf994ed42651c325cb9e6fa0679b09c2","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            self.trunk_manager.remove_sub_port(trunk.id, subport.port_id)"},{"line_number":181,"context_line":"        self.trunk_manager.remove_trunk(trunk.id, trunk.port_id)"},{"line_number":182,"context_line":"        LOG.debug(\"Deleted trunk: %s\", trunk.id)"},{"line_number":183,"context_line":"        self.trunk_rpc.update_trunk_status(ctx, trunk.id,"},{"line_number":184,"context_line":"                                           constants.DOWN_STATUS)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa7ab95a_b4127cb2","line":183,"in_reply_to":"fa7ab95a_c7575b58","updated":"2016-09-02 10:09:37.000000000","message":"Done","commit_id":"654a2bb2a8685145d4a7139e64211ad605b1910a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8ff008e746262718f2ebaebb51cd66aa60c481cd","unresolved":false,"context_lines":[{"line_number":78,"context_line":"                trunk_br \u003d ovs_lib.OVSBridge(port_name)"},{"line_number":79,"context_line":"                # As there is active waiting for port to appear, it\u0027s handled"},{"line_number":80,"context_line":"                # in a separate greenthread."},{"line_number":81,"context_line":"                eventlet.spawn_n(self.handle_new_trunk_bridge, trunk_br)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":84,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_61b9b62e","line":81,"updated":"2016-09-02 15:25:29.000000000","message":"a nit from a freak like me: if this is called handle_new_trunk_bridge, I\u0027d call the other method somewhat similarly for symmetry so that it\u0027s easier to remember that both are the \u0027entry\u0027 points to ovsdb events. So how about:\n\n  handle_trunk_add\n  handle_trunk_remove","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"d04ddb1c4acb842dbdafe0af815620e4d533f618","unresolved":false,"context_lines":[{"line_number":78,"context_line":"                trunk_br \u003d ovs_lib.OVSBridge(port_name)"},{"line_number":79,"context_line":"                # As there is active waiting for port to appear, it\u0027s handled"},{"line_number":80,"context_line":"                # in a separate greenthread."},{"line_number":81,"context_line":"                eventlet.spawn_n(self.handle_new_trunk_bridge, trunk_br)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        for port_event in ovsdb_events[\u0027removed\u0027]:"},{"line_number":84,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_e4c954ae","line":81,"in_reply_to":"da7fb54a_61b9b62e","updated":"2016-09-02 15:45:44.000000000","message":"Done","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8ff008e746262718f2ebaebb51cd66aa60c481cd","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        :param bridge: OVSBridge object representing the trunk bridge."},{"line_number":93,"context_line":"        \"\"\""},{"line_number":94,"context_line":"        with lockutils.lock(bridge.br_name):"},{"line_number":95,"context_line":"            bridge_has_port_predicate \u003d functools.partial("},{"line_number":96,"context_line":"                bridge_has_instance_port, bridge)"},{"line_number":97,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa7ab95a_23ad3b84","line":94,"updated":"2016-09-02 15:25:29.000000000","message":"nit: have you considered to decorate the whole method and avoid the extra indentation?","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"d04ddb1c4acb842dbdafe0af815620e4d533f618","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        :param bridge: OVSBridge object representing the trunk bridge."},{"line_number":93,"context_line":"        \"\"\""},{"line_number":94,"context_line":"        with lockutils.lock(bridge.br_name):"},{"line_number":95,"context_line":"            bridge_has_port_predicate \u003d functools.partial("},{"line_number":96,"context_line":"                bridge_has_instance_port, bridge)"},{"line_number":97,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_01bb8a73","line":94,"in_reply_to":"fa7ab95a_23ad3b84","updated":"2016-09-02 15:45:44.000000000","message":"I thought only about lockutils decorator, haven\u0027t thought we could write our own consuming the bridge name.","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b5130235006033354377da0905590cacde8912fe","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                if_exists\u003dTrue)"},{"line_number":107,"context_line":"            for trunk_br_port in trunk_br_ports:"},{"line_number":108,"context_line":"                if not is_trunk_service_port(trunk_br_port[\u0027name\u0027]):"},{"line_number":109,"context_line":"                    self.create_trunk(bridge, trunk_br_port)"},{"line_number":110,"context_line":"                    break"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def handle_no_port(self, bridge):"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_01a46a55","line":109,"updated":"2016-09-02 15:28:18.000000000","message":"this raises TrunkBridgeNotFound, we should catch/handle it.","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"d04ddb1c4acb842dbdafe0af815620e4d533f618","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                if_exists\u003dTrue)"},{"line_number":107,"context_line":"            for trunk_br_port in trunk_br_ports:"},{"line_number":108,"context_line":"                if not is_trunk_service_port(trunk_br_port[\u0027name\u0027]):"},{"line_number":109,"context_line":"                    self.create_trunk(bridge, trunk_br_port)"},{"line_number":110,"context_line":"                    break"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def handle_no_port(self, bridge):"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_e4e794aa","line":109,"in_reply_to":"da7fb54a_01a46a55","updated":"2016-09-02 15:45:44.000000000","message":"Do we want to handle this case? I mean we trigger this operation based on that bridge appeared in OVS. if it gets lost in between it\u0027s a fatal error and I would expect to see a traceback. Good programs don\u0027t show tracebacks? :)","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8ff008e746262718f2ebaebb51cd66aa60c481cd","unresolved":false,"context_lines":[{"line_number":109,"context_line":"                    self.create_trunk(bridge, trunk_br_port)"},{"line_number":110,"context_line":"                    break"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def handle_no_port(self, bridge):"},{"line_number":113,"context_line":"        \"\"\"Error handling routine that occurs when port doesn\u0027t appear on"},{"line_number":114,"context_line":"        bridge."},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"fa7ab95a_a32cebac","line":112,"updated":"2016-09-02 15:25:29.000000000","message":"This is called once,  and it\u0027s practically a single operation. Is inlining better perhaps (ie. get rid of the method)?","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"d04ddb1c4acb842dbdafe0af815620e4d533f618","unresolved":false,"context_lines":[{"line_number":109,"context_line":"                    self.create_trunk(bridge, trunk_br_port)"},{"line_number":110,"context_line":"                    break"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def handle_no_port(self, bridge):"},{"line_number":113,"context_line":"        \"\"\"Error handling routine that occurs when port doesn\u0027t appear on"},{"line_number":114,"context_line":"        bridge."},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_24c41c91","line":112,"in_reply_to":"fa7ab95a_a32cebac","updated":"2016-09-02 15:45:44.000000000","message":"Done","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8ff008e746262718f2ebaebb51cd66aa60c481cd","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                   \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"},{"line_number":125,"context_line":"        bridge.destroy()"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def create_trunk(self, trunk_br, port):"},{"line_number":128,"context_line":"        \"\"\"Wire trunk bridge with integration bridge."},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        The method calls into trunk manager to create patch ports for trunk and"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_6149b6d0","line":127,"updated":"2016-09-02 15:25:29.000000000","message":"is this perhaps a private method? Or do you expect this to be called elsewhere?","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"d04ddb1c4acb842dbdafe0af815620e4d533f618","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                   \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"},{"line_number":125,"context_line":"        bridge.destroy()"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def create_trunk(self, trunk_br, port):"},{"line_number":128,"context_line":"        \"\"\"Wire trunk bridge with integration bridge."},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        The method calls into trunk manager to create patch ports for trunk and"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_04463823","line":127,"in_reply_to":"da7fb54a_6149b6d0","updated":"2016-09-02 15:45:44.000000000","message":"I\u0027m not a fan of \u0027private\u0027 things in Python, there was a reason of not introducing such words :). I renamed it to _process_trunk()","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"48356ff05c1390f7e604016efe629b0e4e24ab32","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        The method calls into trunk manager to create patch ports for trunk and"},{"line_number":131,"context_line":"        patch ports for all subports associated with this trunk."},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        :param trunk_br: OVSbridge object representing the trunk bridge."},{"line_number":134,"context_line":"        :param port: Parent port dict."},{"line_number":135,"context_line":"        \"\"\""},{"line_number":136,"context_line":"        ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa7ab95a_966baa1d","line":133,"range":{"start_line":133,"start_character":28,"end_line":133,"end_character":29},"updated":"2016-09-02 15:55:34.000000000","message":"B","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"35cab02ba18f5e33cca12f60b6a937d6609a2e4c","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        The method calls into trunk manager to create patch ports for trunk and"},{"line_number":131,"context_line":"        patch ports for all subports associated with this trunk."},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        :param trunk_br: OVSbridge object representing the trunk bridge."},{"line_number":134,"context_line":"        :param port: Parent port dict."},{"line_number":135,"context_line":"        \"\"\""},{"line_number":136,"context_line":"        ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_0a147ff3","line":133,"range":{"start_line":133,"start_character":28,"end_line":133,"end_character":29},"in_reply_to":"fa7ab95a_966baa1d","updated":"2016-09-02 16:25:09.000000000","message":"Done","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"48356ff05c1390f7e604016efe629b0e4e24ab32","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":139,"context_line":"        try:"},{"line_number":140,"context_line":"            trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":141,"context_line":"        except oslo_messaging.MessagingException as e:"},{"line_number":142,"context_line":"            LOG.error(_LE(\"Got messaging error while obtaining details for \""},{"line_number":143,"context_line":"                          \"trunk with parent port ID %(port_id)s.: %(error)s\"),"},{"line_number":144,"context_line":"                      {\u0027port_id\u0027: parent_port_id,"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa7ab95a_b1c19831","line":141,"updated":"2016-09-02 15:55:34.000000000","message":"I think it would be sensible to delete the trunk bridge here. The VM wouldn\u0027t have any connectivity whatsoever, so the user might try recreating the VM or replugging the port. In either case, if the trunk bridge still exists, this codepath will never be triggered because the trunk bridge isn\u0027t being recreated. By deleting the trunk bridge, the user actually has a chance at regaining connectivity using the same trunk port later down the line.","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"0d2b05d0ea46413b6336a553e2c2133b27c2850e","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":139,"context_line":"        try:"},{"line_number":140,"context_line":"            trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":141,"context_line":"        except oslo_messaging.MessagingException as e:"},{"line_number":142,"context_line":"            LOG.error(_LE(\"Got messaging error while obtaining details for \""},{"line_number":143,"context_line":"                          \"trunk with parent port ID %(port_id)s.: %(error)s\"),"},{"line_number":144,"context_line":"                      {\u0027port_id\u0027: parent_port_id,"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_50f55a81","line":141,"in_reply_to":"da7fb54a_6ac8ab75","updated":"2016-09-02 16:52:18.000000000","message":"Ok, I hadn\u0027t thought about the resync happening in this case. If we expect a resync operation to occur, then we should keep the trunk bridge around.","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"35cab02ba18f5e33cca12f60b6a937d6609a2e4c","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":139,"context_line":"        try:"},{"line_number":140,"context_line":"            trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":141,"context_line":"        except oslo_messaging.MessagingException as e:"},{"line_number":142,"context_line":"            LOG.error(_LE(\"Got messaging error while obtaining details for \""},{"line_number":143,"context_line":"                          \"trunk with parent port ID %(port_id)s.: %(error)s\"),"},{"line_number":144,"context_line":"                      {\u0027port_id\u0027: parent_port_id,"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_6ac8ab75","line":141,"in_reply_to":"fa7ab95a_b1c19831","updated":"2016-09-02 16:25:09.000000000","message":"I don\u0027t think we should delete. Once the rpc gets back, server asks agent to resync and it will need the trunk bridge to do the plugging.","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"48356ff05c1390f7e604016efe629b0e4e24ab32","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":141,"context_line":"        except oslo_messaging.MessagingException as e:"},{"line_number":142,"context_line":"            LOG.error(_LE(\"Got messaging error while obtaining details for \""},{"line_number":143,"context_line":"                          \"trunk with parent port ID %(port_id)s.: %(error)s\"),"},{"line_number":144,"context_line":"                      {\u0027port_id\u0027: parent_port_id,"},{"line_number":145,"context_line":"                       \u0027error\u0027: str(e)})"},{"line_number":146,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa7ab95a_768aa6c0","line":143,"range":{"start_line":143,"start_character":64,"end_line":143,"end_character":65},"updated":"2016-09-02 15:55:34.000000000","message":"I would remove this period","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"35cab02ba18f5e33cca12f60b6a937d6609a2e4c","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":141,"context_line":"        except oslo_messaging.MessagingException as e:"},{"line_number":142,"context_line":"            LOG.error(_LE(\"Got messaging error while obtaining details for \""},{"line_number":143,"context_line":"                          \"trunk with parent port ID %(port_id)s.: %(error)s\"),"},{"line_number":144,"context_line":"                      {\u0027port_id\u0027: parent_port_id,"},{"line_number":145,"context_line":"                       \u0027error\u0027: str(e)})"},{"line_number":146,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_ca30d7a1","line":143,"range":{"start_line":143,"start_character":64,"end_line":143,"end_character":65},"in_reply_to":"fa7ab95a_768aa6c0","updated":"2016-09-02 16:25:09.000000000","message":"Done","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"48356ff05c1390f7e604016efe629b0e4e24ab32","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        try:"},{"line_number":158,"context_line":"            subport_bindings \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":159,"context_line":"                ctx, trunk.sub_ports)"},{"line_number":160,"context_line":"        except oslo_messaging.MessagingException as e:"},{"line_number":161,"context_line":"            trunk_br.destroy()"},{"line_number":162,"context_line":"            LOG.error(_LE(\"Got messaging error while updating port bindings \""},{"line_number":163,"context_line":"                          \"for following subports: %(subports)s: %(error)s\"),"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa7ab95a_4384ff09","line":160,"updated":"2016-09-02 15:55:34.000000000","message":"Even though we got a MessagingException here, should we still attempt to set the trunk status to ERROR for good measure?","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"0d2b05d0ea46413b6336a553e2c2133b27c2850e","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        try:"},{"line_number":158,"context_line":"            subport_bindings \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":159,"context_line":"                ctx, trunk.sub_ports)"},{"line_number":160,"context_line":"        except oslo_messaging.MessagingException as e:"},{"line_number":161,"context_line":"            trunk_br.destroy()"},{"line_number":162,"context_line":"            LOG.error(_LE(\"Got messaging error while updating port bindings \""},{"line_number":163,"context_line":"                          \"for following subports: %(subports)s: %(error)s\"),"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_70e5fea6","line":160,"in_reply_to":"da7fb54a_0aec7fc6","updated":"2016-09-02 16:52:18.000000000","message":"Most likely yes, I think I wasn\u0027t clear. Anyways I think we can disregard my comment here altogether :)","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"35cab02ba18f5e33cca12f60b6a937d6609a2e4c","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        try:"},{"line_number":158,"context_line":"            subport_bindings \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":159,"context_line":"                ctx, trunk.sub_ports)"},{"line_number":160,"context_line":"        except oslo_messaging.MessagingException as e:"},{"line_number":161,"context_line":"            trunk_br.destroy()"},{"line_number":162,"context_line":"            LOG.error(_LE(\"Got messaging error while updating port bindings \""},{"line_number":163,"context_line":"                          \"for following subports: %(subports)s: %(error)s\"),"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_0aec7fc6","line":160,"in_reply_to":"fa7ab95a_4384ff09","updated":"2016-09-02 16:25:09.000000000","message":"Won\u0027t we get a MessagingException if we\u0027d do that? :)","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b5130235006033354377da0905590cacde8912fe","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        subports_mac \u003d {p[\u0027id\u0027]: p[\u0027mac_address\u0027] for p in subports}"},{"line_number":170,"context_line":"        subport_ids \u003d []"},{"line_number":171,"context_line":"        for subport in trunk.sub_ports:"},{"line_number":172,"context_line":"            self.trunk_manager.add_sub_port(trunk.id, subport.port_id,"},{"line_number":173,"context_line":"                                            subports_mac[subport.port_id],"},{"line_number":174,"context_line":"                                            subport.segmentation_id)"},{"line_number":175,"context_line":"            subport_ids.append(subport.port_id)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_a1bbbe74","line":172,"updated":"2016-09-02 15:28:18.000000000","message":"this raises TrunkBridgeNotFound. we should catch/handle it.","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"48356ff05c1390f7e604016efe629b0e4e24ab32","unresolved":false,"context_lines":[{"line_number":175,"context_line":"            subport_ids.append(subport.port_id)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":178,"context_line":"        # name, trunk id and subport ids so we can easily get the name of trunk"},{"line_number":179,"context_line":"        # bridge once port is removed"},{"line_number":180,"context_line":"        port[\u0027external_ids\u0027][\u0027bridge_name\u0027] \u003d trunk_br.br_name"},{"line_number":181,"context_line":"        port[\u0027external_ids\u0027][\u0027trunk_id\u0027] \u003d trunk.id"},{"line_number":182,"context_line":"        # TODO(jlibosva): Stop using jsonutils after bug 1619637 is fixed"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_44f680d8","line":179,"range":{"start_line":178,"start_character":58,"end_line":179,"end_character":37},"updated":"2016-09-02 15:55:34.000000000","message":"I\u0027d say change this to \"remove the trunk bridge and service ports once this port is removed\"","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"35cab02ba18f5e33cca12f60b6a937d6609a2e4c","unresolved":false,"context_lines":[{"line_number":175,"context_line":"            subport_ids.append(subport.port_id)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":178,"context_line":"        # name, trunk id and subport ids so we can easily get the name of trunk"},{"line_number":179,"context_line":"        # bridge once port is removed"},{"line_number":180,"context_line":"        port[\u0027external_ids\u0027][\u0027bridge_name\u0027] \u003d trunk_br.br_name"},{"line_number":181,"context_line":"        port[\u0027external_ids\u0027][\u0027trunk_id\u0027] \u003d trunk.id"},{"line_number":182,"context_line":"        # TODO(jlibosva): Stop using jsonutils after bug 1619637 is fixed"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_75f170cd","line":179,"range":{"start_line":178,"start_character":58,"end_line":179,"end_character":37},"in_reply_to":"da7fb54a_44f680d8","updated":"2016-09-02 16:25:09.000000000","message":"Done","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"48356ff05c1390f7e604016efe629b0e4e24ab32","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        port[\u0027external_ids\u0027][\u0027bridge_name\u0027] \u003d trunk_br.br_name"},{"line_number":181,"context_line":"        port[\u0027external_ids\u0027][\u0027trunk_id\u0027] \u003d trunk.id"},{"line_number":182,"context_line":"        # TODO(jlibosva): Stop using jsonutils after bug 1619637 is fixed"},{"line_number":183,"context_line":"        port[\u0027external_ids\u0027][\u0027subport_ids\u0027] \u003d jsonutils.dumps(subport_ids)"},{"line_number":184,"context_line":"        trunk_br.set_db_attribute("},{"line_number":185,"context_line":"            \u0027Interface\u0027, port[\u0027name\u0027], \u0027external_ids\u0027, port[\u0027external_ids\u0027])"},{"line_number":186,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_c41610a7","line":183,"updated":"2016-09-02 15:55:34.000000000","message":"Can we set 4k subport_ids in the external_ids? Does OVS limit this at all?\n\nAlternatively, we could list the ports on the trunk bridge and check the suffix to get the port_id prefix. But, this would require updating the TrunkManager to support that, so I\u0027m not certain it\u0027s a better approach unless the limit on external_ids is too restrictive. Then again, an RPC call per trunk deletion probably isn\u0027t too much saving in the grand scheme of things.","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"35cab02ba18f5e33cca12f60b6a937d6609a2e4c","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        port[\u0027external_ids\u0027][\u0027bridge_name\u0027] \u003d trunk_br.br_name"},{"line_number":181,"context_line":"        port[\u0027external_ids\u0027][\u0027trunk_id\u0027] \u003d trunk.id"},{"line_number":182,"context_line":"        # TODO(jlibosva): Stop using jsonutils after bug 1619637 is fixed"},{"line_number":183,"context_line":"        port[\u0027external_ids\u0027][\u0027subport_ids\u0027] \u003d jsonutils.dumps(subport_ids)"},{"line_number":184,"context_line":"        trunk_br.set_db_attribute("},{"line_number":185,"context_line":"            \u0027Interface\u0027, port[\u0027name\u0027], \u0027external_ids\u0027, port[\u0027external_ids\u0027])"},{"line_number":186,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_ead03bcc","line":183,"in_reply_to":"da7fb54a_c41610a7","updated":"2016-09-02 16:25:09.000000000","message":"I tried 1k ports and it was fine. I tried 10k but I hit limit of bash itself.","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8ff008e746262718f2ebaebb51cd66aa60c481cd","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        :param bridge_name: Name of trunk bridge."},{"line_number":205,"context_line":"        :param port: Parent port dict."},{"line_number":206,"context_line":"        \"\"\""},{"line_number":207,"context_line":"        with lockutils.lock(bridge_name):"},{"line_number":208,"context_line":"            parent_port_id \u003d self.br_int.portid_from_external_ids("},{"line_number":209,"context_line":"                port[\u0027external_ids\u0027])"},{"line_number":210,"context_line":"            trunk_id \u003d port[\u0027external_ids\u0027][\u0027trunk_id\u0027]"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa7ab95a_8300c735","line":207,"updated":"2016-09-02 15:25:29.000000000","message":"same as above. Please leave a note as to why this lock is important.","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"d04ddb1c4acb842dbdafe0af815620e4d533f618","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        :param bridge_name: Name of trunk bridge."},{"line_number":205,"context_line":"        :param port: Parent port dict."},{"line_number":206,"context_line":"        \"\"\""},{"line_number":207,"context_line":"        with lockutils.lock(bridge_name):"},{"line_number":208,"context_line":"            parent_port_id \u003d self.br_int.portid_from_external_ids("},{"line_number":209,"context_line":"                port[\u0027external_ids\u0027])"},{"line_number":210,"context_line":"            trunk_id \u003d port[\u0027external_ids\u0027][\u0027trunk_id\u0027]"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_4448402e","line":207,"in_reply_to":"fa7ab95a_8300c735","updated":"2016-09-02 15:45:44.000000000","message":"Done","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d9e2cc1ba07b753bd0d7ecb068de8e25415db3fb","unresolved":false,"context_lines":[{"line_number":212,"context_line":""},{"line_number":213,"context_line":"            for subport_id in subport_ids:"},{"line_number":214,"context_line":"                self.trunk_manager.remove_sub_port(trunk_id, subport_id)"},{"line_number":215,"context_line":"            self.trunk_manager.remove_trunk(trunk_id, parent_port_id)"},{"line_number":216,"context_line":"            LOG.debug(\"Deleted trunk: %s\", trunk_id)"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa7ab95a_837a8722","line":215,"updated":"2016-09-02 15:05:16.000000000","message":"don\u0027t we need to destroy the bridge too? Otherwise we leave it dangling.","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"04940b61e1e0fa88bd37f26d080789d335249fe1","unresolved":false,"context_lines":[{"line_number":212,"context_line":""},{"line_number":213,"context_line":"            for subport_id in subport_ids:"},{"line_number":214,"context_line":"                self.trunk_manager.remove_sub_port(trunk_id, subport_id)"},{"line_number":215,"context_line":"            self.trunk_manager.remove_trunk(trunk_id, parent_port_id)"},{"line_number":216,"context_line":"            LOG.debug(\"Deleted trunk: %s\", trunk_id)"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa7ab95a_e6ffe1fe","line":215,"in_reply_to":"fa7ab95a_837a8722","updated":"2016-09-02 15:23:52.000000000","message":"We do - https://github.com/openstack/neutron/blob/master/neutron/services/trunk/drivers/openvswitch/agent/trunk_manager.py#L140","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"48356ff05c1390f7e604016efe629b0e4e24ab32","unresolved":false,"context_lines":[{"line_number":212,"context_line":""},{"line_number":213,"context_line":"            for subport_id in subport_ids:"},{"line_number":214,"context_line":"                self.trunk_manager.remove_sub_port(trunk_id, subport_id)"},{"line_number":215,"context_line":"            self.trunk_manager.remove_trunk(trunk_id, parent_port_id)"},{"line_number":216,"context_line":"            LOG.debug(\"Deleted trunk: %s\", trunk_id)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da7fb54a_27725e7d","line":215,"in_reply_to":"fa7ab95a_e6ffe1fe","updated":"2016-09-02 15:55:34.000000000","message":"Maybe the OVSDBHandler shouldn\u0027t concern itself with removing the subports like this. Should we update trunk_manager.remove_trunk() to take the list of subport_ids and handle that itself?\n\nAlso, I\u0027m probably echoing this again from the TrunkManager reviews, but would it be so bad if we made operation of deleting the trunk bridge and its service ports into a single transaction? One of the arguments against doing that for trunk creation was that a partial failure would leave the trunk completely unusable. But, we don\u0027t care about using the trunk after we delete it, so why not bunch those operations into the same transaction?","commit_id":"3654d2c725ecf1653321b0faff0795b9b1103067"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fa154a90121ed27235da2ba7b60d6588f93a5b41","unresolved":false,"context_lines":[{"line_number":108,"context_line":"            bridge_has_instance_port, bridge)"},{"line_number":109,"context_line":"        try:"},{"line_number":110,"context_line":"            common_utils.wait_until_true("},{"line_number":111,"context_line":"                bridge_has_port_predicate,"},{"line_number":112,"context_line":"                timeout\u003dWAIT_FOR_PORT_TIMEOUT)"},{"line_number":113,"context_line":"        except eventlet.TimeoutError:"},{"line_number":114,"context_line":"            LOG.error("}],"source_content_type":"text/x-python","patch_set":12,"id":"9a89bdaa_28722f7d","line":111,"updated":"2016-09-02 20:52:56.000000000","message":"when we exit this block, couldn\u0027t get hold of the port that make this predicate true so that we can avoid rescanning at 121?","commit_id":"0c929a95de5657e50e63e9fd0a7ae3d01619192d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bd67828dff062fda6838ccd8b2ced54177f21126","unresolved":false,"context_lines":[{"line_number":108,"context_line":"            bridge_has_instance_port, bridge)"},{"line_number":109,"context_line":"        try:"},{"line_number":110,"context_line":"            common_utils.wait_until_true("},{"line_number":111,"context_line":"                bridge_has_port_predicate,"},{"line_number":112,"context_line":"                timeout\u003dWAIT_FOR_PORT_TIMEOUT)"},{"line_number":113,"context_line":"        except eventlet.TimeoutError:"},{"line_number":114,"context_line":"            LOG.error("}],"source_content_type":"text/x-python","patch_set":12,"id":"9a89bdaa_6858b757","line":111,"in_reply_to":"9a89bdaa_28722f7d","updated":"2016-09-02 21:14:56.000000000","message":"I think Rossella already suggested this in one of previous patchsets. This loop won\u0027t fetch the external_ids which we\u0027re interested in later so I think it\u0027s more clear to have dedicated actions - wait for interface and then fetch the data. Note that this runs asynchronously from agent and querying ovsdb with native interface is not an expensive operation .. I hope :)","commit_id":"0c929a95de5657e50e63e9fd0a7ae3d01619192d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c4d8d584c2e499d5938431914dc5371eb8fb4312","unresolved":false,"context_lines":[{"line_number":108,"context_line":"            bridge_has_instance_port, bridge)"},{"line_number":109,"context_line":"        try:"},{"line_number":110,"context_line":"            common_utils.wait_until_true("},{"line_number":111,"context_line":"                bridge_has_port_predicate,"},{"line_number":112,"context_line":"                timeout\u003dWAIT_FOR_PORT_TIMEOUT)"},{"line_number":113,"context_line":"        except eventlet.TimeoutError:"},{"line_number":114,"context_line":"            LOG.error("}],"source_content_type":"text/x-python","patch_set":12,"id":"9a89bdaa_d3c094e3","line":111,"in_reply_to":"9a89bdaa_6858b757","updated":"2016-09-02 21:50:19.000000000","message":"ok, thanks for clearing this up","commit_id":"0c929a95de5657e50e63e9fd0a7ae3d01619192d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"caa19cc0396ee6cd8c936eb429a54d407e7e056c","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                    \u0027in %(timeout)d seconds. Cleaning up the bridge\u0027),"},{"line_number":117,"context_line":"                {\u0027br_name\u0027: bridge.br_name,"},{"line_number":118,"context_line":"                 \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"},{"line_number":119,"context_line":"            bridge.destroy()"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        trunk_br_ports \u003d bridge.get_ports_attributes("},{"line_number":122,"context_line":"            \u0027Interface\u0027, columns\u003d[\u0027name\u0027, \u0027external_ids\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a89bdaa_c83b839b","line":119,"updated":"2016-09-02 20:48:21.000000000","message":"if we get here shouldn\u0027t we return?","commit_id":"0c929a95de5657e50e63e9fd0a7ae3d01619192d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b97435f60e022f92ad26f19954ca12b710ab1576","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                    \u0027in %(timeout)d seconds. Cleaning up the bridge\u0027),"},{"line_number":117,"context_line":"                {\u0027br_name\u0027: bridge.br_name,"},{"line_number":118,"context_line":"                 \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"},{"line_number":119,"context_line":"            bridge.destroy()"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        trunk_br_ports \u003d bridge.get_ports_attributes("},{"line_number":122,"context_line":"            \u0027Interface\u0027, columns\u003d[\u0027name\u0027, \u0027external_ids\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a89bdaa_f372cae4","line":119,"in_reply_to":"9a89bdaa_48adb330","updated":"2016-09-05 16:35:37.000000000","message":"Done","commit_id":"0c929a95de5657e50e63e9fd0a7ae3d01619192d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bd67828dff062fda6838ccd8b2ced54177f21126","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                    \u0027in %(timeout)d seconds. Cleaning up the bridge\u0027),"},{"line_number":117,"context_line":"                {\u0027br_name\u0027: bridge.br_name,"},{"line_number":118,"context_line":"                 \u0027timeout\u0027: WAIT_FOR_PORT_TIMEOUT})"},{"line_number":119,"context_line":"            bridge.destroy()"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        trunk_br_ports \u003d bridge.get_ports_attributes("},{"line_number":122,"context_line":"            \u0027Interface\u0027, columns\u003d[\u0027name\u0027, \u0027external_ids\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a89bdaa_48adb330","line":119,"in_reply_to":"9a89bdaa_c83b839b","updated":"2016-09-02 21:14:56.000000000","message":"We should! Also we should have a unittest to cover this case.","commit_id":"0c929a95de5657e50e63e9fd0a7ae3d01619192d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c5ded691cef8dda5d93658252cd002efd53c6924","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        :param trunk_br: OVSBridge object representing the trunk bridge."},{"line_number":136,"context_line":"        :param port: Parent port dict."},{"line_number":137,"context_line":"        \"\"\""},{"line_number":138,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":139,"context_line":"        parent_port_id \u003d trunk_br.portid_from_external_ids("},{"line_number":140,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":141,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a89bdaa_1f02033f","line":138,"updated":"2016-09-02 19:25:12.000000000","message":"I am thinking of [1], it\u0027s probably best not to make the same mistake.\n\n[1] https://review.openstack.org/#/c/364634","commit_id":"0c929a95de5657e50e63e9fd0a7ae3d01619192d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b97435f60e022f92ad26f19954ca12b710ab1576","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        :param trunk_br: OVSBridge object representing the trunk bridge."},{"line_number":136,"context_line":"        :param port: Parent port dict."},{"line_number":137,"context_line":"        \"\"\""},{"line_number":138,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":139,"context_line":"        parent_port_id \u003d trunk_br.portid_from_external_ids("},{"line_number":140,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":141,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a89bdaa_96d32c38","line":138,"in_reply_to":"9a89bdaa_1f02033f","updated":"2016-09-05 16:35:37.000000000","message":"Done","commit_id":"0c929a95de5657e50e63e9fd0a7ae3d01619192d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c5021bdd02e58fd60257bdc93be578204a4cdf00","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        subports_mac \u003d {p[\u0027id\u0027]: p[\u0027mac_address\u0027] for p in subports}"},{"line_number":172,"context_line":"        subport_ids \u003d []"},{"line_number":173,"context_line":"        for subport in trunk.sub_ports:"},{"line_number":174,"context_line":"            self.trunk_manager.add_sub_port(trunk.id, subport.port_id,"},{"line_number":175,"context_line":"                                            subports_mac[subport.port_id],"},{"line_number":176,"context_line":"                                            subport.segmentation_id)"},{"line_number":177,"context_line":"            subport_ids.append(subport.port_id)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a89bdaa_8eefc3af","line":174,"updated":"2016-09-02 22:27:57.000000000","message":"I suppose if something goes south here, we should update reflect that on the trunk status (i.e. set to DEGRADED).","commit_id":"0c929a95de5657e50e63e9fd0a7ae3d01619192d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b97435f60e022f92ad26f19954ca12b710ab1576","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        subports_mac \u003d {p[\u0027id\u0027]: p[\u0027mac_address\u0027] for p in subports}"},{"line_number":172,"context_line":"        subport_ids \u003d []"},{"line_number":173,"context_line":"        for subport in trunk.sub_ports:"},{"line_number":174,"context_line":"            self.trunk_manager.add_sub_port(trunk.id, subport.port_id,"},{"line_number":175,"context_line":"                                            subports_mac[subport.port_id],"},{"line_number":176,"context_line":"                                            subport.segmentation_id)"},{"line_number":177,"context_line":"            subport_ids.append(subport.port_id)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a89bdaa_d9032072","line":174,"in_reply_to":"9a89bdaa_8eefc3af","updated":"2016-09-05 16:35:37.000000000","message":"Done","commit_id":"0c929a95de5657e50e63e9fd0a7ae3d01619192d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"342e187757c8197dc214cdbec31a03847876c012","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        port[\u0027external_ids\u0027][\u0027bridge_name\u0027] \u003d trunk_br.br_name"},{"line_number":183,"context_line":"        port[\u0027external_ids\u0027][\u0027trunk_id\u0027] \u003d trunk.id"},{"line_number":184,"context_line":"        # TODO(jlibosva): Stop using jsonutils after bug 1619637 is fixed"},{"line_number":185,"context_line":"        port[\u0027external_ids\u0027][\u0027subport_ids\u0027] \u003d jsonutils.dumps(subport_ids)"},{"line_number":186,"context_line":"        trunk_br.set_db_attribute("},{"line_number":187,"context_line":"            \u0027Interface\u0027, port[\u0027name\u0027], \u0027external_ids\u0027, port[\u0027external_ids\u0027])"},{"line_number":188,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a89bdaa_ae5f2774","line":185,"updated":"2016-09-02 22:34:49.000000000","message":"iirc Rawlin tried to store these in the metadata to see what the limitations were, but I don\u0027t recall what the outcome was.","commit_id":"0c929a95de5657e50e63e9fd0a7ae3d01619192d"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"8507f6e1ca9b6b8ba83666c33b44697a9da041ad","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        LOG.debug(\"Deleted trunk: %s\", trunk_id)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def manages_this_trunk(self, trunk_id):"},{"line_number":164,"context_line":"        \"\"\"Ture if this OVSDB handler manges trunk based on given ID.\"\"\""},{"line_number":165,"context_line":"        bridge_name \u003d trunk_utils.gen_trunk_br_name(trunk_id)"},{"line_number":166,"context_line":"        return ovs_lib.BaseOVS().bridge_exists(bridge_name)"},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9a89bdaa_3416c1a7","line":164,"range":{"start_line":164,"start_character":38,"end_line":164,"end_character":44},"updated":"2016-09-06 05:49:14.000000000","message":"manages","commit_id":"78515b0aa8c3cae5b84ee030b75d8e4b3a03ee97"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"8507f6e1ca9b6b8ba83666c33b44697a9da041ad","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        LOG.debug(\"Deleted trunk: %s\", trunk_id)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def manages_this_trunk(self, trunk_id):"},{"line_number":164,"context_line":"        \"\"\"Ture if this OVSDB handler manges trunk based on given ID.\"\"\""},{"line_number":165,"context_line":"        bridge_name \u003d trunk_utils.gen_trunk_br_name(trunk_id)"},{"line_number":166,"context_line":"        return ovs_lib.BaseOVS().bridge_exists(bridge_name)"},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9a89bdaa_94406da7","line":164,"range":{"start_line":164,"start_character":11,"end_line":164,"end_character":15},"updated":"2016-09-06 05:49:14.000000000","message":"true","commit_id":"78515b0aa8c3cae5b84ee030b75d8e4b3a03ee97"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"641d0edf2ad024cf963205b0cea216591ff8e5b5","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        LOG.debug(\"Deleted trunk: %s\", trunk_id)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def manages_this_trunk(self, trunk_id):"},{"line_number":164,"context_line":"        \"\"\"Ture if this OVSDB handler manges trunk based on given ID.\"\"\""},{"line_number":165,"context_line":"        bridge_name \u003d trunk_utils.gen_trunk_br_name(trunk_id)"},{"line_number":166,"context_line":"        return ovs_lib.BaseOVS().bridge_exists(bridge_name)"},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9a89bdaa_69630fdd","line":164,"range":{"start_line":164,"start_character":38,"end_line":164,"end_character":44},"in_reply_to":"9a89bdaa_3416c1a7","updated":"2016-09-06 07:31:46.000000000","message":"Done","commit_id":"78515b0aa8c3cae5b84ee030b75d8e4b3a03ee97"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"641d0edf2ad024cf963205b0cea216591ff8e5b5","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        LOG.debug(\"Deleted trunk: %s\", trunk_id)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def manages_this_trunk(self, trunk_id):"},{"line_number":164,"context_line":"        \"\"\"Ture if this OVSDB handler manges trunk based on given ID.\"\"\""},{"line_number":165,"context_line":"        bridge_name \u003d trunk_utils.gen_trunk_br_name(trunk_id)"},{"line_number":166,"context_line":"        return ovs_lib.BaseOVS().bridge_exists(bridge_name)"},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9a89bdaa_a99b57c8","line":164,"range":{"start_line":164,"start_character":11,"end_line":164,"end_character":15},"in_reply_to":"9a89bdaa_94406da7","updated":"2016-09-06 07:31:46.000000000","message":"Done","commit_id":"78515b0aa8c3cae5b84ee030b75d8e4b3a03ee97"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"72b527d4f4945521bc6999164e76b6dda5c1ff06","unresolved":false,"context_lines":[{"line_number":281,"context_line":"            ctx, trunk.id, trunk.sub_ports, trunk_bridge\u003dtrunk_br,"},{"line_number":282,"context_line":"            parent_port\u003dport)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"    def _set_trunk_metadata(self, trunk_br, port, trunk_id, subport_ids):"},{"line_number":285,"context_line":"        \"\"\"Set trunk metadata in OVS port for trunk parent port.\"\"\""},{"line_number":286,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":287,"context_line":"        # name, trunk id and subport ids so we can easily remove the trunk"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a89bdaa_a9c20e32","line":284,"updated":"2016-09-07 17:47:27.000000000","message":"why don\u0027t we store this metadata in the trunk bridge instead? the parent port is not managed by neutron...and it would help me with the resync to have the metadata in the trunk bridge, because the parent port gets destroyed by Nova when the VM is deleted.","commit_id":"78515b0aa8c3cae5b84ee030b75d8e4b3a03ee97"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"201db8fb10077c782f9769e2dd930de9cb2f1221","unresolved":false,"context_lines":[{"line_number":281,"context_line":"            ctx, trunk.id, trunk.sub_ports, trunk_bridge\u003dtrunk_br,"},{"line_number":282,"context_line":"            parent_port\u003dport)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"    def _set_trunk_metadata(self, trunk_br, port, trunk_id, subport_ids):"},{"line_number":285,"context_line":"        \"\"\"Set trunk metadata in OVS port for trunk parent port.\"\"\""},{"line_number":286,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":287,"context_line":"        # name, trunk id and subport ids so we can easily remove the trunk"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a89bdaa_6d69e9f8","line":284,"in_reply_to":"9a89bdaa_a7f5d2ed","updated":"2016-09-07 21:32:21.000000000","message":"If we don\u0027t store the metadata in the parent port, how else will we be able to remove the trunk bridge after detecting the removal of the parent port? To me it looks like at a minimum we have to set bridge_name in the parent port, then we could possibly get the other metadata from the trunk bridge by tracking it down from the parent port. Is that what you mean?","commit_id":"78515b0aa8c3cae5b84ee030b75d8e4b3a03ee97"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2ec628b22b519670873484475ab8e296e8f33292","unresolved":false,"context_lines":[{"line_number":281,"context_line":"            ctx, trunk.id, trunk.sub_ports, trunk_bridge\u003dtrunk_br,"},{"line_number":282,"context_line":"            parent_port\u003dport)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"    def _set_trunk_metadata(self, trunk_br, port, trunk_id, subport_ids):"},{"line_number":285,"context_line":"        \"\"\"Set trunk metadata in OVS port for trunk parent port.\"\"\""},{"line_number":286,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":287,"context_line":"        # name, trunk id and subport ids so we can easily remove the trunk"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a89bdaa_bcb40a35","line":284,"in_reply_to":"9a89bdaa_a9c20e32","updated":"2016-09-07 18:02:25.000000000","message":"but so would be the bridge.","commit_id":"78515b0aa8c3cae5b84ee030b75d8e4b3a03ee97"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6bdac234c931d420355be647529284f62788bbea","unresolved":false,"context_lines":[{"line_number":281,"context_line":"            ctx, trunk.id, trunk.sub_ports, trunk_bridge\u003dtrunk_br,"},{"line_number":282,"context_line":"            parent_port\u003dport)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"    def _set_trunk_metadata(self, trunk_br, port, trunk_id, subport_ids):"},{"line_number":285,"context_line":"        \"\"\"Set trunk metadata in OVS port for trunk parent port.\"\"\""},{"line_number":286,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":287,"context_line":"        # name, trunk id and subport ids so we can easily remove the trunk"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a89bdaa_a7f5d2ed","line":284,"in_reply_to":"9a89bdaa_bcb40a35","updated":"2016-09-07 20:33:04.000000000","message":"Bridge is deleted by us https://github.com/openstack/neutron/blob/master/neutron/services/trunk/drivers/openvswitch/agent/trunk_manager.py#L140","commit_id":"78515b0aa8c3cae5b84ee030b75d8e4b3a03ee97"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"e35c65812f5a0e9edd702cbbd6760382470f26bc","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        parent_port_id \u003d self.trunk_manager.get_port_uuid_from_external_ids("},{"line_number":155,"context_line":"            port)"},{"line_number":156,"context_line":"        trunk_id \u003d port[\u0027external_ids\u0027][\u0027trunk_id\u0027]"},{"line_number":157,"context_line":"        subport_ids \u003d port[\u0027external_ids\u0027][\u0027subport_ids\u0027]"},{"line_number":158,"context_line":"        self.unwire_subports_for_trunk(trunk_id, subport_ids)"},{"line_number":159,"context_line":"        self.trunk_manager.remove_trunk(trunk_id, parent_port_id)"},{"line_number":160,"context_line":"        LOG.debug(\"Deleted trunk: %s\", trunk_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_c8a4f5a7","line":157,"range":{"start_line":157,"start_character":8,"end_line":157,"end_character":57},"updated":"2016-09-06 15:52:39.000000000","message":"This will be a string \"[\u0027id1\u0027, \u0027id2\u0027]\", we need to call jsonutils.loads here. I\u0027ll check why our tests pass.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        # If this fails at the very beginning of the OVS trunk bridge"},{"line_number":172,"context_line":"        # lifecycle (trunk_bridge !\u003d None), then destroy the bridge"},{"line_number":173,"context_line":"        # and give up."},{"line_number":174,"context_line":"        if not trunk_bridge and not self.manages_this_trunk(trunk_id):"},{"line_number":175,"context_line":"            # Notification was not for this agent"},{"line_number":176,"context_line":"            return"},{"line_number":177,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_d964c5e6","line":174,"updated":"2016-09-06 16:59:33.000000000","message":"I suppose this is a codepath that would be hit when wire_subports_for_trunk is called by the skeleton. If that\u0027s correct, I\u0027d personally extract this out and leave it to the caller, as this method is already pretty busy!","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a3c086bdb0e82cb1331f8dc530677a36ee685fc0","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        # If this fails at the very beginning of the OVS trunk bridge"},{"line_number":172,"context_line":"        # lifecycle (trunk_bridge !\u003d None), then destroy the bridge"},{"line_number":173,"context_line":"        # and give up."},{"line_number":174,"context_line":"        if not trunk_bridge and not self.manages_this_trunk(trunk_id):"},{"line_number":175,"context_line":"            # Notification was not for this agent"},{"line_number":176,"context_line":"            return"},{"line_number":177,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_ee637cda","line":174,"in_reply_to":"9a89bdaa_d964c5e6","updated":"2016-09-06 19:29:28.000000000","message":"Done","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            return"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        try:"},{"line_number":179,"context_line":"            subport_bindings \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":180,"context_line":"                context, subports)"},{"line_number":181,"context_line":"        except oslo_messaging.MessagingException as e:"},{"line_number":182,"context_line":"            if trunk_bridge:"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_59d43546","line":179,"updated":"2016-09-06 16:59:33.000000000","message":"what if we have this error handling is done in the stub itself (e.g. catch oslo_messaging.MessagingException, log an error and reraise local exception)? \n\nWould it make make this method less crowded? I see this is repeating a lot.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a3c086bdb0e82cb1331f8dc530677a36ee685fc0","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            return"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        try:"},{"line_number":179,"context_line":"            subport_bindings \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":180,"context_line":"                context, subports)"},{"line_number":181,"context_line":"        except oslo_messaging.MessagingException as e:"},{"line_number":182,"context_line":"            if trunk_bridge:"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_0e8d007b","line":179,"in_reply_to":"9a89bdaa_59d43546","updated":"2016-09-06 19:29:28.000000000","message":"Done","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        except oslo_messaging.MessagingException as e:"},{"line_number":182,"context_line":"            if trunk_bridge:"},{"line_number":183,"context_line":"                trunk_bridge.destroy()"},{"line_number":184,"context_line":"            LOG.error(_LE(\"Got messaging error while updating port bindings \""},{"line_number":185,"context_line":"                          \"for following subports: %(subports)s: %(error)s\"),"},{"line_number":186,"context_line":"                      {\u0027subports\u0027: subports,"},{"line_number":187,"context_line":"                       \u0027error\u0027: str(e)})"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_590995dc","line":184,"updated":"2016-09-06 16:59:33.000000000","message":"worth swapping these lines for readability? Also, if for whatever reason trunk_bridge.destroy() fails we don\u0027t print the original trace.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                           \u0027trunk_id\u0027: trunk_id,"},{"line_number":205,"context_line":"                           \u0027err\u0027: str(e)})"},{"line_number":206,"context_line":"                try:"},{"line_number":207,"context_line":"                    self.trunk_rpc.update_trunk_status("},{"line_number":208,"context_line":"                        context, trunk_id, constants.DEGRADED_STATUS)"},{"line_number":209,"context_line":"                except oslo_messaging.MessagingException as m_e:"},{"line_number":210,"context_line":"                    LOG.error(_LE(\"Got messaging error while updating trunk \""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_19ee2dec","line":207,"updated":"2016-09-06 16:59:33.000000000","message":"my suggestion is to avoid doing this in a loop. If you have X of Y subports broken you\u0027d be updating the trunk X times when in reality you only need to do it once.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a3c086bdb0e82cb1331f8dc530677a36ee685fc0","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                           \u0027trunk_id\u0027: trunk_id,"},{"line_number":205,"context_line":"                           \u0027err\u0027: str(e)})"},{"line_number":206,"context_line":"                try:"},{"line_number":207,"context_line":"                    self.trunk_rpc.update_trunk_status("},{"line_number":208,"context_line":"                        context, trunk_id, constants.DEGRADED_STATUS)"},{"line_number":209,"context_line":"                except oslo_messaging.MessagingException as m_e:"},{"line_number":210,"context_line":"                    LOG.error(_LE(\"Got messaging error while updating trunk \""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_9124d1af","line":207,"in_reply_to":"9a89bdaa_19ee2dec","updated":"2016-09-06 19:29:28.000000000","message":"I won\u0027t, it returns on L214 after first failure.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1fe6c1563e2b9b7f2b8b92e17b9aaedff1680137","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                           \u0027trunk_id\u0027: trunk_id,"},{"line_number":205,"context_line":"                           \u0027err\u0027: str(e)})"},{"line_number":206,"context_line":"                try:"},{"line_number":207,"context_line":"                    self.trunk_rpc.update_trunk_status("},{"line_number":208,"context_line":"                        context, trunk_id, constants.DEGRADED_STATUS)"},{"line_number":209,"context_line":"                except oslo_messaging.MessagingException as m_e:"},{"line_number":210,"context_line":"                    LOG.error(_LE(\"Got messaging error while updating trunk \""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_fde32c31","line":207,"in_reply_to":"9a89bdaa_9124d1af","updated":"2016-09-06 19:56:58.000000000","message":"oh, I missed that, but this is not right, we should make sure other subports are processed irrespective of the accidental failure of a single subport, so that at least the trunk is partially functional. When a trunk is made of thousands of networks, an intermittent failure may be a way of life and it\u0027s better to allow the user to recover by removing/readding a single subport (the failed one/s) than the whole lot.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cfcfa8a7959b071fceb1f4418e45336cd09da91","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                           \u0027trunk_id\u0027: trunk_id,"},{"line_number":205,"context_line":"                           \u0027err\u0027: str(e)})"},{"line_number":206,"context_line":"                try:"},{"line_number":207,"context_line":"                    self.trunk_rpc.update_trunk_status("},{"line_number":208,"context_line":"                        context, trunk_id, constants.DEGRADED_STATUS)"},{"line_number":209,"context_line":"                except oslo_messaging.MessagingException as m_e:"},{"line_number":210,"context_line":"                    LOG.error(_LE(\"Got messaging error while updating trunk \""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_e5a7eeba","line":207,"in_reply_to":"9a89bdaa_fde32c31","updated":"2016-09-07 13:40:22.000000000","message":"Done","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                          \"trunk %(trunk_id)s: %(error)s\"),"},{"line_number":225,"context_line":"                      {\u0027trunk_id\u0027: trunk_id,"},{"line_number":226,"context_line":"                       \u0027error\u0027: str(e)})"},{"line_number":227,"context_line":"            return"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        trunk_bridge \u003d trunk_bridge or ovs_lib.OVSBridge("},{"line_number":230,"context_line":"            trunk_utils.gen_trunk_br_name(trunk_id))"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_39893127","line":227,"updated":"2016-09-06 16:59:33.000000000","message":"if we fail here, what do you we do? Do we rollback the physical trunk setup, what\u0027s the fail-safe condition?","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"cac2485373b2eb6e0c9cab6be38c19d1e4df61b0","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                          \"trunk %(trunk_id)s: %(error)s\"),"},{"line_number":225,"context_line":"                      {\u0027trunk_id\u0027: trunk_id,"},{"line_number":226,"context_line":"                       \u0027error\u0027: str(e)})"},{"line_number":227,"context_line":"            return"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        trunk_bridge \u003d trunk_bridge or ovs_lib.OVSBridge("},{"line_number":230,"context_line":"            trunk_utils.gen_trunk_br_name(trunk_id))"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_c36018d2","line":227,"in_reply_to":"9a89bdaa_006cc0ce","updated":"2016-09-07 15:39:35.000000000","message":"the ovs agent puts the device in the device_to_resync list and tries to re-wire it at next iteration. We could do something similar. Not in this patch though.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cfcfa8a7959b071fceb1f4418e45336cd09da91","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                          \"trunk %(trunk_id)s: %(error)s\"),"},{"line_number":225,"context_line":"                      {\u0027trunk_id\u0027: trunk_id,"},{"line_number":226,"context_line":"                       \u0027error\u0027: str(e)})"},{"line_number":227,"context_line":"            return"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        trunk_bridge \u003d trunk_bridge or ovs_lib.OVSBridge("},{"line_number":230,"context_line":"            trunk_utils.gen_trunk_br_name(trunk_id))"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_006cc0ce","line":227,"in_reply_to":"9a89bdaa_39893127","updated":"2016-09-07 13:40:22.000000000","message":"Should we keep current configuration as is to get the partial data plane working or rather rollback everything so we either succeed or fail? Generally, I\u0027d go with the former.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"72da64f897393903f47764b7a0aea98fbcce744b","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                          \"trunk %(trunk_id)s: %(error)s\"),"},{"line_number":225,"context_line":"                      {\u0027trunk_id\u0027: trunk_id,"},{"line_number":226,"context_line":"                       \u0027error\u0027: str(e)})"},{"line_number":227,"context_line":"            return"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        trunk_bridge \u003d trunk_bridge or ovs_lib.OVSBridge("},{"line_number":230,"context_line":"            trunk_utils.gen_trunk_br_name(trunk_id))"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_83d37003","line":227,"in_reply_to":"9a89bdaa_c36018d2","updated":"2016-09-07 15:44:16.000000000","message":"in the meanwhile I would lean toward avoiding the complete rollback","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"52335a2e55682698e920f44d21d209c49e8ab608","unresolved":false,"context_lines":[{"line_number":234,"context_line":"            trunk_bridge, parent_port, trunk_id, subport_ids)"},{"line_number":235,"context_line":"        LOG.debug(\"Added trunk: %s\", trunk_id)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def unwire_subports_for_trunk(self, trunk_id, subport_ids):"},{"line_number":238,"context_line":"        for subport_id in subport_ids:"},{"line_number":239,"context_line":"            self.trunk_manager.remove_sub_port(trunk_id, subport_id)"},{"line_number":240,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_14c5145a","line":237,"updated":"2016-09-06 17:09:03.000000000","message":"here you don\u0027t check for the trunk being managed by this host: ERROR!\n\nSee my related comment on 174.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cfcfa8a7959b071fceb1f4418e45336cd09da91","unresolved":false,"context_lines":[{"line_number":234,"context_line":"            trunk_bridge, parent_port, trunk_id, subport_ids)"},{"line_number":235,"context_line":"        LOG.debug(\"Added trunk: %s\", trunk_id)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def unwire_subports_for_trunk(self, trunk_id, subport_ids):"},{"line_number":238,"context_line":"        for subport_id in subport_ids:"},{"line_number":239,"context_line":"            self.trunk_manager.remove_sub_port(trunk_id, subport_id)"},{"line_number":240,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_a0b4f434","line":237,"in_reply_to":"9a89bdaa_14c5145a","updated":"2016-09-07 13:40:22.000000000","message":"Will be done in the other patch.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def unwire_subports_for_trunk(self, trunk_id, subport_ids):"},{"line_number":238,"context_line":"        for subport_id in subport_ids:"},{"line_number":239,"context_line":"            self.trunk_manager.remove_sub_port(trunk_id, subport_id)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def _get_parent_port(self, trunk_bridge):"},{"line_number":242,"context_line":"        \"\"\"Return the OVS trunk parent port plugged on trunk_bridge.\"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_f9aee983","line":239,"updated":"2016-09-06 16:59:33.000000000","message":"no error handling?","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cfcfa8a7959b071fceb1f4418e45336cd09da91","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def unwire_subports_for_trunk(self, trunk_id, subport_ids):"},{"line_number":238,"context_line":"        for subport_id in subport_ids:"},{"line_number":239,"context_line":"            self.trunk_manager.remove_sub_port(trunk_id, subport_id)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def _get_parent_port(self, trunk_bridge):"},{"line_number":242,"context_line":"        \"\"\"Return the OVS trunk parent port plugged on trunk_bridge.\"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_a05dd416","line":239,"in_reply_to":"9a89bdaa_f9aee983","updated":"2016-09-07 13:40:22.000000000","message":"Done","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"bdfa911961a9511ef3eb98e104dd1f21439beb6c","unresolved":false,"context_lines":[{"line_number":262,"context_line":"        try:"},{"line_number":263,"context_line":"            trunk \u003d self.trunk_rpc.get_trunk_details("},{"line_number":264,"context_line":"                ctx, parent_port_id)"},{"line_number":265,"context_line":"        except oslo_messaging.MessagingException as e:"},{"line_number":266,"context_line":"            LOG.error(_LE(\"Got messaging error while obtaining details for \""},{"line_number":267,"context_line":"                          \"trunk with parent port ID %(port_id)s: %(error)s\"),"},{"line_number":268,"context_line":"                      {\u0027port_id\u0027: parent_port_id,"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_d87f51a9","line":265,"updated":"2016-09-06 23:10:12.000000000","message":"btw this raises also ResourceNotFound: it might be worth catching it here too.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cfcfa8a7959b071fceb1f4418e45336cd09da91","unresolved":false,"context_lines":[{"line_number":262,"context_line":"        try:"},{"line_number":263,"context_line":"            trunk \u003d self.trunk_rpc.get_trunk_details("},{"line_number":264,"context_line":"                ctx, parent_port_id)"},{"line_number":265,"context_line":"        except oslo_messaging.MessagingException as e:"},{"line_number":266,"context_line":"            LOG.error(_LE(\"Got messaging error while obtaining details for \""},{"line_number":267,"context_line":"                          \"trunk with parent port ID %(port_id)s: %(error)s\"),"},{"line_number":268,"context_line":"                      {\u0027port_id\u0027: parent_port_id,"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_a02a348e","line":265,"in_reply_to":"9a89bdaa_d87f51a9","updated":"2016-09-07 13:40:22.000000000","message":"Done","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                      parent_port_id)"},{"line_number":275,"context_line":"            return"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        self.trunk_manager.create_trunk("},{"line_number":278,"context_line":"            trunk.id, trunk.port_id, port[\u0027external_ids\u0027].get(\u0027attached-mac\u0027))"},{"line_number":279,"context_line":"        self.wire_subports_for_trunk("},{"line_number":280,"context_line":"            ctx, trunk.id, trunk.sub_ports, trunk_bridge\u003dtrunk_br,"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_79e819b5","line":277,"updated":"2016-09-06 16:59:33.000000000","message":"what if this fails?","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cfcfa8a7959b071fceb1f4418e45336cd09da91","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                      parent_port_id)"},{"line_number":275,"context_line":"            return"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        self.trunk_manager.create_trunk("},{"line_number":278,"context_line":"            trunk.id, trunk.port_id, port[\u0027external_ids\u0027].get(\u0027attached-mac\u0027))"},{"line_number":279,"context_line":"        self.wire_subports_for_trunk("},{"line_number":280,"context_line":"            ctx, trunk.id, trunk.sub_ports, trunk_bridge\u003dtrunk_br,"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_00f12001","line":277,"in_reply_to":"9a89bdaa_79e819b5","updated":"2016-09-07 13:40:22.000000000","message":"Done","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"6e5fb8793832ccf5938e17c95cca5fce1b071835","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        self._context.request_id \u003d context.generate_request_id()"},{"line_number":92,"context_line":"        return self._context"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def process_trunk_ports(self, resource, event, trigger, ovsdb_events):"},{"line_number":95,"context_line":"        \"\"\"Process added and removed ports coming from OVSDB monitor.\"\"\""},{"line_number":96,"context_line":"        for port_event in ovsdb_events[\u0027added\u0027]:"},{"line_number":97,"context_line":"            port_name \u003d port_event[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_f5e305d7","line":94,"range":{"start_line":94,"start_character":8,"end_line":94,"end_character":27},"updated":"2016-09-07 21:32:42.000000000","message":"nit: I would rename this to \"process_trunk_port_events\" to make it more descriptive.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        self._context.request_id \u003d context.generate_request_id()"},{"line_number":92,"context_line":"        return self._context"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def process_trunk_ports(self, resource, event, trigger, ovsdb_events):"},{"line_number":95,"context_line":"        \"\"\"Process added and removed ports coming from OVSDB monitor.\"\"\""},{"line_number":96,"context_line":"        for port_event in ovsdb_events[\u0027added\u0027]:"},{"line_number":97,"context_line":"            port_name \u003d port_event[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_821c136b","line":94,"range":{"start_line":94,"start_character":8,"end_line":94,"end_character":27},"in_reply_to":"9a89bdaa_f5e305d7","updated":"2016-09-08 14:16:27.000000000","message":"Done","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        :param bridge_name: Name of trunk bridge."},{"line_number":160,"context_line":"        :param port: Parent port dict."},{"line_number":161,"context_line":"        \"\"\""},{"line_number":162,"context_line":"        parent_port_id \u003d self.trunk_manager.get_port_uuid_from_external_ids("},{"line_number":163,"context_line":"            port)"},{"line_number":164,"context_line":"        trunk_id \u003d port[\u0027external_ids\u0027][\u0027trunk_id\u0027]"},{"line_number":165,"context_line":"        subport_ids \u003d jsonutils.loads(port[\u0027external_ids\u0027][\u0027subport_ids\u0027])"},{"line_number":166,"context_line":"        self.unwire_subports_for_trunk(trunk_id, subport_ids)"},{"line_number":167,"context_line":"        try:"},{"line_number":168,"context_line":"            self.trunk_manager.remove_trunk(trunk_id, parent_port_id)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_1ab25606","line":165,"range":{"start_line":162,"start_character":0,"end_line":165,"end_character":74},"updated":"2016-09-07 18:55:51.000000000","message":"perhaps this can be wrapped into a new method called _get_metadata() to address the comment down below.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        :param bridge_name: Name of trunk bridge."},{"line_number":160,"context_line":"        :param port: Parent port dict."},{"line_number":161,"context_line":"        \"\"\""},{"line_number":162,"context_line":"        parent_port_id \u003d self.trunk_manager.get_port_uuid_from_external_ids("},{"line_number":163,"context_line":"            port)"},{"line_number":164,"context_line":"        trunk_id \u003d port[\u0027external_ids\u0027][\u0027trunk_id\u0027]"},{"line_number":165,"context_line":"        subport_ids \u003d jsonutils.loads(port[\u0027external_ids\u0027][\u0027subport_ids\u0027])"},{"line_number":166,"context_line":"        self.unwire_subports_for_trunk(trunk_id, subport_ids)"},{"line_number":167,"context_line":"        try:"},{"line_number":168,"context_line":"            self.trunk_manager.remove_trunk(trunk_id, parent_port_id)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_0225635a","line":165,"range":{"start_line":162,"start_character":0,"end_line":165,"end_character":74},"in_reply_to":"9a89bdaa_1ab25606","updated":"2016-09-08 14:16:27.000000000","message":"Done","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":170,"context_line":"            LOG.error(_LE(\"Removing trunk %(trunk_id)s failed: %(err)s\"),"},{"line_number":171,"context_line":"                      {\u0027trunk_id\u0027: trunk_id,"},{"line_number":172,"context_line":"                       \u0027err\u0027: str(te)})"},{"line_number":173,"context_line":"        else:"},{"line_number":174,"context_line":"            LOG.debug(\"Deleted trunk: %s\", trunk_id)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def manages_this_trunk(self, trunk_id):"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_7f943442","line":173,"updated":"2016-09-07 18:55:51.000000000","message":"we forgot to put the trunk to DOWN state.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":170,"context_line":"            LOG.error(_LE(\"Removing trunk %(trunk_id)s failed: %(err)s\"),"},{"line_number":171,"context_line":"                      {\u0027trunk_id\u0027: trunk_id,"},{"line_number":172,"context_line":"                       \u0027err\u0027: str(te)})"},{"line_number":173,"context_line":"        else:"},{"line_number":174,"context_line":"            LOG.debug(\"Deleted trunk: %s\", trunk_id)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def manages_this_trunk(self, trunk_id):"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_e2f31f71","line":173,"in_reply_to":"9a89bdaa_7f943442","updated":"2016-09-08 14:16:27.000000000","message":"Done","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"76710714d68753a9c7c66bfdb5eda01b42aac2d1","unresolved":false,"context_lines":[{"line_number":170,"context_line":"            LOG.error(_LE(\"Removing trunk %(trunk_id)s failed: %(err)s\"),"},{"line_number":171,"context_line":"                      {\u0027trunk_id\u0027: trunk_id,"},{"line_number":172,"context_line":"                       \u0027err\u0027: str(te)})"},{"line_number":173,"context_line":"        else:"},{"line_number":174,"context_line":"            LOG.debug(\"Deleted trunk: %s\", trunk_id)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def manages_this_trunk(self, trunk_id):"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_591ca313","line":173,"in_reply_to":"9a89bdaa_e2f31f71","updated":"2016-09-08 22:22:20.000000000","message":"argh: I gave you a bad tip. This is done server-side.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":171,"context_line":"                      {\u0027trunk_id\u0027: trunk_id,"},{"line_number":172,"context_line":"                       \u0027err\u0027: str(te)})"},{"line_number":173,"context_line":"        else:"},{"line_number":174,"context_line":"            LOG.debug(\"Deleted trunk: %s\", trunk_id)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def manages_this_trunk(self, trunk_id):"},{"line_number":177,"context_line":"        \"\"\"True if this OVSDB handler manages trunk based on given ID.\"\"\""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_1fb24806","line":174,"updated":"2016-09-07 18:55:51.000000000","message":"I\u0027d say \u0027Deleted resources associated to trunk: %s\u0027","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":171,"context_line":"                      {\u0027trunk_id\u0027: trunk_id,"},{"line_number":172,"context_line":"                       \u0027err\u0027: str(te)})"},{"line_number":173,"context_line":"        else:"},{"line_number":174,"context_line":"            LOG.debug(\"Deleted trunk: %s\", trunk_id)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def manages_this_trunk(self, trunk_id):"},{"line_number":177,"context_line":"        \"\"\"True if this OVSDB handler manages trunk based on given ID.\"\"\""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_82c7b362","line":174,"in_reply_to":"9a89bdaa_1fb24806","updated":"2016-09-08 14:16:27.000000000","message":"Done","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def wire_subports_for_trunk(self, context, trunk_id, subports,"},{"line_number":182,"context_line":"                                trunk_bridge\u003dNone, parent_port\u003dNone):"},{"line_number":183,"context_line":"        \"\"\"Create OVS ports associated to the logical subports.\"\"\""},{"line_number":184,"context_line":"        # Tell the server that subports must be bound to this host."},{"line_number":185,"context_line":"        # If this fails at the very beginning of the OVS trunk bridge"},{"line_number":186,"context_line":"        # lifecycle (trunk_bridge !\u003d None), then destroy the bridge"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_ff31245b","line":183,"updated":"2016-09-07 18:55:51.000000000","message":"worth consider chunking this up further if you can, as this is already pretty beefy, and I can only imagine this grow. Either way, I am happy for us to make a mental note and not do this now.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        # If this fails at the very beginning of the OVS trunk bridge"},{"line_number":186,"context_line":"        # lifecycle (trunk_bridge !\u003d None), then destroy the bridge"},{"line_number":187,"context_line":"        # and give up."},{"line_number":188,"context_line":"        subport_bindings \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":189,"context_line":"            context, subports)"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        # Bindings were successful: create the OVS subports."}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_da4e2e6e","line":188,"updated":"2016-09-07 18:55:51.000000000","message":"how come this is no longer protected in a try-except? Did I miss your DONE?","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        # If this fails at the very beginning of the OVS trunk bridge"},{"line_number":186,"context_line":"        # lifecycle (trunk_bridge !\u003d None), then destroy the bridge"},{"line_number":187,"context_line":"        # and give up."},{"line_number":188,"context_line":"        subport_bindings \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":189,"context_line":"            context, subports)"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        # Bindings were successful: create the OVS subports."}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_ba8ecacd","line":188,"in_reply_to":"9a89bdaa_da4e2e6e","updated":"2016-09-08 14:16:27.000000000","message":"It is on L144","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"6e5fb8793832ccf5938e17c95cca5fce1b071835","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                                                subports_mac[subport.port_id],"},{"line_number":199,"context_line":"                                                subport.segmentation_id)"},{"line_number":200,"context_line":"            except tman.TrunkManagerError as te:"},{"line_number":201,"context_line":"                LOG.error(_LE(\"Failed to add subport with parent port ID \""},{"line_number":202,"context_line":"                              \"%(subport_parent_id)s to trunk with ID \""},{"line_number":203,"context_line":"                              \"%(trunk_id)s: %(err)s\"),"},{"line_number":204,"context_line":"                          {\u0027subport_parent_id\u0027: subport.port_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_1024f75d","line":201,"range":{"start_line":201,"start_character":58,"end_line":201,"end_character":72},"updated":"2016-09-07 21:32:42.000000000","message":"I think this should be \"child port ID\" because it references a subport rather than a trunk port, but I think this current message matches some of the other error messages we already have related to subports. Maybe we should just omit \"parent\".","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                                                subports_mac[subport.port_id],"},{"line_number":199,"context_line":"                                                subport.segmentation_id)"},{"line_number":200,"context_line":"            except tman.TrunkManagerError as te:"},{"line_number":201,"context_line":"                LOG.error(_LE(\"Failed to add subport with parent port ID \""},{"line_number":202,"context_line":"                              \"%(subport_parent_id)s to trunk with ID \""},{"line_number":203,"context_line":"                              \"%(trunk_id)s: %(err)s\"),"},{"line_number":204,"context_line":"                          {\u0027subport_parent_id\u0027: subport.port_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_02b5637c","line":201,"range":{"start_line":201,"start_character":58,"end_line":201,"end_character":72},"in_reply_to":"9a89bdaa_1024f75d","updated":"2016-09-08 14:16:27.000000000","message":"Done","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"6e5fb8793832ccf5938e17c95cca5fce1b071835","unresolved":false,"context_lines":[{"line_number":215,"context_line":"                    context, trunk_id, constants.DEGRADED_STATUS)"},{"line_number":216,"context_line":"            except oslo_messaging.MessagingException as me:"},{"line_number":217,"context_line":"                LOG.error(_LE(\"Got messaging error when updating trunk \""},{"line_number":218,"context_line":"                              \"%(trunk_id)s to status DEGRADED: %(err)s\"),"},{"line_number":219,"context_line":"                          {\u0027trunk_id\u0027: trunk_id,"},{"line_number":220,"context_line":"                           \u0027err\u0027: str(me)})"},{"line_number":221,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_70cd4384","line":218,"range":{"start_line":218,"start_character":54,"end_line":218,"end_character":62},"updated":"2016-09-07 21:32:42.000000000","message":"I don\u0027t expect this constant to change anytime soon, but maybe this error message should be passed constants.DEGRADED_STATUS rather than hardcoding it in the message.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":215,"context_line":"                    context, trunk_id, constants.DEGRADED_STATUS)"},{"line_number":216,"context_line":"            except oslo_messaging.MessagingException as me:"},{"line_number":217,"context_line":"                LOG.error(_LE(\"Got messaging error when updating trunk \""},{"line_number":218,"context_line":"                              \"%(trunk_id)s to status DEGRADED: %(err)s\"),"},{"line_number":219,"context_line":"                          {\u0027trunk_id\u0027: trunk_id,"},{"line_number":220,"context_line":"                           \u0027err\u0027: str(me)})"},{"line_number":221,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_427a0bbe","line":218,"range":{"start_line":218,"start_character":54,"end_line":218,"end_character":62},"in_reply_to":"9a89bdaa_70cd4384","updated":"2016-09-08 14:16:27.000000000","message":"Done","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                          {\u0027trunk_id\u0027: trunk_id,"},{"line_number":220,"context_line":"                           \u0027err\u0027: str(me)})"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        trunk_bridge \u003d trunk_bridge or ovs_lib.OVSBridge("},{"line_number":223,"context_line":"            trunk_utils.gen_trunk_br_name(trunk_id))"},{"line_number":224,"context_line":"        parent_port \u003d parent_port or self._get_parent_port(trunk_bridge)"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        self._set_trunk_metadata("},{"line_number":227,"context_line":"            trunk_bridge, parent_port, trunk_id, subport_ids)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        # Update the trunk status, store trunk metadata and cheer!"},{"line_number":230,"context_line":"        self.trunk_rpc.update_trunk_status(context, trunk_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_7f6c3435","line":227,"range":{"start_line":222,"start_character":0,"end_line":227,"end_character":61},"updated":"2016-09-07 18:55:51.000000000","message":"perhaps this can move before 210 and then we can have an if-else where we choose the state DEGRADED vs ACTIVE and have one call to update_trunk_status.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                          {\u0027trunk_id\u0027: trunk_id,"},{"line_number":220,"context_line":"                           \u0027err\u0027: str(me)})"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        trunk_bridge \u003d trunk_bridge or ovs_lib.OVSBridge("},{"line_number":223,"context_line":"            trunk_utils.gen_trunk_br_name(trunk_id))"},{"line_number":224,"context_line":"        parent_port \u003d parent_port or self._get_parent_port(trunk_bridge)"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        self._set_trunk_metadata("},{"line_number":227,"context_line":"            trunk_bridge, parent_port, trunk_id, subport_ids)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        # Update the trunk status, store trunk metadata and cheer!"},{"line_number":230,"context_line":"        self.trunk_rpc.update_trunk_status(context, trunk_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_c5d2a55b","line":227,"range":{"start_line":222,"start_character":0,"end_line":227,"end_character":61},"in_reply_to":"9a89bdaa_014ae625","updated":"2016-09-08 14:16:27.000000000","message":"Done","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"7c254b2931ef672f896df951972cb66d5b71b6a2","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                          {\u0027trunk_id\u0027: trunk_id,"},{"line_number":220,"context_line":"                           \u0027err\u0027: str(me)})"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        trunk_bridge \u003d trunk_bridge or ovs_lib.OVSBridge("},{"line_number":223,"context_line":"            trunk_utils.gen_trunk_br_name(trunk_id))"},{"line_number":224,"context_line":"        parent_port \u003d parent_port or self._get_parent_port(trunk_bridge)"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        self._set_trunk_metadata("},{"line_number":227,"context_line":"            trunk_bridge, parent_port, trunk_id, subport_ids)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        # Update the trunk status, store trunk metadata and cheer!"},{"line_number":230,"context_line":"        self.trunk_rpc.update_trunk_status(context, trunk_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_014ae625","line":227,"range":{"start_line":222,"start_character":0,"end_line":227,"end_character":61},"in_reply_to":"9a89bdaa_7f6c3435","updated":"2016-09-08 07:05:25.000000000","message":"+1","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"8cd1d2b617f10fe533d13ee2aefe16ad32bb7371","unresolved":false,"context_lines":[{"line_number":227,"context_line":"            trunk_bridge, parent_port, trunk_id, subport_ids)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        # Update the trunk status, store trunk metadata and cheer!"},{"line_number":230,"context_line":"        self.trunk_rpc.update_trunk_status(context, trunk_id,"},{"line_number":231,"context_line":"                                           constants.ACTIVE_STATUS)"},{"line_number":232,"context_line":"        LOG.debug(\"Added trunk: %s\", trunk_id)"},{"line_number":233,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_52704cdc","line":230,"updated":"2016-09-07 17:15:04.000000000","message":"What if we ended up in a DEGRADED state (L214)? It looks like we would end up overwriting that DEGRADED status with ACTIVE, masking the fact that there was a problem with one or more subports. We should either return after setting degraded status or add a conditional around setting the trunk status to ACTIVE.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":227,"context_line":"            trunk_bridge, parent_port, trunk_id, subport_ids)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        # Update the trunk status, store trunk metadata and cheer!"},{"line_number":230,"context_line":"        self.trunk_rpc.update_trunk_status(context, trunk_id,"},{"line_number":231,"context_line":"                                           constants.ACTIVE_STATUS)"},{"line_number":232,"context_line":"        LOG.debug(\"Added trunk: %s\", trunk_id)"},{"line_number":233,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_85541dca","line":230,"in_reply_to":"9a89bdaa_52704cdc","updated":"2016-09-08 14:16:27.000000000","message":"Done","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f791eab563cfbc24e3358114534739c652491b55","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        self._set_trunk_metadata("},{"line_number":227,"context_line":"            trunk_bridge, parent_port, trunk_id, subport_ids)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        # Update the trunk status, store trunk metadata and cheer!"},{"line_number":230,"context_line":"        self.trunk_rpc.update_trunk_status(context, trunk_id,"},{"line_number":231,"context_line":"                                           constants.ACTIVE_STATUS)"},{"line_number":232,"context_line":"        LOG.debug(\"Added trunk: %s\", trunk_id)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def unwire_subports_for_trunk(self, trunk_id, subport_ids):"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_039760ec","line":231,"range":{"start_line":229,"start_character":0,"end_line":231,"end_character":67},"updated":"2016-09-07 15:46:47.000000000","message":"This should go to L286","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"af705780bbf673cbb5905e200cec2f774fd4ba88","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        self._set_trunk_metadata("},{"line_number":227,"context_line":"            trunk_bridge, parent_port, trunk_id, subport_ids)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        # Update the trunk status, store trunk metadata and cheer!"},{"line_number":230,"context_line":"        self.trunk_rpc.update_trunk_status(context, trunk_id,"},{"line_number":231,"context_line":"                                           constants.ACTIVE_STATUS)"},{"line_number":232,"context_line":"        LOG.debug(\"Added trunk: %s\", trunk_id)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def unwire_subports_for_trunk(self, trunk_id, subport_ids):"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_6cdf3969","line":231,"range":{"start_line":229,"start_character":0,"end_line":231,"end_character":67},"in_reply_to":"9a89bdaa_039760ec","updated":"2016-09-07 16:19:48.000000000","message":"It should not, you\u0027re talking nonsense.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":229,"context_line":"        # Update the trunk status, store trunk metadata and cheer!"},{"line_number":230,"context_line":"        self.trunk_rpc.update_trunk_status(context, trunk_id,"},{"line_number":231,"context_line":"                                           constants.ACTIVE_STATUS)"},{"line_number":232,"context_line":"        LOG.debug(\"Added trunk: %s\", trunk_id)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def unwire_subports_for_trunk(self, trunk_id, subport_ids):"},{"line_number":235,"context_line":"        for subport_id in subport_ids:"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_7ac36289","line":232,"updated":"2016-09-07 18:55:51.000000000","message":"btw, consider adding a preamble: #NOTE(status_police): before making changes to trunk state so they are easier to grep if need be.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":229,"context_line":"        # Update the trunk status, store trunk metadata and cheer!"},{"line_number":230,"context_line":"        self.trunk_rpc.update_trunk_status(context, trunk_id,"},{"line_number":231,"context_line":"                                           constants.ACTIVE_STATUS)"},{"line_number":232,"context_line":"        LOG.debug(\"Added trunk: %s\", trunk_id)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def unwire_subports_for_trunk(self, trunk_id, subport_ids):"},{"line_number":235,"context_line":"        for subport_id in subport_ids:"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_e517a9a0","line":232,"in_reply_to":"9a89bdaa_7ac36289","updated":"2016-09-08 14:16:27.000000000","message":"Done","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":231,"context_line":"                                           constants.ACTIVE_STATUS)"},{"line_number":232,"context_line":"        LOG.debug(\"Added trunk: %s\", trunk_id)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def unwire_subports_for_trunk(self, trunk_id, subport_ids):"},{"line_number":235,"context_line":"        for subport_id in subport_ids:"},{"line_number":236,"context_line":"            try:"},{"line_number":237,"context_line":"                self.trunk_manager.remove_sub_port(trunk_id, subport_id)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_9f2d78aa","line":234,"updated":"2016-09-07 18:55:51.000000000","message":"docstring would be nice: \n\n\"\"Destroy OVS ports associated to the logical subports.\"\"\"","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":231,"context_line":"                                           constants.ACTIVE_STATUS)"},{"line_number":232,"context_line":"        LOG.debug(\"Added trunk: %s\", trunk_id)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def unwire_subports_for_trunk(self, trunk_id, subport_ids):"},{"line_number":235,"context_line":"        for subport_id in subport_ids:"},{"line_number":236,"context_line":"            try:"},{"line_number":237,"context_line":"                self.trunk_manager.remove_sub_port(trunk_id, subport_id)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_a51a01c4","line":234,"in_reply_to":"9a89bdaa_9f2d78aa","updated":"2016-09-08 14:16:27.000000000","message":"Done","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":240,"context_line":"                              \"%(trunk_id)s failed: %(err)s\"),"},{"line_number":241,"context_line":"                          {\u0027subport_id\u0027: subport_id,"},{"line_number":242,"context_line":"                           \u0027trunk_id\u0027: trunk_id,"},{"line_number":243,"context_line":"                           \u0027err\u0027: str(te)})"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"    def _get_parent_port(self, trunk_bridge):"},{"line_number":246,"context_line":"        \"\"\"Return the OVS trunk parent port plugged on trunk_bridge.\"\"\""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_3f3e2cda","line":243,"updated":"2016-09-07 18:55:51.000000000","message":"nit: we could simply use te rather than str(te) everywhere","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":240,"context_line":"                              \"%(trunk_id)s failed: %(err)s\"),"},{"line_number":241,"context_line":"                          {\u0027subport_id\u0027: subport_id,"},{"line_number":242,"context_line":"                           \u0027trunk_id\u0027: trunk_id,"},{"line_number":243,"context_line":"                           \u0027err\u0027: str(te)})"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"    def _get_parent_port(self, trunk_bridge):"},{"line_number":246,"context_line":"        \"\"\"Return the OVS trunk parent port plugged on trunk_bridge.\"\"\""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_e57ec9e2","line":243,"in_reply_to":"9a89bdaa_3f3e2cda","updated":"2016-09-08 14:16:27.000000000","message":"Done","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"6e5fb8793832ccf5938e17c95cca5fce1b071835","unresolved":false,"context_lines":[{"line_number":251,"context_line":"            if not is_trunk_service_port(trunk_br_port[\u0027name\u0027]):"},{"line_number":252,"context_line":"                return trunk_br_port"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    def _process_trunk(self, trunk_br, port):"},{"line_number":255,"context_line":"        \"\"\"Wire trunk bridge with integration bridge."},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        The method calls into trunk manager to create patch ports for trunk and"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_757b7528","line":254,"range":{"start_line":254,"start_character":9,"end_line":254,"end_character":22},"updated":"2016-09-07 21:32:42.000000000","message":"nit: similar to the theme of more descriptive method names, I would rename this \"wire_trunk\" because \"process\" is a very broad term.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":251,"context_line":"            if not is_trunk_service_port(trunk_br_port[\u0027name\u0027]):"},{"line_number":252,"context_line":"                return trunk_br_port"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    def _process_trunk(self, trunk_br, port):"},{"line_number":255,"context_line":"        \"\"\"Wire trunk bridge with integration bridge."},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        The method calls into trunk manager to create patch ports for trunk and"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_0559ed8d","line":254,"range":{"start_line":254,"start_character":9,"end_line":254,"end_character":22},"in_reply_to":"9a89bdaa_757b7528","updated":"2016-09-08 14:16:27.000000000","message":"Done","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":265,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"        try:"},{"line_number":268,"context_line":"            trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":269,"context_line":"        except resources_rpc.ResourceNotFound:"},{"line_number":270,"context_line":"            LOG.error(_LE(\"Port %s has no trunk associated.\"), parent_port_id)"},{"line_number":271,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_1a6c16cf","line":268,"updated":"2016-09-07 18:55:51.000000000","message":"what about other messaging exceptions? What did I miss?","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":265,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"        try:"},{"line_number":268,"context_line":"            trunk \u003d self.trunk_rpc.get_trunk_details(ctx, parent_port_id)"},{"line_number":269,"context_line":"        except resources_rpc.ResourceNotFound:"},{"line_number":270,"context_line":"            LOG.error(_LE(\"Port %s has no trunk associated.\"), parent_port_id)"},{"line_number":271,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_25d351d6","line":268,"in_reply_to":"9a89bdaa_1a6c16cf","updated":"2016-09-08 14:16:27.000000000","message":"As they were doing only logging and then return, I moved them to caller: L144","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":277,"context_line":"        except tman.TrunkManagerError as te:"},{"line_number":278,"context_line":"            LOG.error(_LE(\"Failed to create trunk %(trunk_id)s: %(err)s\"),"},{"line_number":279,"context_line":"                      {\u0027trunk_id\u0027: trunk.id,"},{"line_number":280,"context_line":"                       \u0027err\u0027: str(te)})"},{"line_number":281,"context_line":"            return"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        self.wire_subports_for_trunk("}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_5adf7e68","line":280,"updated":"2016-09-07 18:55:51.000000000","message":"what did we decide? That we should not mark the trunk in ERROR state if this happens?","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"7c254b2931ef672f896df951972cb66d5b71b6a2","unresolved":false,"context_lines":[{"line_number":277,"context_line":"        except tman.TrunkManagerError as te:"},{"line_number":278,"context_line":"            LOG.error(_LE(\"Failed to create trunk %(trunk_id)s: %(err)s\"),"},{"line_number":279,"context_line":"                      {\u0027trunk_id\u0027: trunk.id,"},{"line_number":280,"context_line":"                       \u0027err\u0027: str(te)})"},{"line_number":281,"context_line":"            return"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        self.wire_subports_for_trunk("}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_9c6bafb6","line":280,"in_reply_to":"9a89bdaa_5adf7e68","updated":"2016-09-08 07:05:25.000000000","message":"Seems like ERROR is the proper state.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":277,"context_line":"        except tman.TrunkManagerError as te:"},{"line_number":278,"context_line":"            LOG.error(_LE(\"Failed to create trunk %(trunk_id)s: %(err)s\"),"},{"line_number":279,"context_line":"                      {\u0027trunk_id\u0027: trunk.id,"},{"line_number":280,"context_line":"                       \u0027err\u0027: str(te)})"},{"line_number":281,"context_line":"            return"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        self.wire_subports_for_trunk("}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_658719b5","line":280,"in_reply_to":"9a89bdaa_9c6bafb6","updated":"2016-09-08 14:16:27.000000000","message":"ERROR it is","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"39d17413591673ad4f1abe7c4a116b1bec50c83d","unresolved":false,"context_lines":[{"line_number":284,"context_line":"            ctx, trunk.id, trunk.sub_ports, trunk_bridge\u003dtrunk_br,"},{"line_number":285,"context_line":"            parent_port\u003dport)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def _set_trunk_metadata(self, trunk_br, port, trunk_id, subport_ids):"},{"line_number":288,"context_line":"        \"\"\"Set trunk metadata in OVS port for trunk parent port.\"\"\""},{"line_number":289,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":290,"context_line":"        # name, trunk id and subport ids so we can easily remove the trunk"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_495d0278","line":287,"updated":"2016-09-07 17:50:32.000000000","message":"I commented on PS14, my point was to store the metadata in the trunk bridge instead.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":284,"context_line":"            ctx, trunk.id, trunk.sub_ports, trunk_bridge\u003dtrunk_br,"},{"line_number":285,"context_line":"            parent_port\u003dport)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def _set_trunk_metadata(self, trunk_br, port, trunk_id, subport_ids):"},{"line_number":288,"context_line":"        \"\"\"Set trunk metadata in OVS port for trunk parent port.\"\"\""},{"line_number":289,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":290,"context_line":"        # name, trunk id and subport ids so we can easily remove the trunk"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_ffcda431","line":287,"in_reply_to":"9a89bdaa_495d0278","updated":"2016-09-07 18:55:51.000000000","message":"I am ambivalent, but I think that in circumstances where you have the bridge then you have the parent port and vice versa, no?","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":284,"context_line":"            ctx, trunk.id, trunk.sub_ports, trunk_bridge\u003dtrunk_br,"},{"line_number":285,"context_line":"            parent_port\u003dport)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def _set_trunk_metadata(self, trunk_br, port, trunk_id, subport_ids):"},{"line_number":288,"context_line":"        \"\"\"Set trunk metadata in OVS port for trunk parent port.\"\"\""},{"line_number":289,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":290,"context_line":"        # name, trunk id and subport ids so we can easily remove the trunk"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_458cd5d9","line":287,"in_reply_to":"9a89bdaa_bc7a3322","updated":"2016-09-08 14:16:27.000000000","message":"I think the question is whether we can just use trunk bridge port name. I\u0027ll try that out.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"7c254b2931ef672f896df951972cb66d5b71b6a2","unresolved":false,"context_lines":[{"line_number":284,"context_line":"            ctx, trunk.id, trunk.sub_ports, trunk_bridge\u003dtrunk_br,"},{"line_number":285,"context_line":"            parent_port\u003dport)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def _set_trunk_metadata(self, trunk_br, port, trunk_id, subport_ids):"},{"line_number":288,"context_line":"        \"\"\"Set trunk metadata in OVS port for trunk parent port.\"\"\""},{"line_number":289,"context_line":"        # update the parent port external_ids to store the trunk bridge"},{"line_number":290,"context_line":"        # name, trunk id and subport ids so we can easily remove the trunk"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_bc7a3322","line":287,"in_reply_to":"9a89bdaa_ffcda431","updated":"2016-09-08 07:05:25.000000000","message":"What if the VM is removed while the agent is offline? We would need to clean up  and I can see how having the trunk_id would help when cleaning it up. Does it hurt to keep some metadata on both the parent port and the trunk bridge?","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                                      port[\u0027name\u0027],"},{"line_number":298,"context_line":"                                      \u0027external_ids\u0027,"},{"line_number":299,"context_line":"                                      port[\u0027external_ids\u0027])"},{"line_number":300,"context_line":"        except RuntimeError as re:"},{"line_number":301,"context_line":"            LOG.error(_LE(\"Setting external IDs for trunk bridge %(port_name)s\""},{"line_number":302,"context_line":"                          \" failed: %(err)s\"),"},{"line_number":303,"context_line":"                      {\u0027port_name\u0027: port[\u0027name\u0027],"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_bac32a56","line":300,"updated":"2016-09-07 18:55:51.000000000","message":"so if this fails for whatever reason, we\u0027re unable to complete actions at line 162. But this can still be recovered by making the agent go back to the server?","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cf8533bbda7de0fa607a531ee3d6d6145574c1f","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        :param bridge_name: Name of trunk bridge."},{"line_number":166,"context_line":"        :param port: Parent port dict."},{"line_number":167,"context_line":"        \"\"\""},{"line_number":168,"context_line":"        parent_port_id \u003d self.trunk_manager.get_port_uuid_from_external_ids("},{"line_number":169,"context_line":"            port)"},{"line_number":170,"context_line":"        trunk_id \u003d port[\u0027external_ids\u0027][\u0027trunk_id\u0027]"},{"line_number":171,"context_line":"        subport_ids \u003d jsonutils.loads(port[\u0027external_ids\u0027][\u0027subport_ids\u0027])"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a89bdaa_5ef1f693","line":168,"range":{"start_line":168,"start_character":44,"end_line":168,"end_character":75},"updated":"2016-09-08 17:18:26.000000000","message":"Missing error handling","commit_id":"92d31e177d32a4d793b953868a5455bf8f8231dd"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cf8533bbda7de0fa607a531ee3d6d6145574c1f","unresolved":false,"context_lines":[{"line_number":282,"context_line":"        :param port: Parent port dict."},{"line_number":283,"context_line":"        \"\"\""},{"line_number":284,"context_line":"        ctx \u003d self.context"},{"line_number":285,"context_line":"        parent_port_id \u003d trunk_br.portid_from_external_ids("},{"line_number":286,"context_line":"            port[\u0027external_ids\u0027])"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a89bdaa_3e24320b","line":285,"range":{"start_line":285,"start_character":34,"end_line":285,"end_character":58},"updated":"2016-09-08 17:18:26.000000000","message":"This should be unified with L168","commit_id":"92d31e177d32a4d793b953868a5455bf8f8231dd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"761b6f9a3534f7a532e53c9403419520d527601c","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            LOG.error(_LE(\"Removing trunk %(trunk_id)s failed: %(err)s\"),"},{"line_number":174,"context_line":"                      {\u0027trunk_id\u0027: port[\u0027external_ids\u0027][\u0027trunk_id\u0027],"},{"line_number":175,"context_line":"                       \u0027err\u0027: te})"},{"line_number":176,"context_line":"        else:"},{"line_number":177,"context_line":"            try:"},{"line_number":178,"context_line":"                self.trunk_rpc.update_trunk_status("},{"line_number":179,"context_line":"                    context, trunk_id, constants.DOWN_STATUS)"}],"source_content_type":"text/x-python","patch_set":20,"id":"9a89bdaa_9972ab48","line":176,"updated":"2016-09-08 22:29:03.000000000","message":"I gave you a bad feedback, my bad. Whilst I was testing I noticed that the trunk status didn\u0027t go to DOWN on instance removal but I can\u0027t repro this anymore so it might be a brainfart of mine. In reality this must be avoided to avoid two agents racing over status update in case the VM is migrating.","commit_id":"6142cec2c54e86d4e41fd823160f7d52b2ed3b97"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"761b6f9a3534f7a532e53c9403419520d527601c","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            LOG.error(_LE(\"Removing trunk %(trunk_id)s failed: %(err)s\"),"},{"line_number":174,"context_line":"                      {\u0027trunk_id\u0027: port[\u0027external_ids\u0027][\u0027trunk_id\u0027],"},{"line_number":175,"context_line":"                       \u0027err\u0027: te})"},{"line_number":176,"context_line":"        else:"},{"line_number":177,"context_line":"            try:"},{"line_number":178,"context_line":"                self.trunk_rpc.update_trunk_status("},{"line_number":179,"context_line":"                    context, trunk_id, constants.DOWN_STATUS)"},{"line_number":180,"context_line":"            except oslo_messaging.MessagingException as e:"},{"line_number":181,"context_line":"                LOG.error(_LE(\"Got messaging exception when setting trunk \""},{"line_number":182,"context_line":"                              \"%(trunk_id)s to %(status)s: %(err)s\"),"},{"line_number":183,"context_line":"                          {\u0027trunk_id\u0027: trunk_id,"},{"line_number":184,"context_line":"                           \u0027status\u0027: constants.DOWN_STATUS,"},{"line_number":185,"context_line":"                           \u0027err\u0027: e})"},{"line_number":186,"context_line":"            LOG.debug(\"Deleted resources associated to trunk: %s\", trunk_id)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def manages_this_trunk(self, trunk_id):"}],"source_content_type":"text/x-python","patch_set":20,"id":"9a89bdaa_59c6634a","line":185,"range":{"start_line":176,"start_character":8,"end_line":185,"end_character":37},"updated":"2016-09-08 22:29:03.000000000","message":"this should go away assumed that instance delete will result into a port update where the trunk status is taken care of by [1]\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/services/trunk/plugin.py#L392","commit_id":"6142cec2c54e86d4e41fd823160f7d52b2ed3b97"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0558910aea41acac6dfd924a6f95042fcaf7640e","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    \"\"\"True if there is an OVS port that doesn\u0027t have bridge or patch ports"},{"line_number":67,"context_line":"       prefix."},{"line_number":68,"context_line":"    \"\"\""},{"line_number":69,"context_line":"    ifaces \u003d bridge.get_iface_name_list()"},{"line_number":70,"context_line":"    return any(iface for iface in ifaces"},{"line_number":71,"context_line":"               if not is_trunk_service_port(iface))"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_36e4200c","line":69,"updated":"2016-09-09 15:33:02.000000000","message":"would this raise a RuntimeError if the bridge does not exist?","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f6b89b399b3f19f55bd16b1ac4becf28691f20fd","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    \"\"\"True if there is an OVS port that doesn\u0027t have bridge or patch ports"},{"line_number":67,"context_line":"       prefix."},{"line_number":68,"context_line":"    \"\"\""},{"line_number":69,"context_line":"    ifaces \u003d bridge.get_iface_name_list()"},{"line_number":70,"context_line":"    return any(iface for iface in ifaces"},{"line_number":71,"context_line":"               if not is_trunk_service_port(iface))"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_f0952540","line":69,"in_reply_to":"9a89bdaa_36e4200c","updated":"2016-09-12 15:57:15.000000000","message":"Addressed in follow up:","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"237e21db1355d76bab84cf4410d5ad7c569e6504","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":108,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":109,"context_line":"                eventlet.spawn_n("},{"line_number":110,"context_line":"                    self.handle_trunk_remove, port_event)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @lock_on_bridge_name"},{"line_number":113,"context_line":"    def handle_trunk_add(self, bridge_name):"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_9a128a57","line":110,"updated":"2016-09-09 08:11:09.000000000","message":"due to the semaphore each coroutine will be waiting to get a hold of, some threads spawned significantly later may get lucky and grab the lock before the olders ones.\n\nIn particular, you may have \u0027handle_trunk_remove\u0027 execute before \u0027handle_trunk_add\u0027 has been called for the same bridge (assuming VM interface was attached and detached quickly).\n\nBecause of this, I think you want to make sure the bridge still exists once the handle_trunk_add actually acquires the lock. \n\nhandle_trunk_remove looks like safe operations even if handle_trunk_add hasn\u0027t been called yet, but it\u0027s something worth thinking about.","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"afebd7281ff9b6506d632b2f2e140ac753a2237d","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":108,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":109,"context_line":"                eventlet.spawn_n("},{"line_number":110,"context_line":"                    self.handle_trunk_remove, port_event)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @lock_on_bridge_name"},{"line_number":113,"context_line":"    def handle_trunk_add(self, bridge_name):"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_96e88c18","line":110,"in_reply_to":"9a89bdaa_7f53f06c","updated":"2016-09-09 15:30:06.000000000","message":"if that were to happen wouldn\u0027t we go in timeout on 132 and attempt a bridge that\u0027s already gone (which doesn\u0027t raise)?","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"867bf1f9ef250000305344ff2fe3358b80185931","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":108,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":109,"context_line":"                eventlet.spawn_n("},{"line_number":110,"context_line":"                    self.handle_trunk_remove, port_event)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @lock_on_bridge_name"},{"line_number":113,"context_line":"    def handle_trunk_add(self, bridge_name):"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_9de60415","line":110,"in_reply_to":"9a89bdaa_9a128a57","updated":"2016-09-09 08:43:41.000000000","message":"thanks Kevin, that\u0027s a very good point. I agree that we should check if the bridge is still there in handle_trunk_add , if not we assume that there\u0027s no need to process that event any more. Same for handle_trunk_remove","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"accbe84a3506eb8bc57056db9d00b713eaf6c822","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":108,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":109,"context_line":"                eventlet.spawn_n("},{"line_number":110,"context_line":"                    self.handle_trunk_remove, port_event)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @lock_on_bridge_name"},{"line_number":113,"context_line":"    def handle_trunk_add(self, bridge_name):"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_e9a67252","line":110,"in_reply_to":"9a89bdaa_9de60415","updated":"2016-09-09 09:45:20.000000000","message":"You mean that passed ovsdb_events contains the bridge in both added and removed, and then spawned coroutines might be executed in opposite order of how they were called?\n\nSo maybe we should instead move the lock from decorator to context before we spawn new coroutines?","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"4072d734289a32084a093668f502d4145210fda2","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":108,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":109,"context_line":"                eventlet.spawn_n("},{"line_number":110,"context_line":"                    self.handle_trunk_remove, port_event)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @lock_on_bridge_name"},{"line_number":113,"context_line":"    def handle_trunk_add(self, bridge_name):"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_7f53f06c","line":110,"in_reply_to":"9a89bdaa_bff1f897","updated":"2016-09-09 10:16:43.000000000","message":"oh yeah, that would require releasing the lock when routine dies...","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"df9735e13a2cf1ee74f07f81a86d247e4a730205","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            bridge_name \u003d port_event[\u0027external_ids\u0027].get(\u0027bridge_name\u0027)"},{"line_number":108,"context_line":"            if bridge_name and is_trunk_bridge(bridge_name):"},{"line_number":109,"context_line":"                eventlet.spawn_n("},{"line_number":110,"context_line":"                    self.handle_trunk_remove, port_event)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @lock_on_bridge_name"},{"line_number":113,"context_line":"    def handle_trunk_add(self, bridge_name):"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_bff1f897","line":110,"in_reply_to":"9a89bdaa_e9a67252","updated":"2016-09-09 10:14:29.000000000","message":"Yep. Or even separate ovsdb events come in before the previous one managed to drain all of the coroutines.\n\nYou could move the lock, but then you don\u0027t get the queueing effect so you might as well drop the spawn completely.","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0558910aea41acac6dfd924a6f95042fcaf7640e","unresolved":false,"context_lines":[{"line_number":129,"context_line":"            common_utils.wait_until_true("},{"line_number":130,"context_line":"                bridge_has_port_predicate,"},{"line_number":131,"context_line":"                timeout\u003dWAIT_FOR_PORT_TIMEOUT)"},{"line_number":132,"context_line":"        except eventlet.TimeoutError:"},{"line_number":133,"context_line":"            LOG.error("},{"line_number":134,"context_line":"                _LE(\u0027No port appeared on trunk bridge %(br_name)s \u0027"},{"line_number":135,"context_line":"                    \u0027in %(timeout)d seconds. Cleaning up the bridge\u0027),"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_96a08ca7","line":132,"updated":"2016-09-09 15:33:02.000000000","message":"perhaps here we simply add RuntimeError?","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"4f3742393186aec9884c2dd87bd7192248e5f161","unresolved":false,"context_lines":[{"line_number":153,"context_line":"                      {\u0027bridge_name\u0027: bridge.br_name,"},{"line_number":154,"context_line":"                       \u0027err\u0027: e})"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    @lock_on_bridge_name"},{"line_number":157,"context_line":"    def handle_trunk_remove(self, port):"},{"line_number":158,"context_line":"        \"\"\"Remove wiring between trunk bridge and integration bridge."},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        The method calls into trunk manager to remove patch ports on"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_798e9428","line":157,"range":{"start_line":156,"start_character":4,"end_line":157,"end_character":40},"updated":"2016-09-09 17:06:18.000000000","message":"Why was the bridge_name parameter removed?","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"e1f0e64704e15cc772d65d42318f3e042e9ef5f1","unresolved":false,"context_lines":[{"line_number":153,"context_line":"                      {\u0027bridge_name\u0027: bridge.br_name,"},{"line_number":154,"context_line":"                       \u0027err\u0027: e})"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    @lock_on_bridge_name"},{"line_number":157,"context_line":"    def handle_trunk_remove(self, port):"},{"line_number":158,"context_line":"        \"\"\"Remove wiring between trunk bridge and integration bridge."},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        The method calls into trunk manager to remove patch ports on"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_44f43c5a","line":157,"range":{"start_line":156,"start_character":4,"end_line":157,"end_character":40},"in_reply_to":"9a89bdaa_24de5811","updated":"2016-09-12 16:00:24.000000000","message":"Addressed https://review.openstack.org/#/c/368691/3/neutron/services/trunk/drivers/openvswitch/agent/ovsdb_handler.py@174","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f6b89b399b3f19f55bd16b1ac4becf28691f20fd","unresolved":false,"context_lines":[{"line_number":153,"context_line":"                      {\u0027bridge_name\u0027: bridge.br_name,"},{"line_number":154,"context_line":"                       \u0027err\u0027: e})"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    @lock_on_bridge_name"},{"line_number":157,"context_line":"    def handle_trunk_remove(self, port):"},{"line_number":158,"context_line":"        \"\"\"Remove wiring between trunk bridge and integration bridge."},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        The method calls into trunk manager to remove patch ports on"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_24de5811","line":157,"range":{"start_line":156,"start_character":4,"end_line":157,"end_character":40},"in_reply_to":"9a89bdaa_44a19cf7","updated":"2016-09-12 15:57:15.000000000","message":"Ouch! You\u0027re right!","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"53ef37546c17cbf574c7b536c5d15409338f7784","unresolved":false,"context_lines":[{"line_number":153,"context_line":"                      {\u0027bridge_name\u0027: bridge.br_name,"},{"line_number":154,"context_line":"                       \u0027err\u0027: e})"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    @lock_on_bridge_name"},{"line_number":157,"context_line":"    def handle_trunk_remove(self, port):"},{"line_number":158,"context_line":"        \"\"\"Remove wiring between trunk bridge and integration bridge."},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        The method calls into trunk manager to remove patch ports on"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_b2ae4596","line":157,"range":{"start_line":156,"start_character":4,"end_line":157,"end_character":40},"in_reply_to":"9a89bdaa_798e9428","updated":"2016-09-12 09:04:59.000000000","message":"It\u0027s not used anywhere. The removal of bridge itself is handled by trunk manager, so all you need is port.","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"463eb5ec0f1dbe969c0c35b41fbba81428515bb4","unresolved":false,"context_lines":[{"line_number":153,"context_line":"                      {\u0027bridge_name\u0027: bridge.br_name,"},{"line_number":154,"context_line":"                       \u0027err\u0027: e})"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    @lock_on_bridge_name"},{"line_number":157,"context_line":"    def handle_trunk_remove(self, port):"},{"line_number":158,"context_line":"        \"\"\"Remove wiring between trunk bridge and integration bridge."},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        The method calls into trunk manager to remove patch ports on"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_44a19cf7","line":157,"range":{"start_line":156,"start_character":4,"end_line":157,"end_character":40},"in_reply_to":"9a89bdaa_b2ae4596","updated":"2016-09-12 15:51:29.000000000","message":"But don\u0027t we need bridge_name for the @lock_on_bridge_name decorator to work?","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"237e21db1355d76bab84cf4410d5ad7c569e6504","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        \"\"\"Create OVS ports associated to the logical subports.\"\"\""},{"line_number":187,"context_line":"        # Tell the server that subports must be bound to this host."},{"line_number":188,"context_line":"        # If this fails at the very beginning of the OVS trunk bridge"},{"line_number":189,"context_line":"        # lifecycle (trunk_bridge !\u003d None), then destroy the bridge"},{"line_number":190,"context_line":"        # and give up."},{"line_number":191,"context_line":"        subport_bindings \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":192,"context_line":"            context, subports)"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_ba0f4e2d","line":189,"updated":"2016-09-09 08:11:09.000000000","message":"I don\u0027t see where this function destroys a bridge?","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a9c14a354c200f51060727caf97866097bfd4ab3","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        \"\"\"Create OVS ports associated to the logical subports.\"\"\""},{"line_number":187,"context_line":"        # Tell the server that subports must be bound to this host."},{"line_number":188,"context_line":"        # If this fails at the very beginning of the OVS trunk bridge"},{"line_number":189,"context_line":"        # lifecycle (trunk_bridge !\u003d None), then destroy the bridge"},{"line_number":190,"context_line":"        # and give up."},{"line_number":191,"context_line":"        subport_bindings \u003d self.trunk_rpc.update_subport_bindings("},{"line_number":192,"context_line":"            context, subports)"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_36c18081","line":189,"in_reply_to":"9a89bdaa_ba0f4e2d","updated":"2016-09-09 15:30:59.000000000","message":"Um, this comment seems out of sync with the code.","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f390f5b2aa2fdc1560094a5bd980422b3f5a4afa","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            # will cause troubles during deletion."},{"line_number":220,"context_line":"            # TODO(jlibosva): Investigate how to proceed during removal of"},{"line_number":221,"context_line":"            # trunk bridge that doesn\u0027t have metadata stored."},{"line_number":222,"context_line":"            self.trunk_rpc.update_trunk_status("},{"line_number":223,"context_line":"                context, trunk_id, constants.DEGRADED_STATUS)"},{"line_number":224,"context_line":"            return"},{"line_number":225,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_59fe6339","line":222,"updated":"2016-09-08 22:53:45.000000000","message":"If we are unable to set the metadata, but the trunk was set up correctly, being in degraded state not sure it is the right thing to do, but I suppose we can learn and figure out a better way to handle this.\n\nBtw, personally I would have kept hold of status and wrote the more compact code like below, but it\u0027s a style difference.\n\n  status \u003d constants.DEGRADED_STATUS\n \n# out the except\n\nstatus \u003d constants.DEGRADED_STATUS if len(subport_ids) !\u003d len(subports) else constants.ACTIVE_STATUS\nself.trunk_rpc.update_trunk_status(context, trunk_id, status)","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"}],"neutron/services/trunk/drivers/openvswitch/agent/trunk_manager.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class TrunkManagerError(exceptions.NeutronException):"},{"line_number":28,"context_line":"    message \u003d _(\"Error while communicating with OVSDB: %(error)s\")"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_3fb9cc79","line":27,"updated":"2016-09-07 18:55:51.000000000","message":"I suppose this could be used to codify more neatly the error conditions that may present over time when dealing with OVSDB","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class TrunkManagerError(exceptions.NeutronException):"},{"line_number":28,"context_line":"    message \u003d _(\"Error while communicating with OVSDB: %(error)s\")"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_a5004103","line":27,"in_reply_to":"9a89bdaa_3fb9cc79","updated":"2016-09-08 14:16:27.000000000","message":"This is to wrap RuntimeError coming from OVSDB. Ideally, we should have more specific exceptions coming from ovsdb interface. Then we could either react here in trunk manager, re-raise or raise exception that callers can handle.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"}],"neutron/services/trunk/exceptions.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"228b8ea1c6a1b24e456e7319542d8336af1bf897","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                \"operation from completing, please, contact the admin.\")"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"class WiringError(n_exc.InUse):"},{"line_number":78,"context_line":"    message \u003d _(\"Port %(id)s cannot be wired\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ac371cc_ebce42b3","line":77,"updated":"2016-08-14 11:27:32.000000000","message":"Can we change this to TrunkWiringError","commit_id":"b0ecd41051b901fe3d062b005b9bddd18b37602e"}],"neutron/tests/functional/services/trunk/drivers/openvswitch/agent/test_ovsdb_handler.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fbb109dc1c8a7be74c4e8384fd7173d4089f79b6","unresolved":false,"context_lines":[{"line_number":34,"context_line":"                      \u0027port_id\u0027: uuidutils.generate_uuid(),"},{"line_number":35,"context_line":"                      \u0027mac_address\u0027: common_utils.get_random_mac("},{"line_number":36,"context_line":"                          \u0027fa:16:3e:00:00:00\u0027.split(\u0027:\u0027))}"},{"line_number":37,"context_line":"        self.trunk_br \u003d ovs_lib.BaseOVS().add_bridge("},{"line_number":38,"context_line":"            utils.gen_trunk_br_name(self.trunk[\u0027id\u0027]))"},{"line_number":39,"context_line":"        self.addCleanup(self.trunk_br.destroy)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def _plug_ports(self, network, ports, agent, bridge\u003dNone, namespace\u003dNone):"},{"line_number":42,"context_line":"        # creates only the trunk, the sub_port will be plugged by the"}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_90762ed5","line":39,"range":{"start_line":37,"start_character":0,"end_line":39,"end_character":46},"updated":"2016-08-24 15:51:21.000000000","message":"Fixture","commit_id":"74619660969419fd5deda93c4ee7267393ff5add"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"ed0608056cf7fd38f896fe852a21ddf74e77204b","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class OVSDBHandlerTestCase(base.OVSAgentTestFramework):"},{"line_number":28,"context_line":"    net1_cidr \u003d \u0027192.178.0.1/24\u0027"},{"line_number":29,"context_line":"    net2_cidr \u003d \u0027192.168.0.1/24\u0027"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def setUp(self):"},{"line_number":32,"context_line":"        super(OVSDBHandlerTestCase, self).setUp()"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_ca55251e","line":29,"range":{"start_line":28,"start_character":0,"end_line":29,"end_character":32},"updated":"2016-08-26 07:44:21.000000000","message":"are these used?","commit_id":"fb4c7e02db84a96280f9c629bce820ccef0d6e82"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        n_consts.DEVICE_NAME_MAX_LEN - len(n_consts.TAP_DEVICE_PREFIX))"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class OVSDBHandlerTestCase(base.OVSAgentTestFramework):"},{"line_number":35,"context_line":"    def setUp(self):"},{"line_number":36,"context_line":"        super(OVSDBHandlerTestCase, self).setUp()"},{"line_number":37,"context_line":"        trunk_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_39ef7188","line":34,"updated":"2016-09-06 16:59:33.000000000","message":"it\u0027d be nice to add a docstring to explain at high level what this is testing, as there\u0027s quite a bit of setup code before we get to the meat of it.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cfcfa8a7959b071fceb1f4418e45336cd09da91","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        n_consts.DEVICE_NAME_MAX_LEN - len(n_consts.TAP_DEVICE_PREFIX))"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class OVSDBHandlerTestCase(base.OVSAgentTestFramework):"},{"line_number":35,"context_line":"    def setUp(self):"},{"line_number":36,"context_line":"        super(OVSDBHandlerTestCase, self).setUp()"},{"line_number":37,"context_line":"        trunk_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_947ad1ef","line":34,"in_reply_to":"9a89bdaa_39ef7188","updated":"2016-09-07 13:40:22.000000000","message":"Done","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":127,"context_line":"            segmentation_id\u003di,"},{"line_number":128,"context_line":"            trunk_id\u003dself.trunk_dict[\u0027id\u0027])"},{"line_number":129,"context_line":"            for i in range(1, 3)]"},{"line_number":130,"context_line":"        self._test_trunk_creation_helper(ports[:1])"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def test_trunk_creation_with_no_subports(self):"},{"line_number":133,"context_line":"        ports \u003d self.create_test_ports(amount\u003d1)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_d985a5ad","line":130,"updated":"2016-09-06 16:59:33.000000000","message":"why do we create 3 ports and pass only the first here? To make the scenario more realistic?","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cfcfa8a7959b071fceb1f4418e45336cd09da91","unresolved":false,"context_lines":[{"line_number":127,"context_line":"            segmentation_id\u003di,"},{"line_number":128,"context_line":"            trunk_id\u003dself.trunk_dict[\u0027id\u0027])"},{"line_number":129,"context_line":"            for i in range(1, 3)]"},{"line_number":130,"context_line":"        self._test_trunk_creation_helper(ports[:1])"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def test_trunk_creation_with_no_subports(self):"},{"line_number":133,"context_line":"        ports \u003d self.create_test_ports(amount\u003d1)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_1497a148","line":130,"in_reply_to":"9a89bdaa_d985a5ad","updated":"2016-09-07 13:40:22.000000000","message":"The number of ports passed corresponds with number of tap devices plugged into a VM. Thus we pass one port and all other created ports on L121 will be subports.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class OVSDBHandlerTestCase(base.OVSAgentTestFramework):"},{"line_number":35,"context_line":"    \"\"\"Test funcionality of OVSDBHandler."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    This suite aims for interaction between events coming from OVSDB monitor,"},{"line_number":38,"context_line":"    agent and wiring ports via trunk bridge to integration bridge."}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_1a56d6cd","line":35,"updated":"2016-09-07 18:55:51.000000000","message":"This test is not race-y is it? \n\nI gotta ack in order to smoke out any failure...it looks like it worked last time :)","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"671d4cff31c3f1eec72ff660c9f922ab5e0ffd73","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class OVSDBHandlerTestCase(base.OVSAgentTestFramework):"},{"line_number":35,"context_line":"    \"\"\"Test funcionality of OVSDBHandler."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    This suite aims for interaction between events coming from OVSDB monitor,"},{"line_number":38,"context_line":"    agent and wiring ports via trunk bridge to integration bridge."}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_a0610fd5","line":35,"in_reply_to":"9a89bdaa_1a56d6cd","updated":"2016-09-08 14:16:27.000000000","message":"I haven\u0027t hit any issue so far. I can try to run it in the loop over the night.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"}],"neutron/tests/unit/services/trunk/drivers/openvswitch/agent/test_ovsdb_handler.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":26,"context_line":"class TestIsTrunkServicePort(base.BaseTestCase):"},{"line_number":27,"context_line":"    def test_with_bridge_name(self):"},{"line_number":28,"context_line":"        obtained \u003d ovsdb_handler.is_trunk_service_port(\u0027tbr-foo\u0027)"},{"line_number":29,"context_line":"        self.assertTrue(obtained)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def test_with_subport_patch_port_int_side(self):"},{"line_number":32,"context_line":"        obtained \u003d ovsdb_handler.is_trunk_service_port(\u0027spi-foo\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_d973e5e5","line":29,"updated":"2016-09-06 16:59:33.000000000","message":"nit: observed or expected is usually more familiar.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cfcfa8a7959b071fceb1f4418e45336cd09da91","unresolved":false,"context_lines":[{"line_number":26,"context_line":"class TestIsTrunkServicePort(base.BaseTestCase):"},{"line_number":27,"context_line":"    def test_with_bridge_name(self):"},{"line_number":28,"context_line":"        obtained \u003d ovsdb_handler.is_trunk_service_port(\u0027tbr-foo\u0027)"},{"line_number":29,"context_line":"        self.assertTrue(obtained)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def test_with_subport_patch_port_int_side(self):"},{"line_number":32,"context_line":"        obtained \u003d ovsdb_handler.is_trunk_service_port(\u0027spi-foo\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_d4ce192c","line":29,"in_reply_to":"9a89bdaa_d973e5e5","updated":"2016-09-07 13:40:22.000000000","message":"Done","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        self.present_interfaces \u003d []"},{"line_number":57,"context_line":"        self.bridge.get_iface_name_list.return_value \u003d self.present_interfaces"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def test_only_service_ports_on_bridge(self):"},{"line_number":60,"context_line":"        self.present_interfaces.extend("},{"line_number":61,"context_line":"            [\u0027tbr-foo\u0027, \u0027spt-foo\u0027, \u0027tpt-foo\u0027])"},{"line_number":62,"context_line":"        self.assertFalse(ovsdb_handler.bridge_has_instance_port(self.bridge))"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_39321111","line":59,"updated":"2016-09-06 16:59:33.000000000","message":"did you mean to have a test with no ports? If that doesn\u0027t make sense might as well avoid the use of extend, but it\u0027s a nit.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cfcfa8a7959b071fceb1f4418e45336cd09da91","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        self.present_interfaces \u003d []"},{"line_number":57,"context_line":"        self.bridge.get_iface_name_list.return_value \u003d self.present_interfaces"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def test_only_service_ports_on_bridge(self):"},{"line_number":60,"context_line":"        self.present_interfaces.extend("},{"line_number":61,"context_line":"            [\u0027tbr-foo\u0027, \u0027spt-foo\u0027, \u0027tpt-foo\u0027])"},{"line_number":62,"context_line":"        self.assertFalse(ovsdb_handler.bridge_has_instance_port(self.bridge))"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_74f70d59","line":59,"in_reply_to":"9a89bdaa_39321111","updated":"2016-09-07 13:40:22.000000000","message":"No, it should be a case where there are only patch ports or port with name of the bridge on trunk bridge. No other ports like tap devices.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def test_device_on_bridge(self):"},{"line_number":65,"context_line":"        self.present_interfaces.extend("},{"line_number":66,"context_line":"            [\u0027tbr-foo\u0027, \u0027spt-foo\u0027, \u0027tpt-foo\u0027, \u0027foo\u0027])"},{"line_number":67,"context_line":"        self.assertTrue(ovsdb_handler.bridge_has_instance_port(self.bridge))"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_9916bd53","line":66,"updated":"2016-09-06 16:59:33.000000000","message":"might be worth highlighting with comments that you\u0027re expecting foo to be the port that makes the condition be true, but again nit.","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cfcfa8a7959b071fceb1f4418e45336cd09da91","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def test_device_on_bridge(self):"},{"line_number":65,"context_line":"        self.present_interfaces.extend("},{"line_number":66,"context_line":"            [\u0027tbr-foo\u0027, \u0027spt-foo\u0027, \u0027tpt-foo\u0027, \u0027foo\u0027])"},{"line_number":67,"context_line":"        self.assertTrue(ovsdb_handler.bridge_has_instance_port(self.bridge))"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_542da9a6","line":66,"in_reply_to":"9a89bdaa_9916bd53","updated":"2016-09-07 13:40:22.000000000","message":"Done","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da7dfc5b13261d663857826bb166d776f66f195c","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"class TestOVSDBHandler(base.BaseTestCase):"},{"line_number":71,"context_line":"    \"\"\"Test that rpc failure don\u0027t cause crash.\"\"\""},{"line_number":72,"context_line":"    def setUp(self):"},{"line_number":73,"context_line":"        super(TestOVSDBHandler, self).setUp()"},{"line_number":74,"context_line":"        self.ovsdb_handler \u003d ovsdb_handler.OVSDBHandler(mock.sentinel.manager)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_d9084530","line":71,"updated":"2016-09-06 16:59:33.000000000","message":"RPC failure does not","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"6cfcfa8a7959b071fceb1f4418e45336cd09da91","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"class TestOVSDBHandler(base.BaseTestCase):"},{"line_number":71,"context_line":"    \"\"\"Test that rpc failure don\u0027t cause crash.\"\"\""},{"line_number":72,"context_line":"    def setUp(self):"},{"line_number":73,"context_line":"        super(TestOVSDBHandler, self).setUp()"},{"line_number":74,"context_line":"        self.ovsdb_handler \u003d ovsdb_handler.OVSDBHandler(mock.sentinel.manager)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a89bdaa_97001303","line":71,"in_reply_to":"9a89bdaa_d9084530","updated":"2016-09-07 13:40:22.000000000","message":"Done","commit_id":"b22ad4379de542aef32b00cfeb2cee4b05eb5af4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"2cf36865593ad9e6694494bfbd6422a0e3339956","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        self.assertTrue(ovsdb_handler.bridge_has_instance_port(self.bridge))"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"class TestOVSDBHandler(base.BaseTestCase):"},{"line_number":74,"context_line":"    \"\"\"Test that RPC or OVSDB failures do not cause crash.\"\"\""},{"line_number":75,"context_line":"    def setUp(self):"},{"line_number":76,"context_line":"        super(TestOVSDBHandler, self).setUp()"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_20961a3f","line":73,"updated":"2016-09-07 15:31:04.000000000","message":"These tests are skipped, I\u0027ll implement failure testing later once we agree on error handling of ovsdbhandler.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b633e7e65947173419f161988f4d702251bb7cb","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        self.assertTrue(ovsdb_handler.bridge_has_instance_port(self.bridge))"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"class TestOVSDBHandler(base.BaseTestCase):"},{"line_number":74,"context_line":"    \"\"\"Test that RPC or OVSDB failures do not cause crash.\"\"\""},{"line_number":75,"context_line":"    def setUp(self):"},{"line_number":76,"context_line":"        super(TestOVSDBHandler, self).setUp()"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a89bdaa_9a182620","line":73,"in_reply_to":"9a89bdaa_20961a3f","updated":"2016-09-07 18:55:51.000000000","message":"Generally I think the failures should be handled such that the part of the trunk that has been provisioned and is sane be kept. The other part associated to failures should be cleaned up.\n\nNow there are things like associating metadata are done at the very end; if those fail that prevents us from being able to proceed during removal, perhaps we may want to device an alternative path to recover that information by inspecting the state of the system, but we can do that as a follow up and I\u0027d be ok with a TODO for now.","commit_id":"ab0c5c68d8ff013eccd8cec8508c767183dfdc3f"}],"neutron/tests/unit/services/trunk/drivers/openvswitch/agent/test_trunk_manager.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f390f5b2aa2fdc1560094a5bd980422b3f5a4afa","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def test_create_trunk_plug_fails(self):"},{"line_number":88,"context_line":"        with self._resource_fails(trunk_manager.TrunkParentPort, \u0027plug\u0027):"},{"line_number":89,"context_line":"            self.trunk_manager.create_trunk(None, None, None)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def test_remove_trunk_unplug_fails(self):"},{"line_number":92,"context_line":"        with self._resource_fails(trunk_manager.TrunkParentPort, \u0027unplug\u0027):"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_b403f6bd","line":89,"updated":"2016-09-08 22:53:45.000000000","message":"mock.ANY would have been more readable but it\u0027s a nit.","commit_id":"52300f285a4e0c4e487b91bfe5b2308a5ae8f11c"}]}
