)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"1e9368472d4943cff1d25edcad493bcbb4dbff11","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"The same thing has been done for Trunk deletion."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"[0] https://github.com/openstack/rally-openstack/blob/master/rally_openstack/scenarios/neutron/trunk.py#L37"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: I020ba64618b2eb76c627632b0575896e88d1fcf8"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"7faddb67_e1d3d236","line":26,"range":{"start_line":26,"start_character":0,"end_line":26,"end_character":1},"updated":"2019-08-20 15:28:09.000000000","message":"This requires a closes bug (we need backports!) and perhaps a related bug against neutron which justifies why we are updating the DB from the driver. If ML2 makes the updates faster at some point we can perhaps revert this eventually.","commit_id":"9824dfb9122c3645bbe6dc70a41927284dc17f6e"}],"networking_ovn/ml2/trunk_driver.py":[{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"1b2e9e4376b1626a55b996805b75b2f30b1fdcc2","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                self.plugin_driver._nb_ovn.set_lswitch_port("},{"line_number":66,"context_line":"                    lport_name\u003dport.port_id,"},{"line_number":67,"context_line":"                    parent_name\u003dparent_port,"},{"line_number":68,"context_line":"                    tag\u003dport.segmentation_id).execute()"},{"line_number":69,"context_line":"            except (os_db_exc.DBReferenceError, n_exc.PortNotFound,"},{"line_number":70,"context_line":"                    n_exc.ObjectNotFound):"},{"line_number":71,"context_line":"                LOG.debug(\"Port not found trying to set binding_profile: %s\","}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_e10512c3","line":68,"range":{"start_line":68,"start_character":46,"end_line":68,"end_character":53},"updated":"2019-08-20 15:25:39.000000000","message":"What about adding it to a single transaction using a context manager? That will save some traffic and processing across the board. Truth is that if updating a single port fails (because of a concurrent deletion of that port for example), were gonna fail the whole operation. Any thoughts?","commit_id":"9824dfb9122c3645bbe6dc70a41927284dc17f6e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"3323d00f1c6378c108ad7ab79b656ba2eb5ecdab","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                self.plugin_driver._nb_ovn.set_lswitch_port("},{"line_number":66,"context_line":"                    lport_name\u003dport.port_id,"},{"line_number":67,"context_line":"                    parent_name\u003dparent_port,"},{"line_number":68,"context_line":"                    tag\u003dport.segmentation_id).execute()"},{"line_number":69,"context_line":"            except (os_db_exc.DBReferenceError, n_exc.PortNotFound,"},{"line_number":70,"context_line":"                    n_exc.ObjectNotFound):"},{"line_number":71,"context_line":"                LOG.debug(\"Port not found trying to set binding_profile: %s\","}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_9b6931f9","line":68,"range":{"start_line":68,"start_character":45,"end_line":68,"end_character":55},"updated":"2019-08-20 14:40:49.000000000","message":"nit: usually I do check_error\u003dTrue in the OVSDB transactions. Just so we are aware when something error\u0027d out instead of getting silence upon a failure.","commit_id":"9824dfb9122c3645bbe6dc70a41927284dc17f6e"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"e623b1e376dcc169ba815627cf195f45e42c69cc","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                self.plugin_driver._nb_ovn.set_lswitch_port("},{"line_number":66,"context_line":"                    lport_name\u003dport.port_id,"},{"line_number":67,"context_line":"                    parent_name\u003dparent_port,"},{"line_number":68,"context_line":"                    tag\u003dport.segmentation_id).execute()"},{"line_number":69,"context_line":"            except (os_db_exc.DBReferenceError, n_exc.PortNotFound,"},{"line_number":70,"context_line":"                    n_exc.ObjectNotFound):"},{"line_number":71,"context_line":"                LOG.debug(\"Port not found trying to set binding_profile: %s\","}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_e628c886","line":68,"range":{"start_line":68,"start_character":45,"end_line":68,"end_character":55},"in_reply_to":"7faddb67_9b6931f9","updated":"2019-08-20 14:43:36.000000000","message":"Ah, forgot about it here. thanks for point this :)","commit_id":"9824dfb9122c3645bbe6dc70a41927284dc17f6e"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"871ed4fc561a493033515e3cc5556fabd5b2e16f","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                self.plugin_driver._nb_ovn.set_lswitch_port("},{"line_number":66,"context_line":"                    lport_name\u003dport.port_id,"},{"line_number":67,"context_line":"                    parent_name\u003dparent_port,"},{"line_number":68,"context_line":"                    tag\u003dport.segmentation_id).execute()"},{"line_number":69,"context_line":"            except (os_db_exc.DBReferenceError, n_exc.PortNotFound,"},{"line_number":70,"context_line":"                    n_exc.ObjectNotFound):"},{"line_number":71,"context_line":"                LOG.debug(\"Port not found trying to set binding_profile: %s\","}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_959a2e6d","line":68,"range":{"start_line":68,"start_character":46,"end_line":68,"end_character":53},"in_reply_to":"7faddb67_e10512c3","updated":"2019-08-22 18:05:25.000000000","message":"In this particular example IMO there is no need to catch any RowNotFound exception or other, because it will not be raised.\n\nIf the port doesn\u0027t exist or not the set_lswitch_port() returns None. So no worries :)\n\nI\u0027ve added it to the transaction. But in those terms is this needed now?","commit_id":"9824dfb9122c3645bbe6dc70a41927284dc17f6e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"3323d00f1c6378c108ad7ab79b656ba2eb5ecdab","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                    tag\u003dport.segmentation_id).execute()"},{"line_number":69,"context_line":"            except (os_db_exc.DBReferenceError, n_exc.PortNotFound,"},{"line_number":70,"context_line":"                    n_exc.ObjectNotFound):"},{"line_number":71,"context_line":"                LOG.debug(\"Port not found trying to set binding_profile: %s\","},{"line_number":72,"context_line":"                          port.port_id)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def _unset_sub_ports(self, subports):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_3b8a7dbb","line":71,"range":{"start_line":71,"start_character":41,"end_line":71,"end_character":42},"updated":"2019-08-20 14:40:49.000000000","message":"nit: while/when trying...","commit_id":"9824dfb9122c3645bbe6dc70a41927284dc17f6e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"3323d00f1c6378c108ad7ab79b656ba2eb5ecdab","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                continue"},{"line_number":83,"context_line":"            try:"},{"line_number":84,"context_line":"                for binding in db_port.bindings:"},{"line_number":85,"context_line":"                    try:"},{"line_number":86,"context_line":"                        binding.profile.pop(\u0027tag\u0027)"},{"line_number":87,"context_line":"                        binding.profile.pop(\u0027parent_name\u0027)"},{"line_number":88,"context_line":"                    except KeyError:"},{"line_number":89,"context_line":"                        pass"},{"line_number":90,"context_line":"                    # host + port_id is primary key"},{"line_number":91,"context_line":"                    port_obj.PortBinding.update_object("},{"line_number":92,"context_line":"                        context,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_3b511d31","line":89,"range":{"start_line":85,"start_character":0,"end_line":89,"end_character":28},"updated":"2019-08-20 14:40:49.000000000","message":"binding.profile.pop(\u0027tag\u0027, None)\nbinding.profile.pop(\u0027parent_name\u0027, None)\n\nThat way we do not need the try..except and if the first one fails the second one will still be executed","commit_id":"9824dfb9122c3645bbe6dc70a41927284dc17f6e"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"e623b1e376dcc169ba815627cf195f45e42c69cc","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                continue"},{"line_number":83,"context_line":"            try:"},{"line_number":84,"context_line":"                for binding in db_port.bindings:"},{"line_number":85,"context_line":"                    try:"},{"line_number":86,"context_line":"                        binding.profile.pop(\u0027tag\u0027)"},{"line_number":87,"context_line":"                        binding.profile.pop(\u0027parent_name\u0027)"},{"line_number":88,"context_line":"                    except KeyError:"},{"line_number":89,"context_line":"                        pass"},{"line_number":90,"context_line":"                    # host + port_id is primary key"},{"line_number":91,"context_line":"                    port_obj.PortBinding.update_object("},{"line_number":92,"context_line":"                        context,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_26190079","line":89,"range":{"start_line":85,"start_character":0,"end_line":89,"end_character":28},"in_reply_to":"7faddb67_3b511d31","updated":"2019-08-20 14:43:36.000000000","message":"Yep, that\u0027s smarter :)","commit_id":"9824dfb9122c3645bbe6dc70a41927284dc17f6e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"3323d00f1c6378c108ad7ab79b656ba2eb5ecdab","unresolved":false,"context_lines":[{"line_number":109,"context_line":"                    tag\u003d[]).execute(check_error\u003dTrue)"},{"line_number":110,"context_line":"            except (os_db_exc.DBReferenceError, n_exc.PortNotFound,"},{"line_number":111,"context_line":"                    n_exc.ObjectNotFound):"},{"line_number":112,"context_line":"                LOG.debug(\"Port not found trying to set binding_profile: %s\","},{"line_number":113,"context_line":"                          port.port_id)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def trunk_created(self, trunk):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_bb3aede2","line":112,"range":{"start_line":112,"start_character":41,"end_line":112,"end_character":42},"updated":"2019-08-20 14:40:49.000000000","message":"nit: while/when trying...","commit_id":"9824dfb9122c3645bbe6dc70a41927284dc17f6e"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"e623b1e376dcc169ba815627cf195f45e42c69cc","unresolved":false,"context_lines":[{"line_number":109,"context_line":"                    tag\u003d[]).execute(check_error\u003dTrue)"},{"line_number":110,"context_line":"            except (os_db_exc.DBReferenceError, n_exc.PortNotFound,"},{"line_number":111,"context_line":"                    n_exc.ObjectNotFound):"},{"line_number":112,"context_line":"                LOG.debug(\"Port not found trying to set binding_profile: %s\","},{"line_number":113,"context_line":"                          port.port_id)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def trunk_created(self, trunk):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_46143c41","line":112,"range":{"start_line":112,"start_character":41,"end_line":112,"end_character":42},"in_reply_to":"7faddb67_bb3aede2","updated":"2019-08-20 14:43:36.000000000","message":"++","commit_id":"9824dfb9122c3645bbe6dc70a41927284dc17f6e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bacec580a426a1982d8ad26e93907dbf7516bee0","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    def _set_sub_ports(self, parent_port, subports):"},{"line_number":47,"context_line":"        context \u003d n_context.get_admin_context()"},{"line_number":48,"context_line":"        for port in subports:"},{"line_number":49,"context_line":"            db_port \u003d port_obj.Port.get_object(context, id\u003dport.port_id)"},{"line_number":50,"context_line":"            if not db_port:"},{"line_number":51,"context_line":"                LOG.debug(\"Port not found while trying to set \""},{"line_number":52,"context_line":"                          \"binding_profile: %s\","}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_a6700242","line":49,"updated":"2019-08-28 13:59:06.000000000","message":"Opinion: I liked calling _set_binding_profile() better here as it was more logically split.","commit_id":"4ac41b6ad8294c0325c3c67c085116d020f6ac58"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"de210441caa93a65eb828d20b285e39d8d1a8153","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    def _set_sub_ports(self, parent_port, subports):"},{"line_number":47,"context_line":"        context \u003d n_context.get_admin_context()"},{"line_number":48,"context_line":"        for port in subports:"},{"line_number":49,"context_line":"            db_port \u003d port_obj.Port.get_object(context, id\u003dport.port_id)"},{"line_number":50,"context_line":"            if not db_port:"},{"line_number":51,"context_line":"                LOG.debug(\"Port not found while trying to set \""},{"line_number":52,"context_line":"                          \"binding_profile: %s\","}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_0bb3d34f","line":49,"in_reply_to":"7faddb67_a6700242","updated":"2019-09-03 11:55:25.000000000","message":"First it was only about POSTing binding_profile to the API. For now its more complicated. It updates binding profile, changes","commit_id":"4ac41b6ad8294c0325c3c67c085116d020f6ac58"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"de210441caa93a65eb828d20b285e39d8d1a8153","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    def _set_sub_ports(self, parent_port, subports):"},{"line_number":47,"context_line":"        context \u003d n_context.get_admin_context()"},{"line_number":48,"context_line":"        for port in subports:"},{"line_number":49,"context_line":"            db_port \u003d port_obj.Port.get_object(context, id\u003dport.port_id)"},{"line_number":50,"context_line":"            if not db_port:"},{"line_number":51,"context_line":"                LOG.debug(\"Port not found while trying to set \""},{"line_number":52,"context_line":"                          \"binding_profile: %s\","}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_4b722b7e","line":49,"in_reply_to":"7faddb67_a6700242","updated":"2019-09-03 11:55:25.000000000","message":"Ok, moved.","commit_id":"4ac41b6ad8294c0325c3c67c085116d020f6ac58"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bacec580a426a1982d8ad26e93907dbf7516bee0","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                        port_id\u003dport.port_id,"},{"line_number":64,"context_line":"                        host\u003dbinding.host)"},{"line_number":65,"context_line":"                t \u003d self.plugin_driver._nb_ovn.transaction"},{"line_number":66,"context_line":"                with t(check_error\u003dTrue) as txn:"},{"line_number":67,"context_line":"                    txn.add(self.plugin_driver._nb_ovn.set_lswitch_port("},{"line_number":68,"context_line":"                            lport_name\u003dport.port_id,"},{"line_number":69,"context_line":"                            parent_name\u003dparent_port,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_06823601","line":66,"range":{"start_line":66,"start_character":0,"end_line":66,"end_character":48},"updated":"2019-08-28 13:59:06.000000000","message":"Do we need to create transaction context when we put only a single command in it? We could just call .execute(), right?","commit_id":"4ac41b6ad8294c0325c3c67c085116d020f6ac58"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"de210441caa93a65eb828d20b285e39d8d1a8153","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                        port_id\u003dport.port_id,"},{"line_number":64,"context_line":"                        host\u003dbinding.host)"},{"line_number":65,"context_line":"                t \u003d self.plugin_driver._nb_ovn.transaction"},{"line_number":66,"context_line":"                with t(check_error\u003dTrue) as txn:"},{"line_number":67,"context_line":"                    txn.add(self.plugin_driver._nb_ovn.set_lswitch_port("},{"line_number":68,"context_line":"                            lport_name\u003dport.port_id,"},{"line_number":69,"context_line":"                            parent_name\u003dparent_port,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_e808bdd9","line":66,"range":{"start_line":66,"start_character":0,"end_line":66,"end_character":48},"in_reply_to":"7faddb67_06823601","updated":"2019-09-03 11:55:25.000000000","message":"Hmm, Daniel asked for it before: \"What about adding it to a single transaction using a context manager? That will save some traffic and processing across the board.\", so I\u0027ve added. @Daniel can we drop this if its only for one command?","commit_id":"4ac41b6ad8294c0325c3c67c085116d020f6ac58"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"cbfe884d6d33e179a4dbffc24b7878cfb3ad6607","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                        port_id\u003dport.port_id,"},{"line_number":64,"context_line":"                        host\u003dbinding.host)"},{"line_number":65,"context_line":"                t \u003d self.plugin_driver._nb_ovn.transaction"},{"line_number":66,"context_line":"                with t(check_error\u003dTrue) as txn:"},{"line_number":67,"context_line":"                    txn.add(self.plugin_driver._nb_ovn.set_lswitch_port("},{"line_number":68,"context_line":"                            lport_name\u003dport.port_id,"},{"line_number":69,"context_line":"                            parent_name\u003dparent_port,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_6efff533","line":66,"range":{"start_line":66,"start_character":0,"end_line":66,"end_character":48},"in_reply_to":"7faddb67_2eeb3da4","updated":"2019-09-03 13:31:58.000000000","message":"Yes that makes sense. But when doing so we should potentially also think about adding neutron db write actions also to single transaction, and I don\u0027t know if its that easy to do, I\u0027ll investigate.","commit_id":"4ac41b6ad8294c0325c3c67c085116d020f6ac58"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"bcfb07b5acfa1fd99eaf64e769e528a714db93f6","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                        port_id\u003dport.port_id,"},{"line_number":64,"context_line":"                        host\u003dbinding.host)"},{"line_number":65,"context_line":"                t \u003d self.plugin_driver._nb_ovn.transaction"},{"line_number":66,"context_line":"                with t(check_error\u003dTrue) as txn:"},{"line_number":67,"context_line":"                    txn.add(self.plugin_driver._nb_ovn.set_lswitch_port("},{"line_number":68,"context_line":"                            lport_name\u003dport.port_id,"},{"line_number":69,"context_line":"                            parent_name\u003dparent_port,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_827d60e7","line":66,"range":{"start_line":66,"start_character":0,"end_line":66,"end_character":48},"in_reply_to":"7faddb67_6efff533","updated":"2019-09-03 16:06:36.000000000","message":"That\u0027s a good point :)\nIf we cannot do it in Neutron I think that there\u0027s still value in consolidating a single txn in OVN anyways.","commit_id":"4ac41b6ad8294c0325c3c67c085116d020f6ac58"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"c6c917b6ba2457943ef36e7c2a973564a99d294f","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                        port_id\u003dport.port_id,"},{"line_number":64,"context_line":"                        host\u003dbinding.host)"},{"line_number":65,"context_line":"                t \u003d self.plugin_driver._nb_ovn.transaction"},{"line_number":66,"context_line":"                with t(check_error\u003dTrue) as txn:"},{"line_number":67,"context_line":"                    txn.add(self.plugin_driver._nb_ovn.set_lswitch_port("},{"line_number":68,"context_line":"                            lport_name\u003dport.port_id,"},{"line_number":69,"context_line":"                            parent_name\u003dparent_port,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_78279013","line":66,"range":{"start_line":66,"start_character":0,"end_line":66,"end_character":48},"in_reply_to":"7faddb67_827d60e7","updated":"2019-09-05 09:33:14.000000000","message":"Done","commit_id":"4ac41b6ad8294c0325c3c67c085116d020f6ac58"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9558df1654b7cdaa13799a4b7a58541529bae371","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                        port_id\u003dport.port_id,"},{"line_number":64,"context_line":"                        host\u003dbinding.host)"},{"line_number":65,"context_line":"                t \u003d self.plugin_driver._nb_ovn.transaction"},{"line_number":66,"context_line":"                with t(check_error\u003dTrue) as txn:"},{"line_number":67,"context_line":"                    txn.add(self.plugin_driver._nb_ovn.set_lswitch_port("},{"line_number":68,"context_line":"                            lport_name\u003dport.port_id,"},{"line_number":69,"context_line":"                            parent_name\u003dparent_port,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_2eeb3da4","line":66,"range":{"start_line":66,"start_character":0,"end_line":66,"end_character":48},"in_reply_to":"7faddb67_e808bdd9","updated":"2019-09-03 13:20:32.000000000","message":"Yes, I asked about this because it is inside a loop and you were creating one transaction per iteration which is the same as now.\n\nI\u0027m sorry I should\u0027ve been more clear but what I meant in reality is to open a context manager before L48 and create just one single transaction for all the subports vs 1 per subport.\n\nDoes it make sense?","commit_id":"4ac41b6ad8294c0325c3c67c085116d020f6ac58"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bacec580a426a1982d8ad26e93907dbf7516bee0","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                            parent_name\u003dparent_port,"},{"line_number":70,"context_line":"                            tag\u003dport.segmentation_id))"},{"line_number":71,"context_line":"            except (os_db_exc.DBReferenceError, n_exc.PortNotFound,"},{"line_number":72,"context_line":"                    n_exc.ObjectNotFound):"},{"line_number":73,"context_line":"                LOG.debug(\"Port not found while trying to set \""},{"line_number":74,"context_line":"                          \"binding_profile: %s\", port.port_id)"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_66a20ab0","line":72,"range":{"start_line":72,"start_character":20,"end_line":72,"end_character":40},"updated":"2019-08-28 13:59:06.000000000","message":"Shouldn\u0027t this be enough and the try block wrapping only update_object()? Other commands don\u0027t raise any of these exceptions, or do they?","commit_id":"4ac41b6ad8294c0325c3c67c085116d020f6ac58"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"de210441caa93a65eb828d20b285e39d8d1a8153","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                            parent_name\u003dparent_port,"},{"line_number":70,"context_line":"                            tag\u003dport.segmentation_id))"},{"line_number":71,"context_line":"            except (os_db_exc.DBReferenceError, n_exc.PortNotFound,"},{"line_number":72,"context_line":"                    n_exc.ObjectNotFound):"},{"line_number":73,"context_line":"                LOG.debug(\"Port not found while trying to set \""},{"line_number":74,"context_line":"                          \"binding_profile: %s\", port.port_id)"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_c8baa1df","line":72,"range":{"start_line":72,"start_character":20,"end_line":72,"end_character":40},"in_reply_to":"7faddb67_66a20ab0","updated":"2019-09-03 11:55:25.000000000","message":"Only port_obj.PortBinding.update_object() raise this. So I can wrap only this command and do early exit in case of missing object. Thanks","commit_id":"4ac41b6ad8294c0325c3c67c085116d020f6ac58"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"45bce03ff9f40fbf6d0d8fdaa0fb02ceffc11018","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    def _unset_binding_profile(self, subport, ovn_txn):"},{"line_number":88,"context_line":"        db_port \u003d port_obj.Port.get_object(self.context, id\u003dsubport.port_id)"},{"line_number":89,"context_line":"        if not db_port:"},{"line_number":90,"context_line":"            LOG.debug(\"Port not found while trying to set \""},{"line_number":91,"context_line":"                      \"binding_profile: %s\","},{"line_number":92,"context_line":"                      subport.port_id)"},{"line_number":93,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":10,"id":"5faad753_2abb8572","line":90,"range":{"start_line":90,"start_character":54,"end_line":90,"end_character":57},"updated":"2019-09-10 19:01:51.000000000","message":"nit: unset","commit_id":"db7faa486c086cea13dea9e142bedfed800e56da"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"45bce03ff9f40fbf6d0d8fdaa0fb02ceffc11018","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                    self.context, port_id\u003dsubport.port_id, host\u003dbinding.host)"},{"line_number":109,"context_line":"        except (os_db_exc.DBReferenceError, n_exc.PortNotFound,"},{"line_number":110,"context_line":"                n_exc.ObjectNotFound):"},{"line_number":111,"context_line":"            LOG.debug(\"Port not found while trying to set \""},{"line_number":112,"context_line":"                      \"binding_profile: %s\", subport.port_id)"},{"line_number":113,"context_line":"            return"},{"line_number":114,"context_line":"        ovn_txn.add(self.plugin_driver._nb_ovn.set_lswitch_port("}],"source_content_type":"text/x-python","patch_set":10,"id":"5faad753_eaac8d36","line":111,"range":{"start_line":111,"start_character":54,"end_line":111,"end_character":57},"updated":"2019-09-10 19:01:51.000000000","message":"nit: unset","commit_id":"db7faa486c086cea13dea9e142bedfed800e56da"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"0b4c5d8c6e662ca0c366cb933a5626e73a482835","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        self.context \u003d n_context.get_admin_context()"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def _set_sub_ports(self, parent_port, subports):"},{"line_number":47,"context_line":"        t \u003d self.plugin_driver._nb_ovn.transaction"},{"line_number":48,"context_line":"        with self.context.session.begin(subtransactions\u003dTrue), ("},{"line_number":49,"context_line":"                t(check_error\u003dTrue)) as ovn_txn:"},{"line_number":50,"context_line":"            for port in subports:"}],"source_content_type":"text/x-python","patch_set":12,"id":"5faad753_f7e78ce3","line":47,"range":{"start_line":47,"start_character":8,"end_line":47,"end_character":9},"updated":"2019-09-11 09:03:47.000000000","message":"I tend to avoid single letter variables except for iterators. txn would be much better :)","commit_id":"fc899eeb55c74a955185edd5251f6e83044cb8b0"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"d247fc002fc82d7b31d28eac12d731805644fee1","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        self.context \u003d n_context.get_admin_context()"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def _set_sub_ports(self, parent_port, subports):"},{"line_number":47,"context_line":"        t \u003d self.plugin_driver._nb_ovn.transaction"},{"line_number":48,"context_line":"        with self.context.session.begin(subtransactions\u003dTrue), ("},{"line_number":49,"context_line":"                t(check_error\u003dTrue)) as ovn_txn:"},{"line_number":50,"context_line":"            for port in subports:"}],"source_content_type":"text/x-python","patch_set":12,"id":"5faad753_9772d810","line":47,"range":{"start_line":47,"start_character":8,"end_line":47,"end_character":9},"in_reply_to":"5faad753_f7e78ce3","updated":"2019-09-11 09:08:06.000000000","message":"done","commit_id":"fc899eeb55c74a955185edd5251f6e83044cb8b0"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"0b4c5d8c6e662ca0c366cb933a5626e73a482835","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                self._set_binding_profile(port, parent_port, ovn_txn)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def _unset_sub_ports(self, subports):"},{"line_number":54,"context_line":"        t \u003d self.plugin_driver._nb_ovn.transaction"},{"line_number":55,"context_line":"        with self.context.session.begin(subtransactions\u003dTrue), ("},{"line_number":56,"context_line":"                t(check_error\u003dTrue)) as ovn_txn:"},{"line_number":57,"context_line":"            for port in subports:"}],"source_content_type":"text/x-python","patch_set":12,"id":"5faad753_17eb48b0","line":54,"range":{"start_line":54,"start_character":8,"end_line":54,"end_character":9},"updated":"2019-09-11 09:03:47.000000000","message":"ditto","commit_id":"fc899eeb55c74a955185edd5251f6e83044cb8b0"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"d247fc002fc82d7b31d28eac12d731805644fee1","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                self._set_binding_profile(port, parent_port, ovn_txn)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def _unset_sub_ports(self, subports):"},{"line_number":54,"context_line":"        t \u003d self.plugin_driver._nb_ovn.transaction"},{"line_number":55,"context_line":"        with self.context.session.begin(subtransactions\u003dTrue), ("},{"line_number":56,"context_line":"                t(check_error\u003dTrue)) as ovn_txn:"},{"line_number":57,"context_line":"            for port in subports:"}],"source_content_type":"text/x-python","patch_set":12,"id":"5faad753_f75c6c7f","line":54,"range":{"start_line":54,"start_character":8,"end_line":54,"end_character":9},"in_reply_to":"5faad753_17eb48b0","updated":"2019-09-11 09:08:06.000000000","message":"done","commit_id":"fc899eeb55c74a955185edd5251f6e83044cb8b0"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"2f315942267d250806bd1519ed8a15a96fcc4b53","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                    self.context, {\u0027profile\u0027: binding.profile},"},{"line_number":75,"context_line":"                    port_id\u003dsubport.port_id,"},{"line_number":76,"context_line":"                    host\u003dbinding.host)"},{"line_number":77,"context_line":"        except (os_db_exc.DBReferenceError, n_exc.PortNotFound,"},{"line_number":78,"context_line":"                n_exc.ObjectNotFound):"},{"line_number":79,"context_line":"            LOG.debug(\"Port not found while trying to set \""},{"line_number":80,"context_line":"                      \"binding_profile: %s\", subport.port_id)"}],"source_content_type":"text/x-python","patch_set":13,"id":"5faad753_f58c09d8","line":77,"range":{"start_line":77,"start_character":16,"end_line":77,"end_character":63},"updated":"2019-09-16 09:38:19.000000000","message":"I think my comment in PS6 was not clear - I asked whether ObjectNotFound is all we need to catch meaning that we no longer can get DBReferenceError or PortNotFound because that\u0027s all encapsulated in the port OVO.","commit_id":"5a3784bcd671cba3fa32a3ecf7f9c55b64dbf0c4"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"19665940f15526f22aff8b1a0a2a21ee04dbc95b","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                    self.context, {\u0027profile\u0027: binding.profile},"},{"line_number":75,"context_line":"                    port_id\u003dsubport.port_id,"},{"line_number":76,"context_line":"                    host\u003dbinding.host)"},{"line_number":77,"context_line":"        except (os_db_exc.DBReferenceError, n_exc.PortNotFound,"},{"line_number":78,"context_line":"                n_exc.ObjectNotFound):"},{"line_number":79,"context_line":"            LOG.debug(\"Port not found while trying to set \""},{"line_number":80,"context_line":"                      \"binding_profile: %s\", subport.port_id)"}],"source_content_type":"text/x-python","patch_set":13,"id":"5faad753_dd6ed3c7","line":77,"range":{"start_line":77,"start_character":16,"end_line":77,"end_character":63},"in_reply_to":"5faad753_f58c09d8","updated":"2019-09-16 09:48:08.000000000","message":"Yep, those two are not needed because we update the db only now. Dropping those. jlibosvar++","commit_id":"5a3784bcd671cba3fa32a3ecf7f9c55b64dbf0c4"}]}
