)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"cdcef6e2d8c04d94652820deb8e9bb286e1c4f6e","unresolved":false,"context_lines":[{"line_number":14,"context_line":"that importing ovsdb_monitor in any other process( like Octavia )"},{"line_number":15,"context_line":"does not cause any duplicate configuration issues."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"ToDo: Functional Test"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Closes-Bug: #1794260"},{"line_number":20,"context_line":"Change-Id: Ie3e0904436536076b045a2d663f5afb5bfc9dc0c"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"3f79a3b5_f7db7a49","line":17,"range":{"start_line":17,"start_character":0,"end_line":17,"end_character":21},"updated":"2018-10-30 12:31:13.000000000","message":"++","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"1457f42c7744171c1f624729aa6c0a0709bb42be","unresolved":false,"context_lines":[{"line_number":15,"context_line":"does not cause any duplicate configuration issues."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"ToDo:"},{"line_number":18,"context_line":"a) Functional Test - In Progress"},{"line_number":19,"context_line":"b) Documentation - Updated in the comments section in OVN Driver"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Closes-Bug: #1794260"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":24,"id":"3f79a3b5_f2c50890","line":18,"range":{"start_line":18,"start_character":0,"end_line":18,"end_character":32},"updated":"2018-11-26 15:13:41.000000000","message":"Thanks, we need those otherwise we won\u0027t be able to merge the patch due to the gate failures","commit_id":"4939db5752fb2a3789fd0261a9181ee1be4e219d"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"b3aa1d463fe4f7cb5a8af26ccd0d16791f44bd76","unresolved":false,"context_lines":[{"line_number":15,"context_line":"does not cause any duplicate configuration issues."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"ToDo:"},{"line_number":18,"context_line":"a) Functional Test - In Progress"},{"line_number":19,"context_line":"b) Documentation - Updated in the comments section in OVN Driver"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Closes-Bug: #1794260"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":24,"id":"3f79a3b5_7e621743","line":18,"range":{"start_line":18,"start_character":0,"end_line":18,"end_character":32},"in_reply_to":"3f79a3b5_f2c50890","updated":"2018-11-27 10:36:12.000000000","message":"Actually , the FT is already completed from my side, need to see why it fails though","commit_id":"4939db5752fb2a3789fd0261a9181ee1be4e219d"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"d564d0bda0747cac0f5a941dc5d2a613c49d0247","unresolved":false,"context_lines":[{"line_number":17,"context_line":"- Setting up events for Router interface addition and deletion"},{"line_number":18,"context_line":"- Updating Loadbalancer tables and Router/Switch tables based"},{"line_number":19,"context_line":"  upon the generated events."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Closes-Bug: #1794260"},{"line_number":22,"context_line":"Change-Id: Ie3e0904436536076b045a2d663f5afb5bfc9dc0c"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":61,"id":"ffb9cba7_7b13dd0e","line":20,"updated":"2019-04-22 10:21:43.000000000","message":"All the changes that Terry made at [0] deserve at least a \u0027Co-Authored-By\u0027 :)\n\n[0] https://review.opendev.org/#/c/653846/","commit_id":"134f79b217c12053a51af9a2564b73d0b14cfe71"}],"doc/source/contributor/design/loadbalancer.rst":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"0b00c4b9620a951c92477b7bf5c683a014b41084","unresolved":false,"context_lines":[{"line_number":262,"context_line":"  to the router R1, then R1 will have both LoadBalancers LB1 and LB2. N1 and"},{"line_number":263,"context_line":"  N2 will also have both the LoadBalancers associated to them. However, kindly"},{"line_number":264,"context_line":"  note that though network N1 would have both LB1 and LB2 loadbalancers"},{"line_number":265,"context_line":"  associated with it, only LB1 would be the loadbalancer which has a direct"},{"line_number":266,"context_line":"  reference to the network N1, since LB1 was created on N1. This is visible"},{"line_number":267,"context_line":"  in the ``ls_ref`` key of the ``external_ids`` column in LB1\u0027s entry in"},{"line_number":268,"context_line":"  the ``load_balancer`` table."}],"source_content_type":"text/x-rst","patch_set":60,"id":"3fce034c_232f0ef7","line":265,"range":{"start_line":265,"start_character":44,"end_line":265,"end_character":56},"updated":"2019-04-17 08:46:32.000000000","message":"nit: LoadBalancer to be consistent with the rest of the document","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b1ef3902f344814e455a8ed93f650e6966f569c0","unresolved":false,"context_lines":[{"line_number":262,"context_line":"  to the router R1, then R1 will have both LoadBalancers LB1 and LB2. N1 and"},{"line_number":263,"context_line":"  N2 will also have both the LoadBalancers associated to them. However, kindly"},{"line_number":264,"context_line":"  note that though network N1 would have both LB1 and LB2 loadbalancers"},{"line_number":265,"context_line":"  associated with it, only LB1 would be the loadbalancer which has a direct"},{"line_number":266,"context_line":"  reference to the network N1, since LB1 was created on N1. This is visible"},{"line_number":267,"context_line":"  in the ``ls_ref`` key of the ``external_ids`` column in LB1\u0027s entry in"},{"line_number":268,"context_line":"  the ``load_balancer`` table."}],"source_content_type":"text/x-rst","patch_set":60,"id":"3fce034c_0ed79925","line":265,"range":{"start_line":265,"start_character":44,"end_line":265,"end_character":56},"in_reply_to":"3fce034c_232f0ef7","updated":"2019-04-17 15:13:45.000000000","message":"aaah, this one got out","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"}],"networking_ovn/common/constants.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"826074579e84b19879e2ed6787e38c2cb07db688","unresolved":false,"context_lines":[{"line_number":155,"context_line":"# Loadbalancer constants"},{"line_number":156,"context_line":"NEUTRON_NET_NAME \u003d \"neutron:network_name\""},{"line_number":157,"context_line":"NEUTRON_ROUTER_NAME \u003d \"neutron:router_name\""},{"line_number":158,"context_line":"LRP_NAME \u003d \"lrp-\""},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"# Hash Ring constants"},{"line_number":161,"context_line":"HASH_RING_NODES_TIMEOUT \u003d 60"}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_2be94519","line":158,"range":{"start_line":158,"start_character":0,"end_line":158,"end_character":17},"updated":"2019-06-21 09:24:33.000000000","message":"nit: perhaps we can update [0] to use this as well\n\n[0] https://github.com/openstack/networking-ovn/blob/96683a265d27f073c926fb56a39cc5bb63a131ed/networking_ovn/common/utils.py#L57","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"774a6ae131605f4b66853ba91b80651e98887e83","unresolved":false,"context_lines":[{"line_number":155,"context_line":"# Loadbalancer constants"},{"line_number":156,"context_line":"NEUTRON_NET_NAME \u003d \"neutron:network_name\""},{"line_number":157,"context_line":"NEUTRON_ROUTER_NAME \u003d \"neutron:router_name\""},{"line_number":158,"context_line":"LRP_NAME \u003d \"lrp-\""},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"# Hash Ring constants"},{"line_number":161,"context_line":"HASH_RING_NODES_TIMEOUT \u003d 60"}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_6c274114","line":158,"range":{"start_line":158,"start_character":0,"end_line":158,"end_character":17},"in_reply_to":"9fb8cfa7_2be94519","updated":"2019-06-24 06:57:37.000000000","message":"Done","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"}],"networking_ovn/octavia/ovn_driver.py":[{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"99707e924a65576947436c0a993c05e184770445","unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    SCHEMA \u003d \"OVN_NorthBound\""},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def __init__(self, events\u003dNone):"},{"line_number":233,"context_line":"        connection_string \u003d ovn_cfg.get_ovn_nb_connection()"},{"line_number":234,"context_line":"        helper \u003d self._get_ovsdb_helper(connection_string)"},{"line_number":235,"context_line":"        tables \u003d (\u0027Logical_Router_Port\u0027, \u0027Logical_Switch_Port\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_ada9ea8f","line":232,"updated":"2018-10-09 07:37:03.000000000","message":"There is no need to create another connection to the IDL and there is no need to start a new thread for this.\n\nExisting OvnProviderHelper thread is enough. You just need to register the required events with ovsdbapp and it will give a call back when the event happens.","commit_id":"6a7e837a56db288a58028a9d99dac712a4ca8ad0"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"dde315f0084b7b35ddcf2d9dbbd1faee4c2c9c3b","unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    SCHEMA \u003d \"OVN_NorthBound\""},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def __init__(self, events\u003dNone):"},{"line_number":233,"context_line":"        connection_string \u003d ovn_cfg.get_ovn_nb_connection()"},{"line_number":234,"context_line":"        helper \u003d self._get_ovsdb_helper(connection_string)"},{"line_number":235,"context_line":"        tables \u003d (\u0027Logical_Router_Port\u0027, \u0027Logical_Switch_Port\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_f7dab373","line":232,"in_reply_to":"3f79a3b5_0e56d52c","updated":"2018-10-16 09:49:10.000000000","message":"After debugging and reading more thoroughy, ovn_driver is part of","commit_id":"6a7e837a56db288a58028a9d99dac712a4ca8ad0"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9dc114b297dd2803f8278901e70c5c1bbf0eb5de","unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    SCHEMA \u003d \"OVN_NorthBound\""},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def __init__(self, events\u003dNone):"},{"line_number":233,"context_line":"        connection_string \u003d ovn_cfg.get_ovn_nb_connection()"},{"line_number":234,"context_line":"        helper \u003d self._get_ovsdb_helper(connection_string)"},{"line_number":235,"context_line":"        tables \u003d (\u0027Logical_Router_Port\u0027, \u0027Logical_Switch_Port\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_0e56d52c","line":232,"in_reply_to":"3f79a3b5_ada9ea8f","updated":"2018-10-09 09:26:09.000000000","message":"oh ++!! new connections are really expensive!","commit_id":"6a7e837a56db288a58028a9d99dac712a4ca8ad0"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"19a6d199d2a4c486a532ec315c1486f8da1f2202","unresolved":false,"context_lines":[{"line_number":244,"context_line":"            self.driver._execute_commands(commands)"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"class OvnNbIdlForLb(ovsdb_monitor.OvnIdl):"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    SCHEMA \u003d \"OVN_Northbound\""},{"line_number":250,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_54821a01","line":247,"range":{"start_line":247,"start_character":6,"end_line":247,"end_character":19},"updated":"2018-10-09 10:27:24.000000000","message":"This looks much better now but I think I\u0027d go and initiate the connection in the start method. Otherwise this looks weird as you\u0027ll be calling start() but it\u0027s basically returning the IDL no? Let\u0027s see what others think though!","commit_id":"719a8f5441b011391ce6e9745768028641ab5509"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"67e56e0df3f6506ebec449869e8cad9aa67ab029","unresolved":false,"context_lines":[{"line_number":261,"context_line":"    def _get_ovsdb_helper(self, connection_string):"},{"line_number":262,"context_line":"        return idlutils.get_schema_helper(connection_string, self.SCHEMA)"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def start(self):"},{"line_number":265,"context_line":"        ovsdb_monitor._check_and_set_ssl_files(self.SCHEMA)"},{"line_number":266,"context_line":"        return idl_ovn.OvsdbNbOvnIdl(self.conn)"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"class OvnProviderHelper(object):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_d46cea34","line":266,"range":{"start_line":264,"start_character":0,"end_line":266,"end_character":47},"updated":"2018-10-09 10:36:51.000000000","message":"I tend to agree with Daniel about starting the connection. Is this start() being used anywhere ?","commit_id":"719a8f5441b011391ce6e9745768028641ab5509"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"dde315f0084b7b35ddcf2d9dbbd1faee4c2c9c3b","unresolved":false,"context_lines":[{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    def start(self):"},{"line_number":272,"context_line":"        return idl_ovn.OvnNbApiIdlImpl("},{"line_number":273,"context_line":"            ovn_utils.get_ovsdb_connection(self.conn_string, self.SCHEMA,"},{"line_number":274,"context_line":"                                           ovn_cfg.get_ovn_ovsdb_timeout(),"},{"line_number":275,"context_line":"                                           tables\u003dself.tables))"},{"line_number":276,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_570847d6","line":273,"updated":"2018-10-16 09:49:10.000000000","message":"If you do this, it will instantiate a new IDL (and open a *new* connection) thus a new helper and not the \u0027self.notify_handler\u0027 object so you won\u0027t get the notifications.\n\nAs ovn_driver is part of uwsgi process (ie. not part of neutron-server) is totally ok to open a new connection to OVSDB from here but then use this code:\n\n\n     def start(self):\n+        self.conn \u003d connection.Connection(self, timeout\u003d180)\n+        return idl_ovn.OvnNbApiIdlImpl(self.conn)","commit_id":"67b1c3bf4cb8d1ca35cec98d70794cfcf0251838"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"de0d95553df5d3f8d21f54eef968f3ca8a1d0b42","unresolved":false,"context_lines":[{"line_number":37,"context_line":"from networking_ovn._i18n import _"},{"line_number":38,"context_line":"from networking_ovn.common import config as ovn_cfg"},{"line_number":39,"context_line":"from networking_ovn.common import utils as ovn_utils"},{"line_number":40,"context_line":"from networking_ovn.ovsdb.ovsdb_monitor import OvnIdl"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"import tenacity"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_559d74b8","line":40,"updated":"2018-10-31 08:01:50.000000000","message":"You are importing only class here. Will pep/flake8 be happy with it ?\nI would prefer to import the module and use the class as ovsdb_monitor.OvnIdl","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"50771d0022346eb0d8b82f0f73f9cc803dbefce4","unresolved":false,"context_lines":[{"line_number":37,"context_line":"from networking_ovn._i18n import _"},{"line_number":38,"context_line":"from networking_ovn.common import config as ovn_cfg"},{"line_number":39,"context_line":"from networking_ovn.common import utils as ovn_utils"},{"line_number":40,"context_line":"from networking_ovn.ovsdb.ovsdb_monitor import OvnIdl"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"import tenacity"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_3bd22961","line":40,"in_reply_to":"3f79a3b5_559d74b8","updated":"2018-10-31 08:56:16.000000000","message":"+1\n\nfrom networking_ovn.ovsdb import ovsdb_monitor\n\novsdb_monitor.OvnIdl","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5d94adefd352be119cc144f06582a562c9924622","unresolved":false,"context_lines":[{"line_number":37,"context_line":"from networking_ovn._i18n import _"},{"line_number":38,"context_line":"from networking_ovn.common import config as ovn_cfg"},{"line_number":39,"context_line":"from networking_ovn.common import utils as ovn_utils"},{"line_number":40,"context_line":"from networking_ovn.ovsdb.ovsdb_monitor import OvnIdl"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"import tenacity"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_bb81594f","line":40,"in_reply_to":"3f79a3b5_559d74b8","updated":"2018-10-31 10:28:36.000000000","message":"Done","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"de0d95553df5d3f8d21f54eef968f3ca8a1d0b42","unresolved":false,"context_lines":[{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def run(self, event, row, old):"},{"line_number":216,"context_line":"        if not self.driver:"},{"line_number":217,"context_line":"            pass"},{"line_number":218,"context_line":"        else:"},{"line_number":219,"context_line":"            if not row.gateway_chassis:"},{"line_number":220,"context_line":"                # Ignore any gateway_chassis port"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_f5584026","line":217,"updated":"2018-10-31 08:01:50.000000000","message":"It would be easier to have something like below\n\nif self.driver and not row.gateway_chassis:\n  ....\n\nOr if you want\n\nif not self.driver:\n    return\nif not row.gateway_chassis:\n    self.driver.event....","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"6058a4a3e135b2173f9b87ec8ddf7b9466cb3e4d","unresolved":false,"context_lines":[{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def run(self, event, row, old):"},{"line_number":216,"context_line":"        if not self.driver:"},{"line_number":217,"context_line":"            pass"},{"line_number":218,"context_line":"        else:"},{"line_number":219,"context_line":"            if not row.gateway_chassis:"},{"line_number":220,"context_line":"                # Ignore any gateway_chassis port"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_9bca5da1","line":217,"in_reply_to":"3f79a3b5_f5584026","updated":"2018-10-31 08:56:22.000000000","message":"++","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5d94adefd352be119cc144f06582a562c9924622","unresolved":false,"context_lines":[{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def run(self, event, row, old):"},{"line_number":216,"context_line":"        if not self.driver:"},{"line_number":217,"context_line":"            pass"},{"line_number":218,"context_line":"        else:"},{"line_number":219,"context_line":"            if not row.gateway_chassis:"},{"line_number":220,"context_line":"                # Ignore any gateway_chassis port"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_db89b570","line":217,"in_reply_to":"3f79a3b5_f5584026","updated":"2018-10-31 10:28:36.000000000","message":"So you just want me to remove the else :)\nDone... this is actually what I wanted from you guys, things which can be optimized, without erring on the code :D","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"de0d95553df5d3f8d21f54eef968f3ca8a1d0b42","unresolved":false,"context_lines":[{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    def run(self, event, row, old):"},{"line_number":240,"context_line":"        if not self.driver:"},{"line_number":241,"context_line":"            pass"},{"line_number":242,"context_line":"        else:"},{"line_number":243,"context_line":"            if \u0027router\u0027 in row.addresses:"},{"line_number":244,"context_line":"                # Ignore any port which is not a part of router"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_b59888cb","line":241,"updated":"2018-10-31 08:01:50.000000000","message":"Same as above. I don\u0027t know if it\u0027s good to use pass","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"50771d0022346eb0d8b82f0f73f9cc803dbefce4","unresolved":false,"context_lines":[{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    def run(self, event, row, old):"},{"line_number":240,"context_line":"        if not self.driver:"},{"line_number":241,"context_line":"            pass"},{"line_number":242,"context_line":"        else:"},{"line_number":243,"context_line":"            if \u0027router\u0027 in row.addresses:"},{"line_number":244,"context_line":"                # Ignore any port which is not a part of router"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_fbb4b11f","line":241,"in_reply_to":"3f79a3b5_b59888cb","updated":"2018-10-31 08:56:16.000000000","message":"+1, return or just change it as\n\nif self.driver:\n   ......","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5d94adefd352be119cc144f06582a562c9924622","unresolved":false,"context_lines":[{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    def run(self, event, row, old):"},{"line_number":240,"context_line":"        if not self.driver:"},{"line_number":241,"context_line":"            pass"},{"line_number":242,"context_line":"        else:"},{"line_number":243,"context_line":"            if \u0027router\u0027 in row.addresses:"},{"line_number":244,"context_line":"                # Ignore any port which is not a part of router"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_9b99fd81","line":241,"in_reply_to":"3f79a3b5_b59888cb","updated":"2018-10-31 10:28:36.000000000","message":"Done","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"de0d95553df5d3f8d21f54eef968f3ca8a1d0b42","unresolved":false,"context_lines":[{"line_number":335,"context_line":"        LogicalSwitchPortEvent.set_driver(self)"},{"line_number":336,"context_line":"        self.helper_thread.start()"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def event_request_handler(self, row, old, delete\u003dFalse):"},{"line_number":339,"context_line":"        router \u003d network \u003d None"},{"line_number":340,"context_line":"        commands \u003d []"},{"line_number":341,"context_line":"        if not delete:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_60a310b2","line":338,"updated":"2018-10-31 08:01:50.000000000","message":"I still need to review this function thoroughly.\nFew comments from what I have understood. This function is quite complicated. I understand that to address the patch requirements, the code will be complicated. But can we try to simplify a bit by dividing the functionality into small functions and adding some code comments.\n\nI would suggest to have different function for each event if it\u0027s possible - like - lrp_add_event_hander, lrp_update_event_handler,  lsp_delete_event_handler (please choose an appropriate name). Is that possible ? Thoughts ?","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"6058a4a3e135b2173f9b87ec8ddf7b9466cb3e4d","unresolved":false,"context_lines":[{"line_number":335,"context_line":"        LogicalSwitchPortEvent.set_driver(self)"},{"line_number":336,"context_line":"        self.helper_thread.start()"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def event_request_handler(self, row, old, delete\u003dFalse):"},{"line_number":339,"context_line":"        router \u003d network \u003d None"},{"line_number":340,"context_line":"        commands \u003d []"},{"line_number":341,"context_line":"        if not delete:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_9b2fbd56","line":338,"in_reply_to":"3f79a3b5_60a310b2","updated":"2018-10-31 08:56:22.000000000","message":"Given that we already have separated events handlers for the different actions (create + update and delete) I think it does make sense to keep it separated as well to improve readability.","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5d94adefd352be119cc144f06582a562c9924622","unresolved":false,"context_lines":[{"line_number":335,"context_line":"        LogicalSwitchPortEvent.set_driver(self)"},{"line_number":336,"context_line":"        self.helper_thread.start()"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def event_request_handler(self, row, old, delete\u003dFalse):"},{"line_number":339,"context_line":"        router \u003d network \u003d None"},{"line_number":340,"context_line":"        commands \u003d []"},{"line_number":341,"context_line":"        if not delete:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_3b4b09b3","line":338,"in_reply_to":"3f79a3b5_60a310b2","updated":"2018-10-31 10:28:36.000000000","message":"Tried it","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"bffccc6e815f16c61a050f9b12fb1d65cfb6e49a","unresolved":false,"context_lines":[{"line_number":336,"context_line":"        self.helper_thread.start()"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def event_request_handler(self, row, old, delete\u003dFalse):"},{"line_number":339,"context_line":"        router \u003d network \u003d None"},{"line_number":340,"context_line":"        commands \u003d []"},{"line_number":341,"context_line":"        if not delete:"},{"line_number":342,"context_line":"            for lr in self.ovn_nbdb_api.tables["}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_dbb0d544","line":339,"updated":"2018-10-31 08:47:39.000000000","message":"I think it would be nice, if you can also document or add comments about the various cases in which event handler comes into picture.\n\nI think your patch should handle the below cases\n\nCase 1.\n-------\nUser has created a network n1 and associated a load balancer lb1 to it. The user has not yet created any router. \nNow user creates a router r1 and attaches n1 to r1. The event handler should associate lb1 to r1. It should also store the reference count in the lb.external_ids, so that if the user deletes lb1, it should cleanup everything.\n\n\nCase 2:\n------\nUser has created a network n1, n2, r1 and then creates a load balancer lb1. In this case, the load balancer APIs should handle everything and the eventhandler doesn\u0027t come into picture. And later, user creates a network n3 and associates to r1. The event handler should associate lb1 to n3.\n\nCase 3:\n-------\nLet\u0027s assume case 2 example. Now user removes n2 from r1. In this case, event handler should not do anything.\nNow user removes n3 from r1. The event handler should not do anything. User now removes n1 from r1. Then the event handler should disassociate lb1 from r1. In short, when a logical router port is deleted from a router, only disassociate if the router has only one router port which is getting deleted. Let me know if this doesn\u0027t make sense.\n\nBased on the above cases, I would have logical something like this\n\nRouter port created/updated.\n - Get the router object (lr) from the router port\n - Get the logical switch (ls) object from the router port\u0027s peer.\n\n - Then :\n\nif lr.lb is None: # Case 1\n   if ls.lb is not None:\n       lr_lb_add(lr, lb)\nelse:\n   if ls.lb is None: # Case 2\n       ls_lb_add(ls, lb)\n\n\nRouter port deleted:\n------------------\n - Get the router object (lr) from the router port\n  - if len(lr.router_ports) \u003d\u003d 0: # Case 3\n       lr_lb_del(lr, lb)\n    else:\n        # Don\u0027t do anything.\n\n\nI don\u0027t think the event handler should do more than that. I mean this is what I could think off. Let me know your thoughts and correct me if I am wrong or add other scenarios which I have missed.","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"cdcef6e2d8c04d94652820deb8e9bb286e1c4f6e","unresolved":false,"context_lines":[{"line_number":341,"context_line":"        if not delete:"},{"line_number":342,"context_line":"            for lr in self.ovn_nbdb_api.tables["},{"line_number":343,"context_line":"                \u0027Logical_Router\u0027].rows.values():"},{"line_number":344,"context_line":"                if \"neutron-\" + row.external_ids.get("},{"line_number":345,"context_line":"                    NEUTRON_ROUTER_NAME) \u003d\u003d lr.name:"},{"line_number":346,"context_line":"                    router \u003d lr"},{"line_number":347,"context_line":"            for lsp in self.ovn_nbdb_api.tables["},{"line_number":348,"context_line":"                \u0027Logical_Switch_Port\u0027].rows.values():"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_57826e04","line":345,"range":{"start_line":344,"start_character":19,"end_line":345,"end_character":40},"updated":"2018-10-30 12:31:13.000000000","message":"nit:\n\nutils.ovn_name(row.external_ids...)\n\nhttps://github.com/openstack/networking-ovn/blob/d0f3ee2e6df9534f5aa57fc4ae9f0edb45a2fc83/networking_ovn/common/utils.py#L41","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"de0d95553df5d3f8d21f54eef968f3ca8a1d0b42","unresolved":false,"context_lines":[{"line_number":341,"context_line":"        if not delete:"},{"line_number":342,"context_line":"            for lr in self.ovn_nbdb_api.tables["},{"line_number":343,"context_line":"                \u0027Logical_Router\u0027].rows.values():"},{"line_number":344,"context_line":"                if \"neutron-\" + row.external_ids.get("},{"line_number":345,"context_line":"                    NEUTRON_ROUTER_NAME) \u003d\u003d lr.name:"},{"line_number":346,"context_line":"                    router \u003d lr"},{"line_number":347,"context_line":"            for lsp in self.ovn_nbdb_api.tables["},{"line_number":348,"context_line":"                \u0027Logical_Switch_Port\u0027].rows.values():"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_a020489f","line":345,"range":{"start_line":344,"start_character":19,"end_line":345,"end_character":40},"in_reply_to":"3f79a3b5_57826e04","updated":"2018-10-31 08:01:50.000000000","message":"+1\nAlso I would prefer\nif lr.name \u003d\u003d ovn_utils.ovn_name(..):\n   ...","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5d94adefd352be119cc144f06582a562c9924622","unresolved":false,"context_lines":[{"line_number":341,"context_line":"        if not delete:"},{"line_number":342,"context_line":"            for lr in self.ovn_nbdb_api.tables["},{"line_number":343,"context_line":"                \u0027Logical_Router\u0027].rows.values():"},{"line_number":344,"context_line":"                if \"neutron-\" + row.external_ids.get("},{"line_number":345,"context_line":"                    NEUTRON_ROUTER_NAME) \u003d\u003d lr.name:"},{"line_number":346,"context_line":"                    router \u003d lr"},{"line_number":347,"context_line":"            for lsp in self.ovn_nbdb_api.tables["},{"line_number":348,"context_line":"                \u0027Logical_Switch_Port\u0027].rows.values():"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_5be2859e","line":345,"range":{"start_line":344,"start_character":19,"end_line":345,"end_character":40},"in_reply_to":"3f79a3b5_a020489f","updated":"2018-10-31 10:28:36.000000000","message":"Done","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"de0d95553df5d3f8d21f54eef968f3ca8a1d0b42","unresolved":false,"context_lines":[{"line_number":343,"context_line":"                \u0027Logical_Router\u0027].rows.values():"},{"line_number":344,"context_line":"                if \"neutron-\" + row.external_ids.get("},{"line_number":345,"context_line":"                    NEUTRON_ROUTER_NAME) \u003d\u003d lr.name:"},{"line_number":346,"context_line":"                    router \u003d lr"},{"line_number":347,"context_line":"            for lsp in self.ovn_nbdb_api.tables["},{"line_number":348,"context_line":"                \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":349,"context_line":"                if row.name \u003d\u003d \"lrp-\" + str(lsp.name):"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_c0fc640d","line":346,"updated":"2018-10-31 08:01:50.000000000","message":"I think we need a break here once we find the match","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5d94adefd352be119cc144f06582a562c9924622","unresolved":false,"context_lines":[{"line_number":343,"context_line":"                \u0027Logical_Router\u0027].rows.values():"},{"line_number":344,"context_line":"                if \"neutron-\" + row.external_ids.get("},{"line_number":345,"context_line":"                    NEUTRON_ROUTER_NAME) \u003d\u003d lr.name:"},{"line_number":346,"context_line":"                    router \u003d lr"},{"line_number":347,"context_line":"            for lsp in self.ovn_nbdb_api.tables["},{"line_number":348,"context_line":"                \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":349,"context_line":"                if row.name \u003d\u003d \"lrp-\" + str(lsp.name):"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_dbf53554","line":346,"in_reply_to":"3f79a3b5_c0fc640d","updated":"2018-10-31 10:28:36.000000000","message":"Done","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"cdcef6e2d8c04d94652820deb8e9bb286e1c4f6e","unresolved":false,"context_lines":[{"line_number":346,"context_line":"                    router \u003d lr"},{"line_number":347,"context_line":"            for lsp in self.ovn_nbdb_api.tables["},{"line_number":348,"context_line":"                \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":349,"context_line":"                if row.name \u003d\u003d \"lrp-\" + str(lsp.name):"},{"line_number":350,"context_line":"                    for net in self.ovn_nbdb_api.tables["},{"line_number":351,"context_line":"                        \u0027Logical_Switch\u0027].rows.values():"},{"line_number":352,"context_line":"                        if net.name \u003d\u003d lsp.external_ids.get(NEUTRON_NET_NAME):"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_778c4a2d","line":349,"range":{"start_line":349,"start_character":31,"end_line":349,"end_character":53},"updated":"2018-10-30 12:31:13.000000000","message":"nit:\n\novn_lrouter_port_name(lsp.name)\n\nhttps://github.com/openstack/networking-ovn/blob/d0f3ee2e6df9534f5aa57fc4ae9f0edb45a2fc83/networking_ovn/common/utils.py#L50","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"de0d95553df5d3f8d21f54eef968f3ca8a1d0b42","unresolved":false,"context_lines":[{"line_number":346,"context_line":"                    router \u003d lr"},{"line_number":347,"context_line":"            for lsp in self.ovn_nbdb_api.tables["},{"line_number":348,"context_line":"                \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":349,"context_line":"                if row.name \u003d\u003d \"lrp-\" + str(lsp.name):"},{"line_number":350,"context_line":"                    for net in self.ovn_nbdb_api.tables["},{"line_number":351,"context_line":"                        \u0027Logical_Switch\u0027].rows.values():"},{"line_number":352,"context_line":"                        if net.name \u003d\u003d lsp.external_ids.get(NEUTRON_NET_NAME):"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_801f4c59","line":349,"range":{"start_line":349,"start_character":31,"end_line":349,"end_character":53},"in_reply_to":"3f79a3b5_778c4a2d","updated":"2018-10-31 08:01:50.000000000","message":"+1","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5d94adefd352be119cc144f06582a562c9924622","unresolved":false,"context_lines":[{"line_number":346,"context_line":"                    router \u003d lr"},{"line_number":347,"context_line":"            for lsp in self.ovn_nbdb_api.tables["},{"line_number":348,"context_line":"                \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":349,"context_line":"                if row.name \u003d\u003d \"lrp-\" + str(lsp.name):"},{"line_number":350,"context_line":"                    for net in self.ovn_nbdb_api.tables["},{"line_number":351,"context_line":"                        \u0027Logical_Switch\u0027].rows.values():"},{"line_number":352,"context_line":"                        if net.name \u003d\u003d lsp.external_ids.get(NEUTRON_NET_NAME):"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_9b8d7ddc","line":349,"range":{"start_line":349,"start_character":31,"end_line":349,"end_character":53},"in_reply_to":"3f79a3b5_801f4c59","updated":"2018-10-31 10:28:36.000000000","message":"Done","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"de0d95553df5d3f8d21f54eef968f3ca8a1d0b42","unresolved":false,"context_lines":[{"line_number":350,"context_line":"                    for net in self.ovn_nbdb_api.tables["},{"line_number":351,"context_line":"                        \u0027Logical_Switch\u0027].rows.values():"},{"line_number":352,"context_line":"                        if net.name \u003d\u003d lsp.external_ids.get(NEUTRON_NET_NAME):"},{"line_number":353,"context_line":"                            network \u003d net"},{"line_number":354,"context_line":"        else:"},{"line_number":355,"context_line":"            for lr in self.ovn_nbdb_api.tables["},{"line_number":356,"context_line":"                \u0027Logical_Router\u0027].rows.values():"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_200bd823","line":353,"updated":"2018-10-31 08:01:50.000000000","message":"same as L346. We need a break here","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5d94adefd352be119cc144f06582a562c9924622","unresolved":false,"context_lines":[{"line_number":350,"context_line":"                    for net in self.ovn_nbdb_api.tables["},{"line_number":351,"context_line":"                        \u0027Logical_Switch\u0027].rows.values():"},{"line_number":352,"context_line":"                        if net.name \u003d\u003d lsp.external_ids.get(NEUTRON_NET_NAME):"},{"line_number":353,"context_line":"                            network \u003d net"},{"line_number":354,"context_line":"        else:"},{"line_number":355,"context_line":"            for lr in self.ovn_nbdb_api.tables["},{"line_number":356,"context_line":"                \u0027Logical_Router\u0027].rows.values():"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_ad1fe058","line":353,"in_reply_to":"3f79a3b5_200bd823","updated":"2018-10-31 10:28:36.000000000","message":"Done","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"cdcef6e2d8c04d94652820deb8e9bb286e1c4f6e","unresolved":false,"context_lines":[{"line_number":362,"context_line":"                if net.name \u003d\u003d row.external_ids.get(NEUTRON_NET_NAME):"},{"line_number":363,"context_line":"                    network \u003d net"},{"line_number":364,"context_line":"        if router and network:"},{"line_number":365,"context_line":"            router_lb \u003d [str(lb.uuid) for lb in router.load_balancer]"},{"line_number":366,"context_line":"            network_lb \u003d [str(lb.uuid) for lb in network.load_balancer]"},{"line_number":367,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":368,"context_line":"                lb for lb in network.load_balancer]"},{"line_number":369,"context_line":"            if not delete:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_97bd66b4","line":366,"range":{"start_line":365,"start_character":0,"end_line":366,"end_character":71},"updated":"2018-10-30 12:31:13.000000000","message":"Instead of creating a list and then transforming it in a set() at L381, you can just use a set comprehension here, for example:\n\nrouter_lb \u003d {str(lb.uuid) ... }","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5d94adefd352be119cc144f06582a562c9924622","unresolved":false,"context_lines":[{"line_number":362,"context_line":"                if net.name \u003d\u003d row.external_ids.get(NEUTRON_NET_NAME):"},{"line_number":363,"context_line":"                    network \u003d net"},{"line_number":364,"context_line":"        if router and network:"},{"line_number":365,"context_line":"            router_lb \u003d [str(lb.uuid) for lb in router.load_balancer]"},{"line_number":366,"context_line":"            network_lb \u003d [str(lb.uuid) for lb in network.load_balancer]"},{"line_number":367,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":368,"context_line":"                lb for lb in network.load_balancer]"},{"line_number":369,"context_line":"            if not delete:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_ad6da0cc","line":366,"range":{"start_line":365,"start_character":0,"end_line":366,"end_character":71},"in_reply_to":"3f79a3b5_97bd66b4","updated":"2018-10-31 10:28:36.000000000","message":"Done","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"cdcef6e2d8c04d94652820deb8e9bb286e1c4f6e","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                                                  \u0027router_name\u0027: router.name,"},{"line_number":378,"context_line":"                                                  \u0027router_lb\u0027: router_lb})"},{"line_number":379,"context_line":"                # if the network has any loadbalancer not in router lb"},{"line_number":380,"context_line":"                for lb in list("},{"line_number":381,"context_line":"                    set(network_lb) ^ set(router_lb)):"},{"line_number":382,"context_line":"                    if lb not in router_lb:"},{"line_number":383,"context_line":"                        for l in lb_list:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_57feee6d","line":380,"range":{"start_line":380,"start_character":26,"end_line":380,"end_character":31},"updated":"2018-10-30 12:31:13.000000000","message":"You can interact thru a set(). No need to convert it to a list","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5d94adefd352be119cc144f06582a562c9924622","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                                                  \u0027router_name\u0027: router.name,"},{"line_number":378,"context_line":"                                                  \u0027router_lb\u0027: router_lb})"},{"line_number":379,"context_line":"                # if the network has any loadbalancer not in router lb"},{"line_number":380,"context_line":"                for lb in list("},{"line_number":381,"context_line":"                    set(network_lb) ^ set(router_lb)):"},{"line_number":382,"context_line":"                    if lb not in router_lb:"},{"line_number":383,"context_line":"                        for l in lb_list:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_4d62ccdc","line":380,"range":{"start_line":380,"start_character":26,"end_line":380,"end_character":31},"in_reply_to":"3f79a3b5_57feee6d","updated":"2018-10-31 10:28:36.000000000","message":"Done","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"cdcef6e2d8c04d94652820deb8e9bb286e1c4f6e","unresolved":false,"context_lines":[{"line_number":390,"context_line":"                                commands.append(self.ovn_nbdb_api.ls_lb_add("},{"line_number":391,"context_line":"                                    network.uuid, lb))"},{"line_number":392,"context_line":"            else:"},{"line_number":393,"context_line":"                n_lb \u003d [str(l.uuid) for l in network.load_balancer]"},{"line_number":394,"context_line":"                r_lb \u003d [str(r.uuid) for r in router.load_balancer]"},{"line_number":395,"context_line":"                for lb in OvnProviderHelper.lb_info:"},{"line_number":396,"context_line":"                    if lb[\u0027network_name\u0027] \u003d\u003d network.name and lb["},{"line_number":397,"context_line":"                        \u0027router_name\u0027] \u003d\u003d router.name:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_b73d022b","line":394,"range":{"start_line":393,"start_character":0,"end_line":394,"end_character":66},"updated":"2018-10-30 12:31:13.000000000","message":"ditto: re set() comprehension","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"cdcef6e2d8c04d94652820deb8e9bb286e1c4f6e","unresolved":false,"context_lines":[{"line_number":395,"context_line":"                for lb in OvnProviderHelper.lb_info:"},{"line_number":396,"context_line":"                    if lb[\u0027network_name\u0027] \u003d\u003d network.name and lb["},{"line_number":397,"context_line":"                        \u0027router_name\u0027] \u003d\u003d router.name:"},{"line_number":398,"context_line":"                        lb_list \u003d list(set(n_lb) - set(lb[\u0027router_lb\u0027]))"},{"line_number":399,"context_line":"                        # Delete all LB on N/W from Router"},{"line_number":400,"context_line":"                        for lb in lb_list:"},{"line_number":401,"context_line":"                            commands.append(self.ovn_nbdb_api.lr_lb_del("}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_370b327d","line":398,"range":{"start_line":398,"start_character":34,"end_line":398,"end_character":39},"updated":"2018-10-30 12:31:13.000000000","message":"ditto: we don\u0027t need to convert it to a list","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5d94adefd352be119cc144f06582a562c9924622","unresolved":false,"context_lines":[{"line_number":395,"context_line":"                for lb in OvnProviderHelper.lb_info:"},{"line_number":396,"context_line":"                    if lb[\u0027network_name\u0027] \u003d\u003d network.name and lb["},{"line_number":397,"context_line":"                        \u0027router_name\u0027] \u003d\u003d router.name:"},{"line_number":398,"context_line":"                        lb_list \u003d list(set(n_lb) - set(lb[\u0027router_lb\u0027]))"},{"line_number":399,"context_line":"                        # Delete all LB on N/W from Router"},{"line_number":400,"context_line":"                        for lb in lb_list:"},{"line_number":401,"context_line":"                            commands.append(self.ovn_nbdb_api.lr_lb_del("}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_0db13446","line":398,"range":{"start_line":398,"start_character":34,"end_line":398,"end_character":39},"in_reply_to":"3f79a3b5_370b327d","updated":"2018-10-31 10:28:36.000000000","message":"Done","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"cdcef6e2d8c04d94652820deb8e9bb286e1c4f6e","unresolved":false,"context_lines":[{"line_number":401,"context_line":"                            commands.append(self.ovn_nbdb_api.lr_lb_del("},{"line_number":402,"context_line":"                                router.uuid, lb))"},{"line_number":403,"context_line":"                        # Delete all LB on Router from N/W"},{"line_number":404,"context_line":"                        for lb in list(set(r_lb) - set(lb_list)):"},{"line_number":405,"context_line":"                            commands.append(self.ovn_nbdb_api.ls_lb_del("},{"line_number":406,"context_line":"                                network.uuid, lb))"},{"line_number":407,"context_line":"            self._execute_commands(commands)"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_9719e6d3","line":404,"range":{"start_line":404,"start_character":34,"end_line":404,"end_character":39},"updated":"2018-10-30 12:31:13.000000000","message":"ditto: we don\u0027t need to convert it to a list","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5d94adefd352be119cc144f06582a562c9924622","unresolved":false,"context_lines":[{"line_number":401,"context_line":"                            commands.append(self.ovn_nbdb_api.lr_lb_del("},{"line_number":402,"context_line":"                                router.uuid, lb))"},{"line_number":403,"context_line":"                        # Delete all LB on Router from N/W"},{"line_number":404,"context_line":"                        for lb in list(set(r_lb) - set(lb_list)):"},{"line_number":405,"context_line":"                            commands.append(self.ovn_nbdb_api.ls_lb_del("},{"line_number":406,"context_line":"                                network.uuid, lb))"},{"line_number":407,"context_line":"            self._execute_commands(commands)"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_ed81584e","line":404,"range":{"start_line":404,"start_character":34,"end_line":404,"end_character":39},"in_reply_to":"3f79a3b5_9719e6d3","updated":"2018-10-31 10:28:36.000000000","message":"Done","commit_id":"d6cc6ede1fd6a6fd1b1805a5078f56b7451a0f70"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"97dae53505785250a6a10fd7132ba53b35462767","unresolved":false,"context_lines":[{"line_number":538,"context_line":"        )"},{"line_number":539,"context_line":"        for subnet in self._find_ls_subnet_for_lr(ovn_lr.name):"},{"line_number":540,"context_line":"            commands.extend("},{"line_number":541,"context_line":"                self._update_lb_to_ls_association(ovn_lb, subnet_id\u003dsubnet))"},{"line_number":542,"context_line":"        return commands"},{"line_number":543,"context_line":""},{"line_number":544,"context_line":"    def _find_ls_subnet_for_lr(self, lr_name):"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_dcda081b","line":541,"range":{"start_line":541,"start_character":68,"end_line":541,"end_character":74},"updated":"2018-10-31 13:51:35.000000000","message":"@numan: Should I keep associate\u003dTrue here?","commit_id":"a8b1b5738e91d01474d0372d5cd3fe88b8501002"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"97dae53505785250a6a10fd7132ba53b35462767","unresolved":false,"context_lines":[{"line_number":545,"context_line":"        subnet_ids \u003d []"},{"line_number":546,"context_line":"        for port in self.ovn_nbdb_api.tables["},{"line_number":547,"context_line":"            \u0027Logical_Router_Port\u0027].rows.values():"},{"line_number":548,"context_line":"            if \u0027neutron-\u0027 + port.external_ids.get("},{"line_number":549,"context_line":"                NEUTRON_ROUTER_NAME) \u003d\u003d lr_name:"},{"line_number":550,"context_line":"                for ids in str(port.external_ids.get("},{"line_number":551,"context_line":"                    \u0027neutron:subnet_ids\u0027)).split(\u0027 \u0027):"},{"line_number":552,"context_line":"                    subnet_ids.append(ids)"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_1cd080f4","line":549,"range":{"start_line":548,"start_character":15,"end_line":549,"end_character":48},"updated":"2018-10-31 13:51:35.000000000","message":"need to change this to ovn_utils.ovn_name","commit_id":"a8b1b5738e91d01474d0372d5cd3fe88b8501002"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"30877e37939cb13bb44bfaa3ffb7b0dfad6850de","unresolved":false,"context_lines":[{"line_number":223,"context_line":"        LogicalRouterPortEvent.driver \u003d driver"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"class LogicalSwitchPortEvent(row_event.RowEvent):"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    driver \u003d None"},{"line_number":229,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"3f79a3b5_820f1489","line":226,"range":{"start_line":226,"start_character":6,"end_line":226,"end_character":28},"updated":"2018-11-19 10:42:47.000000000","message":"nit: Maybe we should call it something related to Router, since it ignores any other port apart from the router ones (L238)","commit_id":"82c60e74ff45ca243b797a99ebecd57f55f983f7"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"fef904be541cc55aa70b64c0d2f47fb1d60ba0c6","unresolved":false,"context_lines":[{"line_number":223,"context_line":"        LogicalRouterPortEvent.driver \u003d driver"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"class LogicalSwitchPortEvent(row_event.RowEvent):"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    driver \u003d None"},{"line_number":229,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"3f79a3b5_a456b25c","line":226,"range":{"start_line":226,"start_character":6,"end_line":226,"end_character":28},"in_reply_to":"3f79a3b5_820f1489","updated":"2018-11-21 10:25:39.000000000","message":"Well, but it works on the events on Switches, right.. :)","commit_id":"82c60e74ff45ca243b797a99ebecd57f55f983f7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"30877e37939cb13bb44bfaa3ffb7b0dfad6850de","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        LogicalSwitchPortEvent.set_driver(self)"},{"line_number":330,"context_line":"        self.helper_thread.start()"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"    def _notify_add_nw_port_to_router(self, row):"},{"line_number":333,"context_line":"        router \u003d network \u003d None"},{"line_number":334,"context_line":"        for lr in self.ovn_nbdb_api.tables["},{"line_number":335,"context_line":"            \u0027Logical_Router\u0027].rows.values():"}],"source_content_type":"text/x-python","patch_set":21,"id":"3f79a3b5_a26ed02a","line":332,"range":{"start_line":332,"start_character":8,"end_line":332,"end_character":15},"updated":"2018-11-19 10:42:47.000000000","message":"This method is not notifying anything right ?","commit_id":"82c60e74ff45ca243b797a99ebecd57f55f983f7"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"fef904be541cc55aa70b64c0d2f47fb1d60ba0c6","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        LogicalSwitchPortEvent.set_driver(self)"},{"line_number":330,"context_line":"        self.helper_thread.start()"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"    def _notify_add_nw_port_to_router(self, row):"},{"line_number":333,"context_line":"        router \u003d network \u003d None"},{"line_number":334,"context_line":"        for lr in self.ovn_nbdb_api.tables["},{"line_number":335,"context_line":"            \u0027Logical_Router\u0027].rows.values():"}],"source_content_type":"text/x-python","patch_set":21,"id":"3f79a3b5_c45c0e5a","line":332,"range":{"start_line":332,"start_character":8,"end_line":332,"end_character":15},"in_reply_to":"3f79a3b5_a26ed02a","updated":"2018-11-21 10:25:39.000000000","message":"If there is any changes in the table, it is responding back with some proper value","commit_id":"82c60e74ff45ca243b797a99ebecd57f55f983f7"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"773fbe0d7cd95f3b59d2e4b223a59d79620a5d2b","unresolved":false,"context_lines":[{"line_number":337,"context_line":"                NEUTRON_ROUTER_NAME)):"},{"line_number":338,"context_line":"                router \u003d lr"},{"line_number":339,"context_line":"                break"},{"line_number":340,"context_line":"        for lsp in self.ovn_nbdb_api.tables["},{"line_number":341,"context_line":"            \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":342,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":343,"context_line":"                for net in self.ovn_nbdb_api.tables["},{"line_number":344,"context_line":"                    \u0027Logical_Switch\u0027].rows.values():"},{"line_number":345,"context_line":"                    if net.name \u003d\u003d lsp.external_ids.get(NEUTRON_NET_NAME):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3f79a3b5_279f044f","line":342,"range":{"start_line":340,"start_character":1,"end_line":342,"end_character":74},"updated":"2018-11-26 13:33:00.000000000","message":"this part may not be replaced by db_find since I am matching with the lrouter_port_name","commit_id":"82c60e74ff45ca243b797a99ebecd57f55f983f7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"30877e37939cb13bb44bfaa3ffb7b0dfad6850de","unresolved":false,"context_lines":[{"line_number":331,"context_line":""},{"line_number":332,"context_line":"    def _notify_add_nw_port_to_router(self, row):"},{"line_number":333,"context_line":"        router \u003d network \u003d None"},{"line_number":334,"context_line":"        for lr in self.ovn_nbdb_api.tables["},{"line_number":335,"context_line":"            \u0027Logical_Router\u0027].rows.values():"},{"line_number":336,"context_line":"            if lr.name \u003d\u003d ovn_utils.ovn_name(row.external_ids.get("},{"line_number":337,"context_line":"                NEUTRON_ROUTER_NAME)):"},{"line_number":338,"context_line":"                router \u003d lr"},{"line_number":339,"context_line":"                break"},{"line_number":340,"context_line":"        for lsp in self.ovn_nbdb_api.tables["},{"line_number":341,"context_line":"            \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":342,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":343,"context_line":"                for net in self.ovn_nbdb_api.tables["},{"line_number":344,"context_line":"                    \u0027Logical_Switch\u0027].rows.values():"},{"line_number":345,"context_line":"                    if net.name \u003d\u003d lsp.external_ids.get(NEUTRON_NET_NAME):"},{"line_number":346,"context_line":"                        network \u003d net"},{"line_number":347,"context_line":"                        break"},{"line_number":348,"context_line":"        return router, network"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    def _notify_del_nw_port_from_router(self, row):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3f79a3b5_22540056","line":347,"range":{"start_line":334,"start_character":0,"end_line":347,"end_character":29},"updated":"2018-11-19 10:42:47.000000000","message":"This seems very unoptimized, we will need to iterate over potentially thousands of elements in nested loops. Can we use something like db_find() from ovsdbapp to find those values instead ?\n\nTake a look at it to see if it fits please:\n\nhttps://github.com/openstack/ovsdbapp/blob/19be7612e73dd3aeea038e1fe3c273a0a40cefee/ovsdbapp/api.py#L225-L245","commit_id":"82c60e74ff45ca243b797a99ebecd57f55f983f7"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"fef904be541cc55aa70b64c0d2f47fb1d60ba0c6","unresolved":false,"context_lines":[{"line_number":331,"context_line":""},{"line_number":332,"context_line":"    def _notify_add_nw_port_to_router(self, row):"},{"line_number":333,"context_line":"        router \u003d network \u003d None"},{"line_number":334,"context_line":"        for lr in self.ovn_nbdb_api.tables["},{"line_number":335,"context_line":"            \u0027Logical_Router\u0027].rows.values():"},{"line_number":336,"context_line":"            if lr.name \u003d\u003d ovn_utils.ovn_name(row.external_ids.get("},{"line_number":337,"context_line":"                NEUTRON_ROUTER_NAME)):"},{"line_number":338,"context_line":"                router \u003d lr"},{"line_number":339,"context_line":"                break"},{"line_number":340,"context_line":"        for lsp in self.ovn_nbdb_api.tables["},{"line_number":341,"context_line":"            \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":342,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":343,"context_line":"                for net in self.ovn_nbdb_api.tables["},{"line_number":344,"context_line":"                    \u0027Logical_Switch\u0027].rows.values():"},{"line_number":345,"context_line":"                    if net.name \u003d\u003d lsp.external_ids.get(NEUTRON_NET_NAME):"},{"line_number":346,"context_line":"                        network \u003d net"},{"line_number":347,"context_line":"                        break"},{"line_number":348,"context_line":"        return router, network"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    def _notify_del_nw_port_from_router(self, row):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3f79a3b5_47a800d9","line":347,"range":{"start_line":334,"start_character":0,"end_line":347,"end_character":29},"in_reply_to":"3f79a3b5_22540056","updated":"2018-11-21 10:25:39.000000000","message":"I could use it, let me try","commit_id":"82c60e74ff45ca243b797a99ebecd57f55f983f7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"30877e37939cb13bb44bfaa3ffb7b0dfad6850de","unresolved":false,"context_lines":[{"line_number":347,"context_line":"                        break"},{"line_number":348,"context_line":"        return router, network"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    def _notify_del_nw_port_from_router(self, row):"},{"line_number":351,"context_line":"        router \u003d network \u003d None"},{"line_number":352,"context_line":"        for lr in self.ovn_nbdb_api.tables["},{"line_number":353,"context_line":"            \u0027Logical_Router\u0027].rows.values():"}],"source_content_type":"text/x-python","patch_set":21,"id":"3f79a3b5_42cc9c32","line":350,"range":{"start_line":350,"start_character":8,"end_line":350,"end_character":15},"updated":"2018-11-19 10:42:47.000000000","message":"re: not notifying anything","commit_id":"82c60e74ff45ca243b797a99ebecd57f55f983f7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"30877e37939cb13bb44bfaa3ffb7b0dfad6850de","unresolved":false,"context_lines":[{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    def _notify_del_nw_port_from_router(self, row):"},{"line_number":351,"context_line":"        router \u003d network \u003d None"},{"line_number":352,"context_line":"        for lr in self.ovn_nbdb_api.tables["},{"line_number":353,"context_line":"            \u0027Logical_Router\u0027].rows.values():"},{"line_number":354,"context_line":"            for lrp in lr.ports:"},{"line_number":355,"context_line":"                if lrp.name \u003d\u003d row.options.get(\u0027router-port\u0027):"},{"line_number":356,"context_line":"                    router \u003d lr"},{"line_number":357,"context_line":"                    break"},{"line_number":358,"context_line":"        for net in self.ovn_nbdb_api.tables["},{"line_number":359,"context_line":"            \u0027Logical_Switch\u0027].rows.values():"},{"line_number":360,"context_line":"            if net.name \u003d\u003d row.external_ids.get(NEUTRON_NET_NAME):"},{"line_number":361,"context_line":"                network \u003d net"},{"line_number":362,"context_line":"                break"},{"line_number":363,"context_line":"        return router, network"},{"line_number":364,"context_line":""},{"line_number":365,"context_line":"    def event_request_handler(self, row, old, delete\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3f79a3b5_62bf5879","line":362,"range":{"start_line":352,"start_character":0,"end_line":362,"end_character":21},"updated":"2018-11-19 10:42:47.000000000","message":"re: db_find","commit_id":"82c60e74ff45ca243b797a99ebecd57f55f983f7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"30877e37939cb13bb44bfaa3ffb7b0dfad6850de","unresolved":false,"context_lines":[{"line_number":407,"context_line":"        # Find LB associated to a Network"},{"line_number":408,"context_line":"        output \u003d []"},{"line_number":409,"context_line":"        if network:"},{"line_number":410,"context_line":"            for lb in network.load_balancer:"},{"line_number":411,"context_line":"                if network.name in lb.external_ids.get("},{"line_number":412,"context_line":"                    LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":413,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":414,"context_line":"        elif lb_id:"},{"line_number":415,"context_line":"            for ls in self.ovn_nbdb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":416,"context_line":"                for lb in ls.load_balancer:"},{"line_number":417,"context_line":"                    if str(lb_id) \u003d\u003d str(lb.uuid):"},{"line_number":418,"context_line":"                        output.append(ls)"},{"line_number":419,"context_line":"        return output"},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"    def request_handler(self):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3f79a3b5_82eb9478","line":418,"range":{"start_line":410,"start_character":0,"end_line":418,"end_character":41},"updated":"2018-11-19 10:42:47.000000000","message":"re: db_find","commit_id":"82c60e74ff45ca243b797a99ebecd57f55f983f7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"91c9abdf8e32103b31e00fbf081d642330d86029","unresolved":false,"context_lines":[{"line_number":330,"context_line":"        self.helper_thread.start()"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"    def _notify_add_nw_port_to_router(self, row):"},{"line_number":333,"context_line":"        router \u003d network \u003d None"},{"line_number":334,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, ovn_utils.ovn_name(row.external_ids.get("},{"line_number":335,"context_line":"            NEUTRON_ROUTER_NAME)))"},{"line_number":336,"context_line":"        router \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Router\u0027,"}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_eb30f2b9","line":333,"range":{"start_line":333,"start_character":8,"end_line":333,"end_character":31},"updated":"2018-11-21 16:28:18.000000000","message":"not needed","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"03f92906f840835c4294017a9eeacbe9a2fc814a","unresolved":false,"context_lines":[{"line_number":330,"context_line":"        self.helper_thread.start()"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"    def _notify_add_nw_port_to_router(self, row):"},{"line_number":333,"context_line":"        router \u003d network \u003d None"},{"line_number":334,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, ovn_utils.ovn_name(row.external_ids.get("},{"line_number":335,"context_line":"            NEUTRON_ROUTER_NAME)))"},{"line_number":336,"context_line":"        router \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Router\u0027,"}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_2656e92c","line":333,"range":{"start_line":333,"start_character":8,"end_line":333,"end_character":31},"in_reply_to":"3f79a3b5_eb30f2b9","updated":"2018-11-26 13:56:41.000000000","message":"Needed for network. Because the first time the network is populated is inside the for loop in Line#352","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"91c9abdf8e32103b31e00fbf081d642330d86029","unresolved":false,"context_lines":[{"line_number":351,"context_line":"                    NEUTRON_NET_NAME))"},{"line_number":352,"context_line":"                network \u003d self.ovn_nbdb_api.db_find("},{"line_number":353,"context_line":"                    \u0027Logical_Switch\u0027, find_cond, row\u003dTrue).execute("},{"line_number":354,"context_line":"                        check_error\u003dTrue)"},{"line_number":355,"context_line":"            \u0027\u0027\u0027"},{"line_number":356,"context_line":"                for net in self.ovn_nbdb_api.tables["},{"line_number":357,"context_line":"                    \u0027Logical_Switch\u0027].rows.values():"}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_ab4f5a2f","line":354,"updated":"2018-11-21 16:28:18.000000000","message":"Should u add a break after u find the network here ? Apparently u only need the first one, so no reason to continue looping thru the rest","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"03f92906f840835c4294017a9eeacbe9a2fc814a","unresolved":false,"context_lines":[{"line_number":351,"context_line":"                    NEUTRON_NET_NAME))"},{"line_number":352,"context_line":"                network \u003d self.ovn_nbdb_api.db_find("},{"line_number":353,"context_line":"                    \u0027Logical_Switch\u0027, find_cond, row\u003dTrue).execute("},{"line_number":354,"context_line":"                        check_error\u003dTrue)"},{"line_number":355,"context_line":"            \u0027\u0027\u0027"},{"line_number":356,"context_line":"                for net in self.ovn_nbdb_api.tables["},{"line_number":357,"context_line":"                    \u0027Logical_Switch\u0027].rows.values():"}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_c64e1590","line":354,"in_reply_to":"3f79a3b5_ab4f5a2f","updated":"2018-11-26 13:56:41.000000000","message":"Done","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"91c9abdf8e32103b31e00fbf081d642330d86029","unresolved":false,"context_lines":[{"line_number":359,"context_line":"                        network \u003d net"},{"line_number":360,"context_line":"                        break"},{"line_number":361,"context_line":"        \u0027\u0027\u0027"},{"line_number":362,"context_line":"        router \u003d router[0]"},{"line_number":363,"context_line":"        network \u003d network[0]"},{"line_number":364,"context_line":"        return router, network"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"    def _notify_del_nw_port_from_router(self, row):"}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_2b634aae","line":363,"range":{"start_line":362,"start_character":0,"end_line":363,"end_character":28},"updated":"2018-11-21 16:28:18.000000000","message":"We have to check whether we did find the router/network or not. This will raise an IndexError otherwise","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"03f92906f840835c4294017a9eeacbe9a2fc814a","unresolved":false,"context_lines":[{"line_number":359,"context_line":"                        network \u003d net"},{"line_number":360,"context_line":"                        break"},{"line_number":361,"context_line":"        \u0027\u0027\u0027"},{"line_number":362,"context_line":"        router \u003d router[0]"},{"line_number":363,"context_line":"        network \u003d network[0]"},{"line_number":364,"context_line":"        return router, network"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"    def _notify_del_nw_port_from_router(self, row):"}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_cc74f78c","line":363,"range":{"start_line":362,"start_character":0,"end_line":363,"end_character":28},"in_reply_to":"3f79a3b5_2b634aae","updated":"2018-11-26 13:56:41.000000000","message":"Done","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"91c9abdf8e32103b31e00fbf081d642330d86029","unresolved":false,"context_lines":[{"line_number":364,"context_line":"        return router, network"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"    def _notify_del_nw_port_from_router(self, row):"},{"line_number":367,"context_line":"        router \u003d network \u003d None"},{"line_number":368,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, row.options.get(\u0027router-port\u0027))"},{"line_number":369,"context_line":"        router \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Router\u0027,"},{"line_number":370,"context_line":"                                           find_cond, row\u003dTrue).execute("}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_cb5416c8","line":367,"range":{"start_line":367,"start_character":7,"end_line":367,"end_character":31},"updated":"2018-11-21 16:28:18.000000000","message":"ditto: not needed","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"03f92906f840835c4294017a9eeacbe9a2fc814a","unresolved":false,"context_lines":[{"line_number":364,"context_line":"        return router, network"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"    def _notify_del_nw_port_from_router(self, row):"},{"line_number":367,"context_line":"        router \u003d network \u003d None"},{"line_number":368,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, row.options.get(\u0027router-port\u0027))"},{"line_number":369,"context_line":"        router \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Router\u0027,"},{"line_number":370,"context_line":"                                           find_cond, row\u003dTrue).execute("}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_ec77738c","line":367,"range":{"start_line":367,"start_character":7,"end_line":367,"end_character":31},"in_reply_to":"3f79a3b5_cb5416c8","updated":"2018-11-26 13:56:41.000000000","message":"Done","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"91c9abdf8e32103b31e00fbf081d642330d86029","unresolved":false,"context_lines":[{"line_number":386,"context_line":"                network \u003d net"},{"line_number":387,"context_line":"                break"},{"line_number":388,"context_line":"        \u0027\u0027\u0027"},{"line_number":389,"context_line":"        router \u003d router[0]"},{"line_number":390,"context_line":"        network \u003d network[0]"},{"line_number":391,"context_line":"        return router, network"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    def event_request_handler(self, row, old, delete\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_4b60069f","line":390,"range":{"start_line":389,"start_character":0,"end_line":390,"end_character":28},"updated":"2018-11-21 16:28:18.000000000","message":"ditto: avoiding IndexError\u0027es","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"03f92906f840835c4294017a9eeacbe9a2fc814a","unresolved":false,"context_lines":[{"line_number":386,"context_line":"                network \u003d net"},{"line_number":387,"context_line":"                break"},{"line_number":388,"context_line":"        \u0027\u0027\u0027"},{"line_number":389,"context_line":"        router \u003d router[0]"},{"line_number":390,"context_line":"        network \u003d network[0]"},{"line_number":391,"context_line":"        return router, network"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    def event_request_handler(self, row, old, delete\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_8c927f9f","line":390,"range":{"start_line":389,"start_character":0,"end_line":390,"end_character":28},"in_reply_to":"3f79a3b5_4b60069f","updated":"2018-11-26 13:56:41.000000000","message":"Done","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"91c9abdf8e32103b31e00fbf081d642330d86029","unresolved":false,"context_lines":[{"line_number":478,"context_line":"            # TODO(numans): Handle the exception properly"},{"line_number":479,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027, e)"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uuid\u003dFalse):"},{"line_number":482,"context_line":"        # loadbalancer_id can be either name or uuid. Put uuid\u003dTrue if"},{"line_number":483,"context_line":"        # searching with uuid instead of name"},{"line_number":484,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uuid else ("}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_2be90aab","line":481,"range":{"start_line":481,"start_character":43,"end_line":481,"end_character":54},"updated":"2018-11-21 16:28:18.000000000","message":"To make it more flexible, you can use uuidutils.is_uuid_like() that will tell whether it\u0027s a name of uuid (unless names are also used in UUID format)\n\nAnother alternative, I believe, is to use ovsdbapp\u0027s lookup() method which does lookup by the UUID or name for you (I would consult terry, IRC otherwiseguy, to confirm it)","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"03f92906f840835c4294017a9eeacbe9a2fc814a","unresolved":false,"context_lines":[{"line_number":478,"context_line":"            # TODO(numans): Handle the exception properly"},{"line_number":479,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027, e)"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uuid\u003dFalse):"},{"line_number":482,"context_line":"        # loadbalancer_id can be either name or uuid. Put uuid\u003dTrue if"},{"line_number":483,"context_line":"        # searching with uuid instead of name"},{"line_number":484,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uuid else ("}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_ecec5328","line":481,"range":{"start_line":481,"start_character":43,"end_line":481,"end_character":54},"in_reply_to":"3f79a3b5_2be90aab","updated":"2018-11-26 13:56:41.000000000","message":"Let me take it up in the a different patch, if thats ok?","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"2a311601fc1aec31d72e2d419489d24199c8fc43","unresolved":false,"context_lines":[{"line_number":478,"context_line":"            # TODO(numans): Handle the exception properly"},{"line_number":479,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027, e)"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uuid\u003dFalse):"},{"line_number":482,"context_line":"        # loadbalancer_id can be either name or uuid. Put uuid\u003dTrue if"},{"line_number":483,"context_line":"        # searching with uuid instead of name"},{"line_number":484,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uuid else ("}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_920db437","line":481,"range":{"start_line":481,"start_character":43,"end_line":481,"end_character":54},"in_reply_to":"3f79a3b5_ecec5328","updated":"2018-11-26 15:09:36.000000000","message":"ok","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"91c9abdf8e32103b31e00fbf081d642330d86029","unresolved":false,"context_lines":[{"line_number":595,"context_line":"    def _find_ls_for_lr(self, lr_name):"},{"line_number":596,"context_line":"        net_ids \u003d []"},{"line_number":597,"context_line":"        network_driver \u003d utils.get_network_driver()"},{"line_number":598,"context_line":"        for port in self.ovn_nbdb_api.tables["},{"line_number":599,"context_line":"            \u0027Logical_Router_Port\u0027].rows.values():"},{"line_number":600,"context_line":"            if ovn_utils.ovn_name(port.external_ids.get("},{"line_number":601,"context_line":"                NEUTRON_ROUTER_NAME)) \u003d\u003d lr_name:"},{"line_number":602,"context_line":"                for sid in str(port.external_ids.get("},{"line_number":603,"context_line":"                    \u0027neutron:subnet_ids\u0027)).split(\u0027 \u0027):"},{"line_number":604,"context_line":"                    net_ids.append(ovn_utils.ovn_name("}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_4b9fa64d","line":601,"range":{"start_line":598,"start_character":0,"end_line":601,"end_character":49},"updated":"2018-11-21 16:28:18.000000000","message":"Instead of looping thru all \"Logical_Router_Port\" to find the ones that belongs to a router, isn\u0027t it better to get the router from the \"Logical_Router\" table by it\u0027s name (lr_name) and then interact over only the ports that belongs to that router ?","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"03f92906f840835c4294017a9eeacbe9a2fc814a","unresolved":false,"context_lines":[{"line_number":595,"context_line":"    def _find_ls_for_lr(self, lr_name):"},{"line_number":596,"context_line":"        net_ids \u003d []"},{"line_number":597,"context_line":"        network_driver \u003d utils.get_network_driver()"},{"line_number":598,"context_line":"        for port in self.ovn_nbdb_api.tables["},{"line_number":599,"context_line":"            \u0027Logical_Router_Port\u0027].rows.values():"},{"line_number":600,"context_line":"            if ovn_utils.ovn_name(port.external_ids.get("},{"line_number":601,"context_line":"                NEUTRON_ROUTER_NAME)) \u003d\u003d lr_name:"},{"line_number":602,"context_line":"                for sid in str(port.external_ids.get("},{"line_number":603,"context_line":"                    \u0027neutron:subnet_ids\u0027)).split(\u0027 \u0027):"},{"line_number":604,"context_line":"                    net_ids.append(ovn_utils.ovn_name("}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_6cb1232c","line":601,"range":{"start_line":598,"start_character":0,"end_line":601,"end_character":49},"in_reply_to":"3f79a3b5_4b9fa64d","updated":"2018-11-26 13:56:41.000000000","message":"Logical Router Ports have Router and Subnet ID.\nThats not available in the Logical Router ( the subnet ID).\nIn your case, I would need to first traverse all ports for that router, find those ports in the Logical Router Port and then find the subnet for those ports. ( Thats probably one more for loop than I wanted)","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"43871ba67e291ad3c716ef81a246ecd12ffa0182","unresolved":false,"context_lines":[{"line_number":595,"context_line":"    def _find_ls_for_lr(self, lr_name):"},{"line_number":596,"context_line":"        net_ids \u003d []"},{"line_number":597,"context_line":"        network_driver \u003d utils.get_network_driver()"},{"line_number":598,"context_line":"        for port in self.ovn_nbdb_api.tables["},{"line_number":599,"context_line":"            \u0027Logical_Router_Port\u0027].rows.values():"},{"line_number":600,"context_line":"            if ovn_utils.ovn_name(port.external_ids.get("},{"line_number":601,"context_line":"                NEUTRON_ROUTER_NAME)) \u003d\u003d lr_name:"},{"line_number":602,"context_line":"                for sid in str(port.external_ids.get("},{"line_number":603,"context_line":"                    \u0027neutron:subnet_ids\u0027)).split(\u0027 \u0027):"},{"line_number":604,"context_line":"                    net_ids.append(ovn_utils.ovn_name("}],"source_content_type":"text/x-python","patch_set":22,"id":"3f79a3b5_5212bcff","line":601,"range":{"start_line":598,"start_character":0,"end_line":601,"end_character":49},"in_reply_to":"3f79a3b5_6cb1232c","updated":"2018-11-26 15:17:54.000000000","message":"Commented on the last patch-set (#24)","commit_id":"1b756302ddf33d68636ee5492bee41faff7fb9c7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"2a311601fc1aec31d72e2d419489d24199c8fc43","unresolved":false,"context_lines":[{"line_number":362,"context_line":"                    \u0027Logical_Switch\u0027, find_cond, row\u003dTrue).execute("},{"line_number":363,"context_line":"                        check_error\u003dTrue)"},{"line_number":364,"context_line":"                break"},{"line_number":365,"context_line":"        router \u003d router[0] if isinstance(router, list) else None"},{"line_number":366,"context_line":"        network \u003d network[0] if isinstance(network, list) else None"},{"line_number":367,"context_line":"        return router, network"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def _notify_del_nw_port_from_router(self, row):"}],"source_content_type":"text/x-python","patch_set":24,"id":"3f79a3b5_b2a47006","line":366,"range":{"start_line":365,"start_character":0,"end_line":366,"end_character":67},"updated":"2018-11-26 15:09:36.000000000","message":"try:\n    return router[0], network[0]\nexcept IndexError:\n    return None, None\n\nLooking at the code that uses these methods, it will only go ahead if both of these are !\u003d None. For example, L389: \"if router and network\".\n\nThat way we avoid having two extra conditionals (the if isinstance()\u0027s ones) for this method, which is not really needed and takes extra computational time.","commit_id":"4939db5752fb2a3789fd0261a9181ee1be4e219d"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"bbb8b7628e7b3703606ce3ec53083cf425a60f9a","unresolved":false,"context_lines":[{"line_number":362,"context_line":"                    \u0027Logical_Switch\u0027, find_cond, row\u003dTrue).execute("},{"line_number":363,"context_line":"                        check_error\u003dTrue)"},{"line_number":364,"context_line":"                break"},{"line_number":365,"context_line":"        router \u003d router[0] if isinstance(router, list) else None"},{"line_number":366,"context_line":"        network \u003d network[0] if isinstance(network, list) else None"},{"line_number":367,"context_line":"        return router, network"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def _notify_del_nw_port_from_router(self, row):"}],"source_content_type":"text/x-python","patch_set":24,"id":"3f79a3b5_1e6e8364","line":366,"range":{"start_line":365,"start_character":0,"end_line":366,"end_character":67},"in_reply_to":"3f79a3b5_b2a47006","updated":"2018-11-27 05:43:35.000000000","message":"Yeah, that makes sense :)","commit_id":"4939db5752fb2a3789fd0261a9181ee1be4e219d"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"2a311601fc1aec31d72e2d419489d24199c8fc43","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        network \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Switch\u0027,"},{"line_number":376,"context_line":"                                            find_cond, row\u003dTrue).execute("},{"line_number":377,"context_line":"                                                check_error\u003dTrue)"},{"line_number":378,"context_line":"        router \u003d router[0] if isinstance(router, list) else None"},{"line_number":379,"context_line":"        network \u003d network[0] if isinstance(network, list) else None"},{"line_number":380,"context_line":"        return router, network"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def event_request_handler(self, row, old, delete\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":24,"id":"3f79a3b5_725578ec","line":379,"range":{"start_line":378,"start_character":0,"end_line":379,"end_character":67},"updated":"2018-11-26 15:09:36.000000000","message":"ditto:\n\ntry:\n    return router[0], network[0]\nexcept IndexError:\n    return None, None","commit_id":"4939db5752fb2a3789fd0261a9181ee1be4e219d"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"bbb8b7628e7b3703606ce3ec53083cf425a60f9a","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        network \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Switch\u0027,"},{"line_number":376,"context_line":"                                            find_cond, row\u003dTrue).execute("},{"line_number":377,"context_line":"                                                check_error\u003dTrue)"},{"line_number":378,"context_line":"        router \u003d router[0] if isinstance(router, list) else None"},{"line_number":379,"context_line":"        network \u003d network[0] if isinstance(network, list) else None"},{"line_number":380,"context_line":"        return router, network"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def event_request_handler(self, row, old, delete\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":24,"id":"3f79a3b5_be92ef47","line":379,"range":{"start_line":378,"start_character":0,"end_line":379,"end_character":67},"in_reply_to":"3f79a3b5_725578ec","updated":"2018-11-27 05:43:35.000000000","message":"Done","commit_id":"4939db5752fb2a3789fd0261a9181ee1be4e219d"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"2a311601fc1aec31d72e2d419489d24199c8fc43","unresolved":false,"context_lines":[{"line_number":583,"context_line":""},{"line_number":584,"context_line":"    def _find_ls_for_lr(self, lr_name):"},{"line_number":585,"context_line":"        net_ids \u003d []"},{"line_number":586,"context_line":"        network_driver \u003d utils.get_network_driver()"},{"line_number":587,"context_line":"        for port in self.ovn_nbdb_api.tables["},{"line_number":588,"context_line":"            \u0027Logical_Router_Port\u0027].rows.values():"},{"line_number":589,"context_line":"            if ovn_utils.ovn_name(port.external_ids.get("},{"line_number":590,"context_line":"                NEUTRON_ROUTER_NAME)) \u003d\u003d lr_name:"},{"line_number":591,"context_line":"                for sid in str(port.external_ids.get("},{"line_number":592,"context_line":"                    \u0027neutron:subnet_ids\u0027)).split(\u0027 \u0027):"},{"line_number":593,"context_line":"                    net_ids.append(ovn_utils.ovn_name("}],"source_content_type":"text/x-python","patch_set":24,"id":"3f79a3b5_8f503161","line":590,"range":{"start_line":586,"start_character":0,"end_line":590,"end_character":49},"updated":"2018-11-26 15:09:36.000000000","message":"(Continuing comment from patch-set #22):\n\nYou wrote:\n\n\"\nLogical Router Ports have Router and Subnet ID. Thats not available in the Logical Router ( the subnet ID). In your case, I would need to first traverse all ports for that router, find those ports in the Logical Router Port and then find the subnet for those ports. ( Thats probably one more for loop than I wanted)\n\"\n\nReply:\n\nWe don\u0027t really need an extra loop here. And by not looping thru _all_ router ports would greatly improve the performance here because it\u0027s quite expensive.\n\nOnce you find the router using db_find() (with the lr_name passed in the parameter) you can do a db_get() to find the rest of the attributes subnet_ids for the ports belonging to that router. Remember, these UUIDs are indexed in the DB so db_find()/db_get() Vs. looping thru everything should be much much faster.\n\nHere\u0027s a snippet I created and tested in an test environment:\n\nfrom ovsdbapp.backend.ovs_idl import connection\nfrom ovsdbapp.backend.ovs_idl import idlutils\nfrom ovsdbapp.schema.ovn_northbound import impl_idl\nimport ovs.db.idl\n\nremote \u003d \u0027unix:/usr/local/var/run/openvswitch/ovnnb_db.sock\u0027\nschema \u003d idlutils.get_schema_helper(remote, \u0027OVN_Northbound\u0027)\nschema.register_all()\nidl \u003d ovs.db.idl.Idl(remote, schema)\nconn \u003d connection.Connection(idl, timeout\u003d60)\napi \u003d impl_idl.OvnNbApiIdlImpl(conn)\n\nrouter \u003d api.db_find(\u0027Logical_Router\u0027, (\u0027name\u0027, \u0027\u003d\u0027, \u0027neutron-ee7655c4-ce1c-43bf-a4d0-874351924623\u0027)).execute(check_error\u003dTrue)\nif not router:\n    raise Exception(\"No router found\")\n\nfor p in router[0][\u0027ports\u0027]:\n    port_ext_ids \u003d api.db_get(\u0027Logical_Router_Port\u0027, p, \u0027external_ids\u0027).execute(check_error\u003dTrue)\n    print(\u0027Subnets ID: %s\u0027 % port_ext_ids.get(\u0027neutron:subnet_ids\u0027, \u0027\u0027))\n\nHere\u0027s the output:\n\n$ python test_router.py \n\nSubnets ID: 7cfa75cc-6772-4363-a255-1214f087bf01\nSubnets ID: 343afc97-dd32-4773-9894-3878fd13230b 07afd3d0-fd7b-453a-bce7-276a9c1198c4\nSubnets ID: 2e1a791d-cd4d-4bc6-8b85-e8cd1ef0f575","commit_id":"4939db5752fb2a3789fd0261a9181ee1be4e219d"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"bbb8b7628e7b3703606ce3ec53083cf425a60f9a","unresolved":false,"context_lines":[{"line_number":583,"context_line":""},{"line_number":584,"context_line":"    def _find_ls_for_lr(self, lr_name):"},{"line_number":585,"context_line":"        net_ids \u003d []"},{"line_number":586,"context_line":"        network_driver \u003d utils.get_network_driver()"},{"line_number":587,"context_line":"        for port in self.ovn_nbdb_api.tables["},{"line_number":588,"context_line":"            \u0027Logical_Router_Port\u0027].rows.values():"},{"line_number":589,"context_line":"            if ovn_utils.ovn_name(port.external_ids.get("},{"line_number":590,"context_line":"                NEUTRON_ROUTER_NAME)) \u003d\u003d lr_name:"},{"line_number":591,"context_line":"                for sid in str(port.external_ids.get("},{"line_number":592,"context_line":"                    \u0027neutron:subnet_ids\u0027)).split(\u0027 \u0027):"},{"line_number":593,"context_line":"                    net_ids.append(ovn_utils.ovn_name("}],"source_content_type":"text/x-python","patch_set":24,"id":"3f79a3b5_5ecb9b49","line":590,"range":{"start_line":586,"start_character":0,"end_line":590,"end_character":49},"in_reply_to":"3f79a3b5_8f503161","updated":"2018-11-27 05:43:35.000000000","message":"Ok, the db_find method does provide the improvement","commit_id":"4939db5752fb2a3789fd0261a9181ee1be4e219d"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"dafc1bf8a1770c8c4ba26fc6dec7b606ba1dc1cd","unresolved":false,"context_lines":[{"line_number":599,"context_line":"                               \u0027\u0027)).split(\u0027 \u0027):"},{"line_number":600,"context_line":"                    net_ids.append(ovn_utils.ovn_name("},{"line_number":601,"context_line":"                        network_driver.get_subnet(sid).network_id))"},{"line_number":602,"context_line":"        except Exception:"},{"line_number":603,"context_line":"            return []"},{"line_number":604,"context_line":"        return net_ids"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"    def _find_lr_of_ls(self, ovn_ls):"}],"source_content_type":"text/x-python","patch_set":25,"id":"3f79a3b5_92e04295","line":603,"range":{"start_line":602,"start_character":0,"end_line":603,"end_character":21},"updated":"2018-11-27 09:54:01.000000000","message":"except Exception without any log is tricky when troubleshooting. Also we know a IndexError can be raise, so let\u0027s be more specific about it.\n\nAn idea:\n\nexcept IndexError:\n    LOG.warning(\u0027Router named %s not found while ...\u0027, lr_name)\nexcept Exception as e:\n    LOG.exception(\u0027Unknown exception ... Error: %s\u0027, e)\n\nreturn net_ids","commit_id":"62b6958c5382f33555ced1909a2b0997560361d7"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"b3aa1d463fe4f7cb5a8af26ccd0d16791f44bd76","unresolved":false,"context_lines":[{"line_number":599,"context_line":"                               \u0027\u0027)).split(\u0027 \u0027):"},{"line_number":600,"context_line":"                    net_ids.append(ovn_utils.ovn_name("},{"line_number":601,"context_line":"                        network_driver.get_subnet(sid).network_id))"},{"line_number":602,"context_line":"        except Exception:"},{"line_number":603,"context_line":"            return []"},{"line_number":604,"context_line":"        return net_ids"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"    def _find_lr_of_ls(self, ovn_ls):"}],"source_content_type":"text/x-python","patch_set":25,"id":"3f79a3b5_ad988318","line":603,"range":{"start_line":602,"start_character":0,"end_line":603,"end_character":21},"in_reply_to":"3f79a3b5_92e04295","updated":"2018-11-27 10:36:12.000000000","message":"Was thinking I missed something . Thanks for pointing out.","commit_id":"62b6958c5382f33555ced1909a2b0997560361d7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        LogicalRouterPortEvent.driver \u003d driver"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"class LogicalSwitchPortEvent(row_event.RowEvent):"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"    driver \u003d None"},{"line_number":246,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_c0db7a79","line":243,"updated":"2019-01-29 03:21:54.000000000","message":"I think a better name would indicate that this was a port *delete* event.","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def __init__(self):"},{"line_number":248,"context_line":"        table \u003d \u0027Logical_Switch_Port\u0027"},{"line_number":249,"context_line":"        events \u003d (self.ROW_DELETE)"},{"line_number":250,"context_line":"        super(LogicalSwitchPortEvent, self).__init__("},{"line_number":251,"context_line":"            events, table, None)"},{"line_number":252,"context_line":"        self.event_name \u003d \u0027LogicalSwitchPortEvent\u0027"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_80ba5207","line":249,"updated":"2019-01-29 03:21:54.000000000","message":"This is not a tuple w/o a comma after self.ROW_DELETE)","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":254,"context_line":"    def run(self, event, row, old):"},{"line_number":255,"context_line":"        if self.driver and \u0027router\u0027 in row.addresses:"},{"line_number":256,"context_line":"            # Ignore any port which is not a part of router"},{"line_number":257,"context_line":"            self.driver.event_request_handler(row, old, delete\u003dTrue)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    @classmethod"},{"line_number":260,"context_line":"    def set_driver(cls, driver):"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_c0729a7b","line":257,"updated":"2019-01-29 03:21:54.000000000","message":"It feels like the code would be a lot cleaner if a lot of the stuff that event_request_handler() does that is protected by \u0027if not delete\u0027 was just done in the event above, and the stuff for delete was done here. I don\u0027t see a great reason to have them in the same function.","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":353,"context_line":"        router \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Router\u0027,"},{"line_number":354,"context_line":"                                           find_cond, row\u003dTrue).execute("},{"line_number":355,"context_line":"                                               check_error\u003dTrue)"},{"line_number":356,"context_line":"        for lsp in self.ovn_nbdb_api.tables["},{"line_number":357,"context_line":"            \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":358,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":359,"context_line":"                find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lsp.external_ids.get("}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_a4d521e7","line":356,"updated":"2019-01-29 03:21:54.000000000","message":"db_find would also just return the matches where where the name matched. doesn\u0027t really matter, but would reduce indentation.","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":355,"context_line":"                                               check_error\u003dTrue)"},{"line_number":356,"context_line":"        for lsp in self.ovn_nbdb_api.tables["},{"line_number":357,"context_line":"            \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":358,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":359,"context_line":"                find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lsp.external_ids.get("},{"line_number":360,"context_line":"                    NEUTRON_NET_NAME))"},{"line_number":361,"context_line":"                network \u003d self.ovn_nbdb_api.db_find("}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_e472497b","line":358,"updated":"2019-01-29 03:21:54.000000000","message":"Logical_Switch_Port name is defined by the schema as a string with no \u0027min\u0027 or \u0027max\u0027, so they default to 1 and so the field should be required. It should be impossible for lsp.name not to be a string.","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":357,"context_line":"            \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":358,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":359,"context_line":"                find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lsp.external_ids.get("},{"line_number":360,"context_line":"                    NEUTRON_NET_NAME))"},{"line_number":361,"context_line":"                network \u003d self.ovn_nbdb_api.db_find("},{"line_number":362,"context_line":"                    \u0027Logical_Switch\u0027, find_cond, row\u003dTrue).execute("},{"line_number":363,"context_line":"                        check_error\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_a4ebe1d9","line":360,"updated":"2019-01-29 03:21:54.000000000","message":"This get() could return None, then you are passing a condition of None to db_find/idlutils.row_match/condition_match which *I think* would raise a ValueError due to different types of the column and value. In any case it would be searching for something with a O(n) complexity that it would be impossible to find.","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":358,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":359,"context_line":"                find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lsp.external_ids.get("},{"line_number":360,"context_line":"                    NEUTRON_NET_NAME))"},{"line_number":361,"context_line":"                network \u003d self.ovn_nbdb_api.db_find("},{"line_number":362,"context_line":"                    \u0027Logical_Switch\u0027, find_cond, row\u003dTrue).execute("},{"line_number":363,"context_line":"                        check_error\u003dTrue)"},{"line_number":364,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_6432d961","line":361,"updated":"2019-01-29 03:21:54.000000000","message":"You can use api.lookup() to look up a Logical_Switch by name or by uuid to avoid doing the find_cond stuff.","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":368,"context_line":"            return None, None"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":"    def _notify_del_nw_port_from_router(self, row):"},{"line_number":371,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, row.options.get(\u0027router-port\u0027))"},{"line_number":372,"context_line":"        router \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Router\u0027,"},{"line_number":373,"context_line":"                                           find_cond, row\u003dTrue).execute("},{"line_number":374,"context_line":"                                               check_error\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_849c9d6a","line":371,"updated":"2019-01-29 03:21:54.000000000","message":"find_cond could have None as match value here too.","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":369,"context_line":""},{"line_number":370,"context_line":"    def _notify_del_nw_port_from_router(self, row):"},{"line_number":371,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, row.options.get(\u0027router-port\u0027))"},{"line_number":372,"context_line":"        router \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Router\u0027,"},{"line_number":373,"context_line":"                                           find_cond, row\u003dTrue).execute("},{"line_number":374,"context_line":"                                               check_error\u003dTrue)"},{"line_number":375,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, row.external_ids.get(NEUTRON_NET_NAME))"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_0433cd63","line":372,"updated":"2019-01-29 03:21:54.000000000","message":"lookup() possible.","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":372,"context_line":"        router \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Router\u0027,"},{"line_number":373,"context_line":"                                           find_cond, row\u003dTrue).execute("},{"line_number":374,"context_line":"                                               check_error\u003dTrue)"},{"line_number":375,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, row.external_ids.get(NEUTRON_NET_NAME))"},{"line_number":376,"context_line":"        network \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Switch\u0027,"},{"line_number":377,"context_line":"                                            find_cond, row\u003dTrue).execute("},{"line_number":378,"context_line":"                                                check_error\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_a499a179","line":375,"updated":"2019-01-29 03:21:54.000000000","message":"same","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":373,"context_line":"                                           find_cond, row\u003dTrue).execute("},{"line_number":374,"context_line":"                                               check_error\u003dTrue)"},{"line_number":375,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, row.external_ids.get(NEUTRON_NET_NAME))"},{"line_number":376,"context_line":"        network \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Switch\u0027,"},{"line_number":377,"context_line":"                                            find_cond, row\u003dTrue).execute("},{"line_number":378,"context_line":"                                                check_error\u003dTrue)"},{"line_number":379,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_2438513b","line":376,"updated":"2019-01-29 03:21:54.000000000","message":"lookup() possible","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":393,"context_line":"            network_lb \u003d {str(lb.uuid) for lb in network.load_balancer}"},{"line_number":394,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":395,"context_line":"                lb for lb in network.load_balancer]"},{"line_number":396,"context_line":"            if not delete:"},{"line_number":397,"context_line":"                # if the network has any loadbalancer not in router lb"},{"line_number":398,"context_line":"                for lb in (network_lb ^ router_lb):"},{"line_number":399,"context_line":"                    if lb not in router_lb:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_84757d34","line":396,"updated":"2019-01-29 03:21:54.000000000","message":"See above comment in the Events about splitting a lot of this up into different functions since there is very little shared code.","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":427,"context_line":"        output \u003d []"},{"line_number":428,"context_line":"        if network:"},{"line_number":429,"context_line":"            for lb in network.load_balancer:"},{"line_number":430,"context_line":"                if network.name in lb.external_ids.get("},{"line_number":431,"context_line":"                    LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":432,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":433,"context_line":"        elif lb_id:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_841fbdb5","line":430,"updated":"2019-01-29 03:21:54.000000000","message":"If the key doesn\u0027t exist, this would be network.name in None.\n\nIf network.name is a uuid (I assume it is, but I don\u0027t know) the following won\u0027t be a problem, but if it is a short name, I think it could incorrectly match a substring like test1 in \"test12 test13\" would evaluate to True.","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":470,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027, e)"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uuid\u003dFalse):"},{"line_number":473,"context_line":"        # loadbalancer_id can be either name or uuid. Put uuid\u003dTrue if"},{"line_number":474,"context_line":"        # searching with uuid instead of name"},{"line_number":475,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uuid else ("},{"line_number":476,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_24ea91ab","line":473,"updated":"2019-01-29 03:21:54.000000000","message":"you can just use the api.lookup() command to look up by name or id. ovsdbapp in the OvnNbApiImpl defines lookups by name for the Load_Balancer table. (By default, it will handle index columns defined by the schema, but name isn\u0027t set as an index for Load_Balancer in the schema, so it is defined manually in the lookup_table).","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":548,"context_line":""},{"line_number":549,"context_line":"        return commands"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"    def _update_lb_to_lr_association(self, ovn_lb, ovn_lr, delete\u003dFalse):"},{"line_number":552,"context_line":"        commands \u003d []"},{"line_number":553,"context_line":"        lr_ref \u003d ovn_lb.external_ids.get(LB_EXT_IDS_LR_REF_KEY)"},{"line_number":554,"context_line":"        if not delete:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_e43a49ca","line":551,"updated":"2019-01-29 03:21:54.000000000","message":"Much like the comment above about using multiple functions, the only common code between delete/not delete in this method is a db_set command. It just seems like it makes the code more complex that it would be split up into multiple functions.","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e3a5e656e938c2f1ee8015af96a040eada65b27e","unresolved":false,"context_lines":[{"line_number":595,"context_line":"                ext_ids \u003d self.ovn_nbdb_api.db_get("},{"line_number":596,"context_line":"                    \u0027Logical_Router_Port\u0027, port, \u0027external_ids\u0027).execute("},{"line_number":597,"context_line":"                        check_error\u003dTrue)"},{"line_number":598,"context_line":"                for sid in str(ext_ids.get(\u0027neutron:subnet_ids\u0027,"},{"line_number":599,"context_line":"                               \u0027\u0027)).split(\u0027 \u0027):"},{"line_number":600,"context_line":"                    net_ids.append(ovn_utils.ovn_name("},{"line_number":601,"context_line":"                        network_driver.get_subnet(sid).network_id))"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_046e6dc8","line":598,"updated":"2019-01-29 03:21:54.000000000","message":"str() should be unnecessary, since external_ids a map that is by definition key: string, value: string in the schema.","commit_id":"5045d9c0b6f00b950825718960dbc6ef4a2c7143"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"51df7b6accf30684fdc43bb470b0d005cb7d74e5","unresolved":false,"context_lines":[{"line_number":169,"context_line":"name          : \"973a201a-8787-4f6e-9b8f-ab9f93c31f44\""},{"line_number":170,"context_line":"protocol      : []"},{"line_number":171,"context_line":"vips          : {\"10.0.0.10:82\"\u003d\"10.0.0.107:80,20.0.0.107:80\"}"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"Due to certain limitations in OVN, following changes have been made to"},{"line_number":174,"context_line":"consider interface addition/deletion to a router."},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"- If a network N1 has a loadbalancer LB1 associated to it and one of"},{"line_number":177,"context_line":"its interface is added to a router R1, LB1 is assocaited with R1 as well."},{"line_number":178,"context_line":""},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"- If a network N2 has a loadbalancer LB2 and one of its interface is added"},{"line_number":181,"context_line":"to the router R1, then R1 will have both loadbalancers LB1 and LB2. N1 and"},{"line_number":182,"context_line":"N2 will also have both loadbalancers associated to them."},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"- If a network N3 is added to the router R1, N3 will also have both"},{"line_number":185,"context_line":"loadbalancers( LB1, LB2 ) associated to it."},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"- If the interface to network N2 is removed from R1, Network N2 will now only"},{"line_number":188,"context_line":"have LB2 associated with it. Networks N1 and N3 and router R1 will have"},{"line_number":189,"context_line":"loadbalancer LB1 associated with them."},{"line_number":190,"context_line":"\"\"\""},{"line_number":191,"context_line":""},{"line_number":192,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_3ac073e1","line":189,"range":{"start_line":172,"start_character":0,"end_line":189,"end_character":38},"updated":"2019-01-28 16:03:32.000000000","message":"let\u0027s create a doc under https://github.com/openstack/networking-ovn/tree/master/doc/source/contributor/design \nIt can be a follow up patch but certainly this shouldn\u0027t be here IMO","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"d560584426728870caa62d94889bce0dc923cc62","unresolved":false,"context_lines":[{"line_number":169,"context_line":"name          : \"973a201a-8787-4f6e-9b8f-ab9f93c31f44\""},{"line_number":170,"context_line":"protocol      : []"},{"line_number":171,"context_line":"vips          : {\"10.0.0.10:82\"\u003d\"10.0.0.107:80,20.0.0.107:80\"}"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"Due to certain limitations in OVN, following changes have been made to"},{"line_number":174,"context_line":"consider interface addition/deletion to a router."},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"- If a network N1 has a loadbalancer LB1 associated to it and one of"},{"line_number":177,"context_line":"its interface is added to a router R1, LB1 is assocaited with R1 as well."},{"line_number":178,"context_line":""},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"- If a network N2 has a loadbalancer LB2 and one of its interface is added"},{"line_number":181,"context_line":"to the router R1, then R1 will have both loadbalancers LB1 and LB2. N1 and"},{"line_number":182,"context_line":"N2 will also have both loadbalancers associated to them."},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"- If a network N3 is added to the router R1, N3 will also have both"},{"line_number":185,"context_line":"loadbalancers( LB1, LB2 ) associated to it."},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"- If the interface to network N2 is removed from R1, Network N2 will now only"},{"line_number":188,"context_line":"have LB2 associated with it. Networks N1 and N3 and router R1 will have"},{"line_number":189,"context_line":"loadbalancer LB1 associated with them."},{"line_number":190,"context_line":"\"\"\""},{"line_number":191,"context_line":""},{"line_number":192,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_ac640c23","line":189,"range":{"start_line":172,"start_character":0,"end_line":189,"end_character":38},"in_reply_to":"9fdfeff1_3ac073e1","updated":"2019-01-30 14:59:00.000000000","message":"Follow Up patch please","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"51df7b6accf30684fdc43bb470b0d005cb7d74e5","unresolved":false,"context_lines":[{"line_number":216,"context_line":"LB_EXT_IDS_VIP_PORT_ID_KEY \u003d \u0027neutron:vip_port_id\u0027"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"NEUTRON_NET_NAME \u003d \"neutron:network_name\""},{"line_number":219,"context_line":"NEUTRON_ROUTER_NAME \u003d \"neutron:router_name\""},{"line_number":220,"context_line":""},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"class LogicalRouterPortEvent(row_event.RowEvent):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_ba61c307","line":219,"range":{"start_line":219,"start_character":0,"end_line":219,"end_character":43},"updated":"2019-01-28 16:03:32.000000000","message":"ditto, doesn\u0027t belong in here","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"51df7b6accf30684fdc43bb470b0d005cb7d74e5","unresolved":false,"context_lines":[{"line_number":215,"context_line":"LB_EXT_IDS_VIP_KEY \u003d \u0027neutron:vip\u0027"},{"line_number":216,"context_line":"LB_EXT_IDS_VIP_PORT_ID_KEY \u003d \u0027neutron:vip_port_id\u0027"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"NEUTRON_NET_NAME \u003d \"neutron:network_name\""},{"line_number":219,"context_line":"NEUTRON_ROUTER_NAME \u003d \"neutron:router_name\""},{"line_number":220,"context_line":""},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"class LogicalRouterPortEvent(row_event.RowEvent):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_1a700fdc","line":219,"range":{"start_line":218,"start_character":0,"end_line":219,"end_character":43},"updated":"2019-01-28 16:03:32.000000000","message":"http://git.openstack.org/cgit/openstack/networking-ovn/tree/networking_ovn/common/constants.py#n22","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"d560584426728870caa62d94889bce0dc923cc62","unresolved":false,"context_lines":[{"line_number":215,"context_line":"LB_EXT_IDS_VIP_KEY \u003d \u0027neutron:vip\u0027"},{"line_number":216,"context_line":"LB_EXT_IDS_VIP_PORT_ID_KEY \u003d \u0027neutron:vip_port_id\u0027"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"NEUTRON_NET_NAME \u003d \"neutron:network_name\""},{"line_number":219,"context_line":"NEUTRON_ROUTER_NAME \u003d \"neutron:router_name\""},{"line_number":220,"context_line":""},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"class LogicalRouterPortEvent(row_event.RowEvent):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_cc6950f9","line":219,"range":{"start_line":218,"start_character":0,"end_line":219,"end_character":43},"in_reply_to":"9fdfeff1_1a700fdc","updated":"2019-01-30 14:59:00.000000000","message":"Okay","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e189d3745d4ee19e677bebe8f75c49731795c180","unresolved":false,"context_lines":[{"line_number":216,"context_line":"LB_EXT_IDS_VIP_PORT_ID_KEY \u003d \u0027neutron:vip_port_id\u0027"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"NEUTRON_NET_NAME \u003d \"neutron:network_name\""},{"line_number":219,"context_line":"NEUTRON_ROUTER_NAME \u003d \"neutron:router_name\""},{"line_number":220,"context_line":""},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"class LogicalRouterPortEvent(row_event.RowEvent):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_6533c0f7","line":219,"range":{"start_line":219,"start_character":0,"end_line":219,"end_character":43},"in_reply_to":"9fdfeff1_ba61c307","updated":"2019-01-28 16:32:19.000000000","message":"++","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":215,"context_line":"LB_EXT_IDS_VIP_KEY \u003d \u0027neutron:vip\u0027"},{"line_number":216,"context_line":"LB_EXT_IDS_VIP_PORT_ID_KEY \u003d \u0027neutron:vip_port_id\u0027"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"NEUTRON_NET_NAME \u003d \"neutron:network_name\""},{"line_number":219,"context_line":"NEUTRON_ROUTER_NAME \u003d \"neutron:router_name\""},{"line_number":220,"context_line":""},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"class LogicalRouterPortEvent(row_event.RowEvent):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_2559fd33","line":219,"range":{"start_line":218,"start_character":0,"end_line":219,"end_character":43},"in_reply_to":"9fdfeff1_cc6950f9","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    def run(self, event, row, old):"},{"line_number":234,"context_line":"        if self.driver and not row.gateway_chassis:"},{"line_number":235,"context_line":"            # Ignore any gateway_chassis port"},{"line_number":236,"context_line":"            self.driver.event_request_handler(row, old)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @classmethod"},{"line_number":239,"context_line":"    def set_driver(cls, driver):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_84a9fd24","line":236,"updated":"2019-01-29 04:36:58.000000000","message":"The code would be a lot cleaner if the \u0027if not delete\u0027 code in event_request_handler were in here and the \u0027if delete\u0027 code in the other even\u0027t run(). There is very little overlap between the two cases, so it just makes event_request_handler() harder to read.","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"5290bad0700bc8391f14f0a9aaeb4ad31ed1dc4b","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    def run(self, event, row, old):"},{"line_number":234,"context_line":"        if self.driver and not row.gateway_chassis:"},{"line_number":235,"context_line":"            # Ignore any gateway_chassis port"},{"line_number":236,"context_line":"            self.driver.event_request_handler(row, old)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @classmethod"},{"line_number":239,"context_line":"    def set_driver(cls, driver):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_fb164449","line":236,"in_reply_to":"9fdfeff1_0c543820","updated":"2019-01-30 16:22:46.000000000","message":"I\u0027m not sure I understand. If event_request_handler() is on self.driver, and you have self.driver, then you have access to everything that event_request_handler does through accessing self.driver where event_request_handler accesses self, right?","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"d560584426728870caa62d94889bce0dc923cc62","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    def run(self, event, row, old):"},{"line_number":234,"context_line":"        if self.driver and not row.gateway_chassis:"},{"line_number":235,"context_line":"            # Ignore any gateway_chassis port"},{"line_number":236,"context_line":"            self.driver.event_request_handler(row, old)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @classmethod"},{"line_number":239,"context_line":"    def set_driver(cls, driver):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_0c543820","line":236,"in_reply_to":"9fdfeff1_84a9fd24","updated":"2019-01-30 14:59:00.000000000","message":"There are some things which the event handler can process itself, since a lot of objects are initialized in the driver class. I can try to improve the readability there but IMHO, I think there isnt a possibility of movement of the event request handler\u0027s code ( the delete one ) here.\nI am not sure how I will execute the transactions from this function","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    def run(self, event, row, old):"},{"line_number":234,"context_line":"        if self.driver and not row.gateway_chassis:"},{"line_number":235,"context_line":"            # Ignore any gateway_chassis port"},{"line_number":236,"context_line":"            self.driver.event_request_handler(row, old)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @classmethod"},{"line_number":239,"context_line":"    def set_driver(cls, driver):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_c562710a","line":236,"in_reply_to":"9fdfeff1_bb68bc1c","updated":"2019-01-31 11:52:32.000000000","message":"~~Pending~~","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"675f6fa03314d2f1cd94527067fc96531f73ae5d","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    def run(self, event, row, old):"},{"line_number":234,"context_line":"        if self.driver and not row.gateway_chassis:"},{"line_number":235,"context_line":"            # Ignore any gateway_chassis port"},{"line_number":236,"context_line":"            self.driver.event_request_handler(row, old)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @classmethod"},{"line_number":239,"context_line":"    def set_driver(cls, driver):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_bb68bc1c","line":236,"in_reply_to":"9fdfeff1_fb164449","updated":"2019-01-30 16:46:53.000000000","message":"+1 for splitting the methods :)","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def __init__(self):"},{"line_number":248,"context_line":"        table \u003d \u0027Logical_Switch_Port\u0027"},{"line_number":249,"context_line":"        events \u003d (self.ROW_DELETE)"},{"line_number":250,"context_line":"        super(LogicalSwitchPortEvent, self).__init__("},{"line_number":251,"context_line":"            events, table, None)"},{"line_number":252,"context_line":"        self.event_name \u003d \u0027LogicalSwitchPortEvent\u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_c48aa5bd","line":249,"updated":"2019-01-29 04:36:58.000000000","message":"This is not a tuple without a comma after ROW_DELETE. It will accidentally still work because ROW_DELETE is a string and \u0027in\u0027 is used to compare, but best to make it a non-string iterable. :)","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def __init__(self):"},{"line_number":248,"context_line":"        table \u003d \u0027Logical_Switch_Port\u0027"},{"line_number":249,"context_line":"        events \u003d (self.ROW_DELETE)"},{"line_number":250,"context_line":"        super(LogicalSwitchPortEvent, self).__init__("},{"line_number":251,"context_line":"            events, table, None)"},{"line_number":252,"context_line":"        self.event_name \u003d \u0027LogicalSwitchPortEvent\u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_056f19c5","line":249,"in_reply_to":"9fdfeff1_c48aa5bd","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":254,"context_line":"    def run(self, event, row, old):"},{"line_number":255,"context_line":"        if self.driver and \u0027router\u0027 in row.addresses:"},{"line_number":256,"context_line":"            # Ignore any port which is not a part of router"},{"line_number":257,"context_line":"            self.driver.event_request_handler(row, old, delete\u003dTrue)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    @classmethod"},{"line_number":260,"context_line":"    def set_driver(cls, driver):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_6453b940","line":257,"updated":"2019-01-29 04:36:58.000000000","message":"Same comment as in LogicalRouterPortEvent","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":254,"context_line":"    def run(self, event, row, old):"},{"line_number":255,"context_line":"        if self.driver and \u0027router\u0027 in row.addresses:"},{"line_number":256,"context_line":"            # Ignore any port which is not a part of router"},{"line_number":257,"context_line":"            self.driver.event_request_handler(row, old, delete\u003dTrue)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    @classmethod"},{"line_number":260,"context_line":"    def set_driver(cls, driver):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_a553ad38","line":257,"in_reply_to":"9fdfeff1_6453b940","updated":"2019-01-31 11:52:32.000000000","message":"~~Pending~~","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e189d3745d4ee19e677bebe8f75c49731795c180","unresolved":false,"context_lines":[{"line_number":346,"context_line":"        LogicalSwitchPortEvent.set_driver(self)"},{"line_number":347,"context_line":"        self.helper_thread.start()"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"    def _notify_add_nw_port_to_router(self, row):"},{"line_number":350,"context_line":"        network \u003d None"},{"line_number":351,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, ovn_utils.ovn_name(row.external_ids.get("},{"line_number":352,"context_line":"            NEUTRON_ROUTER_NAME)))"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_85eb44da","line":349,"range":{"start_line":349,"start_character":8,"end_line":349,"end_character":16},"updated":"2019-01-28 16:32:19.000000000","message":"It\u0027s trivial/nit but \"_notify\" gives me the idea that the method itself will do the notification and not just return a router and a network. Perhaps this is a _get_* method ?","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":346,"context_line":"        LogicalSwitchPortEvent.set_driver(self)"},{"line_number":347,"context_line":"        self.helper_thread.start()"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"    def _notify_add_nw_port_to_router(self, row):"},{"line_number":350,"context_line":"        network \u003d None"},{"line_number":351,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, ovn_utils.ovn_name(row.external_ids.get("},{"line_number":352,"context_line":"            NEUTRON_ROUTER_NAME)))"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_45d52143","line":349,"range":{"start_line":349,"start_character":8,"end_line":349,"end_character":16},"in_reply_to":"9fdfeff1_85eb44da","updated":"2019-01-31 11:52:32.000000000","message":"Changed","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e189d3745d4ee19e677bebe8f75c49731795c180","unresolved":false,"context_lines":[{"line_number":354,"context_line":"            \u0027Logical_Router\u0027, find_cond, row\u003dTrue,"},{"line_number":355,"context_line":"            columns\u003d[\u0027_uuid\u0027, \u0027external_ids\u0027, \u0027load_balancer\u0027,"},{"line_number":356,"context_line":"                     \u0027name\u0027, \u0027options\u0027, \u0027ports\u0027]).execute(check_error\u003dTrue)"},{"line_number":357,"context_line":"        for lsp in self.ovn_nbdb_api.tables["},{"line_number":358,"context_line":"            \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":359,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":360,"context_line":"                find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lsp.external_ids.get("},{"line_number":361,"context_line":"                    NEUTRON_NET_NAME))"},{"line_number":362,"context_line":"                network \u003d self.ovn_nbdb_api.db_find("}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_e5f01000","line":359,"range":{"start_line":357,"start_character":0,"end_line":359,"end_character":74},"updated":"2019-01-28 16:32:19.000000000","message":"Can we use db_find() here as well ? The Logical_Switch_Port table indexes the name column [0]. That would be way more performatic than looping thru every existing port (which will be in the thousands).\n\nrouter_port \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Switch_Port\u0027, (\u0027name\u0027, \u0027\u003d\u0027, ovn_utils.ovn_lrouter_port_name(str(lsp.name))).execute(check_error\u003dTrue)\n\n[0] https://github.com/openvswitch/ovs/blob/409f7245817a4e2bc7e637a31a3de9c7d87400f2/ovn/ovn-nb.ovsschema#L108","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":354,"context_line":"            \u0027Logical_Router\u0027, find_cond, row\u003dTrue,"},{"line_number":355,"context_line":"            columns\u003d[\u0027_uuid\u0027, \u0027external_ids\u0027, \u0027load_balancer\u0027,"},{"line_number":356,"context_line":"                     \u0027name\u0027, \u0027options\u0027, \u0027ports\u0027]).execute(check_error\u003dTrue)"},{"line_number":357,"context_line":"        for lsp in self.ovn_nbdb_api.tables["},{"line_number":358,"context_line":"            \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":359,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":360,"context_line":"                find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lsp.external_ids.get("},{"line_number":361,"context_line":"                    NEUTRON_NET_NAME))"},{"line_number":362,"context_line":"                network \u003d self.ovn_nbdb_api.db_find("}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_0968931a","line":359,"range":{"start_line":357,"start_character":0,"end_line":359,"end_character":74},"in_reply_to":"9fdfeff1_e42329bc","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":354,"context_line":"            \u0027Logical_Router\u0027, find_cond, row\u003dTrue,"},{"line_number":355,"context_line":"            columns\u003d[\u0027_uuid\u0027, \u0027external_ids\u0027, \u0027load_balancer\u0027,"},{"line_number":356,"context_line":"                     \u0027name\u0027, \u0027options\u0027, \u0027ports\u0027]).execute(check_error\u003dTrue)"},{"line_number":357,"context_line":"        for lsp in self.ovn_nbdb_api.tables["},{"line_number":358,"context_line":"            \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":359,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":360,"context_line":"                find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lsp.external_ids.get("},{"line_number":361,"context_line":"                    NEUTRON_NET_NAME))"},{"line_number":362,"context_line":"                network \u003d self.ovn_nbdb_api.db_find("}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_e42329bc","line":359,"range":{"start_line":357,"start_character":0,"end_line":359,"end_character":74},"in_reply_to":"9fdfeff1_e5f01000","updated":"2019-01-29 04:36:58.000000000","message":"You should be able to just do \n    api.lookup(\u0027Logical_Switch_Port\u0027, ovn_utils.ovn_lrouter_port_name(lsp.name))\n\ninstead of find, it\u0027s a little easier and also can look up by indexed column or uuid (or column added to lookup_table on the Impl class). Currently, indexed columns aren\u0027t actually any faster, I need to add some code to ovsdbapp to make use of indexed lookups that I added to python-ovs.\n\nAlso str(lsp.name) isn\u0027t necessary. It can\u0027t be anything other than a string and has to be set.","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":357,"context_line":"        for lsp in self.ovn_nbdb_api.tables["},{"line_number":358,"context_line":"            \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":359,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":360,"context_line":"                find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lsp.external_ids.get("},{"line_number":361,"context_line":"                    NEUTRON_NET_NAME))"},{"line_number":362,"context_line":"                network \u003d self.ovn_nbdb_api.db_find("},{"line_number":363,"context_line":"                    \u0027Logical_Switch\u0027, find_cond, row\u003dTrue).execute("}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_1f5a3429","line":360,"updated":"2019-01-29 04:36:58.000000000","message":"get() could return none which would probably eventually lead to a ValueError when doing the condition_match since the type would not match the column.","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":357,"context_line":"        for lsp in self.ovn_nbdb_api.tables["},{"line_number":358,"context_line":"            \u0027Logical_Switch_Port\u0027].rows.values():"},{"line_number":359,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":360,"context_line":"                find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lsp.external_ids.get("},{"line_number":361,"context_line":"                    NEUTRON_NET_NAME))"},{"line_number":362,"context_line":"                network \u003d self.ovn_nbdb_api.db_find("},{"line_number":363,"context_line":"                    \u0027Logical_Switch\u0027, find_cond, row\u003dTrue).execute("}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_059e3906","line":360,"in_reply_to":"9fdfeff1_1f5a3429","updated":"2019-01-31 11:52:32.000000000","message":"Handled below","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":359,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":360,"context_line":"                find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lsp.external_ids.get("},{"line_number":361,"context_line":"                    NEUTRON_NET_NAME))"},{"line_number":362,"context_line":"                network \u003d self.ovn_nbdb_api.db_find("},{"line_number":363,"context_line":"                    \u0027Logical_Switch\u0027, find_cond, row\u003dTrue).execute("},{"line_number":364,"context_line":"                        check_error\u003dTrue)"},{"line_number":365,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_df3fccb1","line":362,"updated":"2019-01-29 04:36:58.000000000","message":"Instead of doing the db_find above, you could do a lookup() here too and also avoid the get() bug above. :D","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":359,"context_line":"            if row.name \u003d\u003d ovn_utils.ovn_lrouter_port_name(str(lsp.name)):"},{"line_number":360,"context_line":"                find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lsp.external_ids.get("},{"line_number":361,"context_line":"                    NEUTRON_NET_NAME))"},{"line_number":362,"context_line":"                network \u003d self.ovn_nbdb_api.db_find("},{"line_number":363,"context_line":"                    \u0027Logical_Switch\u0027, find_cond, row\u003dTrue).execute("},{"line_number":364,"context_line":"                        check_error\u003dTrue)"},{"line_number":365,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_c58b51c0","line":362,"in_reply_to":"9fdfeff1_df3fccb1","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e189d3745d4ee19e677bebe8f75c49731795c180","unresolved":false,"context_lines":[{"line_number":368,"context_line":"        except IndexError:"},{"line_number":369,"context_line":"            return None, None"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"    def _notify_del_nw_port_from_router(self, row):"},{"line_number":372,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, row.options.get(\u0027router-port\u0027))"},{"line_number":373,"context_line":"        ext_id \u003d self.ovn_nbdb_api.db_find("},{"line_number":374,"context_line":"            \u0027Logical_Router_Port\u0027, find_cond,"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_25be18d5","line":371,"range":{"start_line":371,"start_character":8,"end_line":371,"end_character":15},"updated":"2019-01-28 16:32:19.000000000","message":"Same trivial comment as L349","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":368,"context_line":"        except IndexError:"},{"line_number":369,"context_line":"            return None, None"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"    def _notify_del_nw_port_from_router(self, row):"},{"line_number":372,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, row.options.get(\u0027router-port\u0027))"},{"line_number":373,"context_line":"        ext_id \u003d self.ovn_nbdb_api.db_find("},{"line_number":374,"context_line":"            \u0027Logical_Router_Port\u0027, find_cond,"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_e58695b9","line":371,"range":{"start_line":371,"start_character":8,"end_line":371,"end_character":15},"in_reply_to":"9fdfeff1_25be18d5","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":369,"context_line":"            return None, None"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"    def _notify_del_nw_port_from_router(self, row):"},{"line_number":372,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, row.options.get(\u0027router-port\u0027))"},{"line_number":373,"context_line":"        ext_id \u003d self.ovn_nbdb_api.db_find("},{"line_number":374,"context_line":"            \u0027Logical_Router_Port\u0027, find_cond,"},{"line_number":375,"context_line":"            columns\u003d[\u0027external_ids\u0027]).execute("}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_3f78588e","line":372,"updated":"2019-01-29 04:36:58.000000000","message":"same get/lookup() comments","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":369,"context_line":"            return None, None"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"    def _notify_del_nw_port_from_router(self, row):"},{"line_number":372,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, row.options.get(\u0027router-port\u0027))"},{"line_number":373,"context_line":"        ext_id \u003d self.ovn_nbdb_api.db_find("},{"line_number":374,"context_line":"            \u0027Logical_Router_Port\u0027, find_cond,"},{"line_number":375,"context_line":"            columns\u003d[\u0027external_ids\u0027]).execute("}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_453441fc","line":372,"in_reply_to":"9fdfeff1_3f78588e","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                check_error\u003dTrue)"},{"line_number":377,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, \"neutron-\" + ext_id[0]["},{"line_number":378,"context_line":"            \u0027external_ids\u0027][NEUTRON_ROUTER_NAME])"},{"line_number":379,"context_line":"        router \u003d self.ovn_nbdb_api.db_find("},{"line_number":380,"context_line":"            \u0027Logical_Router\u0027, find_cond,"},{"line_number":381,"context_line":"            columns\u003d[\u0027_uuid\u0027, \u0027external_ids\u0027, \u0027load_balancer\u0027,"},{"line_number":382,"context_line":"                     \u0027name\u0027, \u0027options\u0027, \u0027ports\u0027], row\u003dTrue).execute("}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_1f7314b3","line":379,"updated":"2019-01-29 04:36:58.000000000","message":"same lookup() comment (which will also return a Row, so you don\u0027t need to mess with columns, keys, etc.)","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                check_error\u003dTrue)"},{"line_number":377,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, \"neutron-\" + ext_id[0]["},{"line_number":378,"context_line":"            \u0027external_ids\u0027][NEUTRON_ROUTER_NAME])"},{"line_number":379,"context_line":"        router \u003d self.ovn_nbdb_api.db_find("},{"line_number":380,"context_line":"            \u0027Logical_Router\u0027, find_cond,"},{"line_number":381,"context_line":"            columns\u003d[\u0027_uuid\u0027, \u0027external_ids\u0027, \u0027load_balancer\u0027,"},{"line_number":382,"context_line":"                     \u0027name\u0027, \u0027options\u0027, \u0027ports\u0027], row\u003dTrue).execute("}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_053ab9e5","line":379,"in_reply_to":"9fdfeff1_1f7314b3","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":381,"context_line":"            columns\u003d[\u0027_uuid\u0027, \u0027external_ids\u0027, \u0027load_balancer\u0027,"},{"line_number":382,"context_line":"                     \u0027name\u0027, \u0027options\u0027, \u0027ports\u0027], row\u003dTrue).execute("},{"line_number":383,"context_line":"                         check_error\u003dTrue)"},{"line_number":384,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, row.external_ids.get(NEUTRON_NET_NAME))"},{"line_number":385,"context_line":"        network \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Switch\u0027,"},{"line_number":386,"context_line":"                                            find_cond, row\u003dTrue).execute("},{"line_number":387,"context_line":"                                                check_error\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_7f6100d3","line":384,"updated":"2019-01-29 04:36:58.000000000","message":"same get/lookup comment","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":381,"context_line":"            columns\u003d[\u0027_uuid\u0027, \u0027external_ids\u0027, \u0027load_balancer\u0027,"},{"line_number":382,"context_line":"                     \u0027name\u0027, \u0027options\u0027, \u0027ports\u0027], row\u003dTrue).execute("},{"line_number":383,"context_line":"                         check_error\u003dTrue)"},{"line_number":384,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, row.external_ids.get(NEUTRON_NET_NAME))"},{"line_number":385,"context_line":"        network \u003d self.ovn_nbdb_api.db_find(\u0027Logical_Switch\u0027,"},{"line_number":386,"context_line":"                                            find_cond, row\u003dTrue).execute("},{"line_number":387,"context_line":"                                                check_error\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_25481d85","line":384,"in_reply_to":"9fdfeff1_7f6100d3","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e189d3745d4ee19e677bebe8f75c49731795c180","unresolved":false,"context_lines":[{"line_number":397,"context_line":"            router, network \u003d self._notify_add_nw_port_to_router(row)"},{"line_number":398,"context_line":"        else:"},{"line_number":399,"context_line":"            router, network \u003d self._notify_del_nw_port_from_router(row)"},{"line_number":400,"context_line":"        if router and network:"},{"line_number":401,"context_line":"            router_lb \u003d {str(lb.uuid) for lb in router.load_balancer}"},{"line_number":402,"context_line":"            network_lb \u003d {str(lb.uuid) for lb in network.load_balancer}"},{"line_number":403,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_e581f0fc","line":400,"range":{"start_line":400,"start_character":8,"end_line":400,"end_character":30},"updated":"2019-01-28 16:32:19.000000000","message":"Mostly nit:\n\nTo avoid too much indentation (see L412 to 413) we could do:\n\nif not router or not network:\n    return\n\nrouter_lb \u003d {...\nnetwork_lb \u003d {...","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":397,"context_line":"            router, network \u003d self._notify_add_nw_port_to_router(row)"},{"line_number":398,"context_line":"        else:"},{"line_number":399,"context_line":"            router, network \u003d self._notify_del_nw_port_from_router(row)"},{"line_number":400,"context_line":"        if router and network:"},{"line_number":401,"context_line":"            router_lb \u003d {str(lb.uuid) for lb in router.load_balancer}"},{"line_number":402,"context_line":"            network_lb \u003d {str(lb.uuid) for lb in network.load_balancer}"},{"line_number":403,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_852d49a9","line":400,"range":{"start_line":400,"start_character":8,"end_line":400,"end_character":30},"in_reply_to":"9fdfeff1_bfb0c844","updated":"2019-01-31 11:52:32.000000000","message":"~~Pending~~","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":397,"context_line":"            router, network \u003d self._notify_add_nw_port_to_router(row)"},{"line_number":398,"context_line":"        else:"},{"line_number":399,"context_line":"            router, network \u003d self._notify_del_nw_port_from_router(row)"},{"line_number":400,"context_line":"        if router and network:"},{"line_number":401,"context_line":"            router_lb \u003d {str(lb.uuid) for lb in router.load_balancer}"},{"line_number":402,"context_line":"            network_lb \u003d {str(lb.uuid) for lb in network.load_balancer}"},{"line_number":403,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_bfb0c844","line":400,"range":{"start_line":400,"start_character":8,"end_line":400,"end_character":30},"in_reply_to":"9fdfeff1_e581f0fc","updated":"2019-01-29 04:36:58.000000000","message":"As mentioned above in the Event comments, I\u0027d really like to see all of the if not delete/else code live in the event run(). Less indention, less complexity.","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"51df7b6accf30684fdc43bb470b0d005cb7d74e5","unresolved":false,"context_lines":[{"line_number":420,"context_line":"            else:"},{"line_number":421,"context_line":"                nw_lb \u003d set(self._find_lb_in_ls(network\u003dnetwork))"},{"line_number":422,"context_line":"                r_lb \u003d {str(r.uuid) for r in router.load_balancer} - nw_lb"},{"line_number":423,"context_line":"                # Delete all LB on N/W from Router"},{"line_number":424,"context_line":"                for lb in nw_lb:"},{"line_number":425,"context_line":"                    commands.extend(self._update_lb_to_lr_association("},{"line_number":426,"context_line":"                        self._find_ovn_lb("}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_da2367bc","line":423,"range":{"start_line":423,"start_character":35,"end_line":423,"end_character":38},"updated":"2019-01-28 16:03:32.000000000","message":"mean network right?","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"d560584426728870caa62d94889bce0dc923cc62","unresolved":false,"context_lines":[{"line_number":420,"context_line":"            else:"},{"line_number":421,"context_line":"                nw_lb \u003d set(self._find_lb_in_ls(network\u003dnetwork))"},{"line_number":422,"context_line":"                r_lb \u003d {str(r.uuid) for r in router.load_balancer} - nw_lb"},{"line_number":423,"context_line":"                # Delete all LB on N/W from Router"},{"line_number":424,"context_line":"                for lb in nw_lb:"},{"line_number":425,"context_line":"                    commands.extend(self._update_lb_to_lr_association("},{"line_number":426,"context_line":"                        self._find_ovn_lb("}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_2cb33c9a","line":423,"range":{"start_line":423,"start_character":35,"end_line":423,"end_character":38},"in_reply_to":"9fdfeff1_da2367bc","updated":"2019-01-30 14:59:00.000000000","message":"Yes","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":431,"context_line":"                        network.uuid, loadb))"},{"line_number":432,"context_line":"            self._execute_commands(commands)"},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"    def _find_lb_in_ls(self, network\u003dNone, lb_id\u003dNone):"},{"line_number":435,"context_line":"        # Find LB associated to a Network"},{"line_number":436,"context_line":"        output \u003d []"},{"line_number":437,"context_line":"        if network:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_7f6b4084","line":434,"updated":"2019-01-29 04:36:58.000000000","message":"This function returns a list of stringified uuids if network is set, or a list or Logical_Switch Row objects if lb_id. Or, if someone called it with both, a mix of strings and Rows. Since there is no code overlap between the two versions, it should probably just be two separate functions.","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":431,"context_line":"                        network.uuid, loadb))"},{"line_number":432,"context_line":"            self._execute_commands(commands)"},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"    def _find_lb_in_ls(self, network\u003dNone, lb_id\u003dNone):"},{"line_number":435,"context_line":"        # Find LB associated to a Network"},{"line_number":436,"context_line":"        output \u003d []"},{"line_number":437,"context_line":"        if network:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_e9398fa3","line":434,"in_reply_to":"9fdfeff1_7f6b4084","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        output \u003d []"},{"line_number":437,"context_line":"        if network:"},{"line_number":438,"context_line":"            for lb in network.load_balancer:"},{"line_number":439,"context_line":"                if network.name in lb.external_ids.get("},{"line_number":440,"context_line":"                    LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":441,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":442,"context_line":"        elif lb_id:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_1f81d44a","line":439,"updated":"2019-01-29 04:36:58.000000000","message":"If get returns None, would be\n    network.name in None\nwhich would raise TypeError.","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        output \u003d []"},{"line_number":437,"context_line":"        if network:"},{"line_number":438,"context_line":"            for lb in network.load_balancer:"},{"line_number":439,"context_line":"                if network.name in lb.external_ids.get("},{"line_number":440,"context_line":"                    LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":441,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":442,"context_line":"        elif lb_id:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_a93f0785","line":439,"in_reply_to":"9fdfeff1_1f81d44a","updated":"2019-01-31 11:52:32.000000000","message":"This is an Async call, so I can shut the call here with a Log message","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":441,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":442,"context_line":"        elif lb_id:"},{"line_number":443,"context_line":"            for ls in self.ovn_nbdb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":444,"context_line":"                for lb in ls.load_balancer:"},{"line_number":445,"context_line":"                    if str(lb_id) \u003d\u003d str(lb.uuid):"},{"line_number":446,"context_line":"                        output.append(ls)"},{"line_number":447,"context_line":"        return output"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_1f2b1430","line":444,"updated":"2019-01-29 04:36:58.000000000","message":"As an example, I think this part could just be:\n\ndef _switches_with_loadbalancer(lb):\n    return [ls for ls self.ovn.nbdb_api.tables[\u0027Logical_Switch\u0027].rows.values()\n            if lb in ls.load_balancer]\n\nor something similar (if lb is a Row). If, like I think Lucas mentioned, you won\u0027t have more than one ls w/ a particular lb, then you could use next((ls for ls in ...), None) etc.","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":441,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":442,"context_line":"        elif lb_id:"},{"line_number":443,"context_line":"            for ls in self.ovn_nbdb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":444,"context_line":"                for lb in ls.load_balancer:"},{"line_number":445,"context_line":"                    if str(lb_id) \u003d\u003d str(lb.uuid):"},{"line_number":446,"context_line":"                        output.append(ls)"},{"line_number":447,"context_line":"        return output"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_e930afa1","line":444,"in_reply_to":"9fdfeff1_1f2b1430","updated":"2019-01-31 11:52:32.000000000","message":"One Switch can have more than one LB and vice-versa ( many-many mapping )","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e189d3745d4ee19e677bebe8f75c49731795c180","unresolved":false,"context_lines":[{"line_number":443,"context_line":"            for ls in self.ovn_nbdb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":444,"context_line":"                for lb in ls.load_balancer:"},{"line_number":445,"context_line":"                    if str(lb_id) \u003d\u003d str(lb.uuid):"},{"line_number":446,"context_line":"                        output.append(ls)"},{"line_number":447,"context_line":"        return output"},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"    def request_handler(self):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_85eee4b1","line":446,"range":{"start_line":446,"start_character":0,"end_line":446,"end_character":41},"updated":"2019-01-28 16:32:19.000000000","message":"since we are using the lb_id I assume that\u0027s unique so this output list will only have one item, right ? \n\nIf that\u0027s correct, we should add a \"break\" statment after that item appended to the list and stop the loop.","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":443,"context_line":"            for ls in self.ovn_nbdb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":444,"context_line":"                for lb in ls.load_balancer:"},{"line_number":445,"context_line":"                    if str(lb_id) \u003d\u003d str(lb.uuid):"},{"line_number":446,"context_line":"                        output.append(ls)"},{"line_number":447,"context_line":"        return output"},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"    def request_handler(self):"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_6924bf5e","line":446,"range":{"start_line":446,"start_character":0,"end_line":446,"end_character":41},"in_reply_to":"9fdfeff1_85eee4b1","updated":"2019-01-31 11:52:32.000000000","message":"Nope, One LB can have multiple Logical switches attached to it ( thats what the event patch does, since without attaching Loadbalancer to the switches, communication between the LS cannot happen when LB is in force)","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":483,"context_line":"        # searching with uuid instead of name"},{"line_number":484,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uuid else ("},{"line_number":485,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"},{"line_number":486,"context_line":"        ovn_lb \u003d self.ovn_nbdb_api.db_find("},{"line_number":487,"context_line":"            \u0027Load_Balancer\u0027, find_condition, row\u003dTrue).execute("},{"line_number":488,"context_line":"                check_error\u003dTrue)"},{"line_number":489,"context_line":"        if len(ovn_lb) \u003e 1:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_7f190020","line":486,"updated":"2019-01-29 04:36:58.000000000","message":"You can just use lookup() to lookup by either name or uuid.","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":483,"context_line":"        # searching with uuid instead of name"},{"line_number":484,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uuid else ("},{"line_number":485,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"},{"line_number":486,"context_line":"        ovn_lb \u003d self.ovn_nbdb_api.db_find("},{"line_number":487,"context_line":"            \u0027Load_Balancer\u0027, find_condition, row\u003dTrue).execute("},{"line_number":488,"context_line":"                check_error\u003dTrue)"},{"line_number":489,"context_line":"        if len(ovn_lb) \u003e 1:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_09d97355","line":486,"in_reply_to":"9fdfeff1_7f190020","updated":"2019-01-31 11:52:32.000000000","message":"For now, I think I will go with the db_find.\nBut I will keep this in a ToDo, I dont want to mess up this patch with a lot of changes in one go :)","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":557,"context_line":""},{"line_number":558,"context_line":"        return commands"},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"    def _update_lb_to_lr_association(self, ovn_lb, ovn_lr, delete\u003dFalse):"},{"line_number":561,"context_line":"        commands \u003d []"},{"line_number":562,"context_line":"        lr_ref \u003d ovn_lb.external_ids.get(LB_EXT_IDS_LR_REF_KEY)"},{"line_number":563,"context_line":"        if not delete:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_9f1624f1","line":560,"updated":"2019-01-29 04:36:58.000000000","message":"Same comment on splitting up functions that are almost completely different for if not delete/delete.","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":557,"context_line":""},{"line_number":558,"context_line":"        return commands"},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"    def _update_lb_to_lr_association(self, ovn_lb, ovn_lr, delete\u003dFalse):"},{"line_number":561,"context_line":"        commands \u003d []"},{"line_number":562,"context_line":"        lr_ref \u003d ovn_lb.external_ids.get(LB_EXT_IDS_LR_REF_KEY)"},{"line_number":563,"context_line":"        if not delete:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_29f2379b","line":560,"in_reply_to":"9fdfeff1_9f1624f1","updated":"2019-01-31 11:52:32.000000000","message":"Modified without changing too much in the function call","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e189d3745d4ee19e677bebe8f75c49731795c180","unresolved":false,"context_lines":[{"line_number":605,"context_line":"                ext_ids \u003d self.ovn_nbdb_api.db_get("},{"line_number":606,"context_line":"                    \u0027Logical_Router_Port\u0027, port, \u0027external_ids\u0027).execute("},{"line_number":607,"context_line":"                        check_error\u003dTrue)"},{"line_number":608,"context_line":"                for sid in str(ext_ids.get(\u0027neutron:subnet_ids\u0027,"},{"line_number":609,"context_line":"                               \u0027\u0027)).split(\u0027 \u0027):"},{"line_number":610,"context_line":"                    net_ids.append(ovn_utils.ovn_name("},{"line_number":611,"context_line":"                        network_driver.get_subnet(sid).network_id))"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_c5262c16","line":608,"range":{"start_line":608,"start_character":43,"end_line":608,"end_character":63},"updated":"2019-01-28 16:32:19.000000000","message":"constants.OVN_SUBNET_EXT_IDS_KEY\n\nhttps://github.com/openstack/networking-ovn/blob/d224706f1eea2f39f2d5ce356d5bed990d992a69/networking_ovn/common/constants.py#L28","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":605,"context_line":"                ext_ids \u003d self.ovn_nbdb_api.db_get("},{"line_number":606,"context_line":"                    \u0027Logical_Router_Port\u0027, port, \u0027external_ids\u0027).execute("},{"line_number":607,"context_line":"                        check_error\u003dTrue)"},{"line_number":608,"context_line":"                for sid in str(ext_ids.get(\u0027neutron:subnet_ids\u0027,"},{"line_number":609,"context_line":"                               \u0027\u0027)).split(\u0027 \u0027):"},{"line_number":610,"context_line":"                    net_ids.append(ovn_utils.ovn_name("},{"line_number":611,"context_line":"                        network_driver.get_subnet(sid).network_id))"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_0931735a","line":608,"range":{"start_line":608,"start_character":43,"end_line":608,"end_character":63},"in_reply_to":"9fdfeff1_5fdafc4b","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"601fb744d6d5d726c94816bce75404cc97f5203a","unresolved":false,"context_lines":[{"line_number":605,"context_line":"                ext_ids \u003d self.ovn_nbdb_api.db_get("},{"line_number":606,"context_line":"                    \u0027Logical_Router_Port\u0027, port, \u0027external_ids\u0027).execute("},{"line_number":607,"context_line":"                        check_error\u003dTrue)"},{"line_number":608,"context_line":"                for sid in str(ext_ids.get(\u0027neutron:subnet_ids\u0027,"},{"line_number":609,"context_line":"                               \u0027\u0027)).split(\u0027 \u0027):"},{"line_number":610,"context_line":"                    net_ids.append(ovn_utils.ovn_name("},{"line_number":611,"context_line":"                        network_driver.get_subnet(sid).network_id))"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_5fdafc4b","line":608,"range":{"start_line":608,"start_character":43,"end_line":608,"end_character":63},"in_reply_to":"9fdfeff1_c5262c16","updated":"2019-01-29 04:36:58.000000000","message":"Also, str() should be unnecessary since external_ids are by schema definition a map with key: string, value: string.","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":605,"context_line":"                ext_ids \u003d self.ovn_nbdb_api.db_get("},{"line_number":606,"context_line":"                    \u0027Logical_Router_Port\u0027, port, \u0027external_ids\u0027).execute("},{"line_number":607,"context_line":"                        check_error\u003dTrue)"},{"line_number":608,"context_line":"                for sid in str(ext_ids.get(\u0027neutron:subnet_ids\u0027,"},{"line_number":609,"context_line":"                               \u0027\u0027)).split(\u0027 \u0027):"},{"line_number":610,"context_line":"                    net_ids.append(ovn_utils.ovn_name("},{"line_number":611,"context_line":"                        network_driver.get_subnet(sid).network_id))"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_a9338761","line":608,"range":{"start_line":608,"start_character":43,"end_line":608,"end_character":63},"in_reply_to":"9fdfeff1_c5262c16","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e189d3745d4ee19e677bebe8f75c49731795c180","unresolved":false,"context_lines":[{"line_number":610,"context_line":"                    net_ids.append(ovn_utils.ovn_name("},{"line_number":611,"context_line":"                        network_driver.get_subnet(sid).network_id))"},{"line_number":612,"context_line":"        except IndexError:"},{"line_number":613,"context_line":"            LOG.warning(\u0027Router named %s not found \u0027, lr_name)"},{"line_number":614,"context_line":"        except Exception as e:"},{"line_number":615,"context_line":"            LOG.exception(\u0027Unknown exception occurred : %s\u0027, e)"},{"line_number":616,"context_line":"        return net_ids"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_8571040f","line":613,"range":{"start_line":613,"start_character":50,"end_line":613,"end_character":51},"updated":"2019-01-28 16:32:19.000000000","message":"nit extra space","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":610,"context_line":"                    net_ids.append(ovn_utils.ovn_name("},{"line_number":611,"context_line":"                        network_driver.get_subnet(sid).network_id))"},{"line_number":612,"context_line":"        except IndexError:"},{"line_number":613,"context_line":"            LOG.warning(\u0027Router named %s not found \u0027, lr_name)"},{"line_number":614,"context_line":"        except Exception as e:"},{"line_number":615,"context_line":"            LOG.exception(\u0027Unknown exception occurred : %s\u0027, e)"},{"line_number":616,"context_line":"        return net_ids"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_294797be","line":613,"range":{"start_line":613,"start_character":50,"end_line":613,"end_character":51},"in_reply_to":"9fdfeff1_8571040f","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"1448d7d9c86d9eff1bbcf00eba964c0a70663b44","unresolved":false,"context_lines":[{"line_number":398,"context_line":"        else:"},{"line_number":399,"context_line":"            router, network \u003d self._notify_del_nw_port_from_router(row)"},{"line_number":400,"context_line":"        if router and network:"},{"line_number":401,"context_line":"            router_lb \u003d {str(lb.uuid) for lb in router.load_balancer}"},{"line_number":402,"context_line":"            network_lb \u003d {str(lb.uuid) for lb in network.load_balancer}"},{"line_number":403,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":404,"context_line":"                lb for lb in network.load_balancer]"}],"source_content_type":"text/x-python","patch_set":33,"id":"9fdfeff1_1b78e8c1","line":401,"range":{"start_line":401,"start_character":12,"end_line":401,"end_character":21},"updated":"2019-01-30 16:54:34.000000000","message":"same as my comment in L403","commit_id":"7bda11e5ac17177a9ddb7fc57ddc612d51115b2f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":398,"context_line":"        else:"},{"line_number":399,"context_line":"            router, network \u003d self._notify_del_nw_port_from_router(row)"},{"line_number":400,"context_line":"        if router and network:"},{"line_number":401,"context_line":"            router_lb \u003d {str(lb.uuid) for lb in router.load_balancer}"},{"line_number":402,"context_line":"            network_lb \u003d {str(lb.uuid) for lb in network.load_balancer}"},{"line_number":403,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":404,"context_line":"                lb for lb in network.load_balancer]"}],"source_content_type":"text/x-python","patch_set":33,"id":"9fdfeff1_696fdf2a","line":401,"range":{"start_line":401,"start_character":12,"end_line":401,"end_character":21},"in_reply_to":"9fdfeff1_1b78e8c1","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"7bda11e5ac17177a9ddb7fc57ddc612d51115b2f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"1448d7d9c86d9eff1bbcf00eba964c0a70663b44","unresolved":false,"context_lines":[{"line_number":399,"context_line":"            router, network \u003d self._notify_del_nw_port_from_router(row)"},{"line_number":400,"context_line":"        if router and network:"},{"line_number":401,"context_line":"            router_lb \u003d {str(lb.uuid) for lb in router.load_balancer}"},{"line_number":402,"context_line":"            network_lb \u003d {str(lb.uuid) for lb in network.load_balancer}"},{"line_number":403,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":404,"context_line":"                lb for lb in network.load_balancer]"},{"line_number":405,"context_line":"            if not delete:"}],"source_content_type":"text/x-python","patch_set":33,"id":"9fdfeff1_3b75accb","line":402,"range":{"start_line":402,"start_character":12,"end_line":402,"end_character":22},"updated":"2019-01-30 16:54:34.000000000","message":"same as my comment in L403. Let\u0027s split the delete/not delete in two methods and everything will become clearer :)","commit_id":"7bda11e5ac17177a9ddb7fc57ddc612d51115b2f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":399,"context_line":"            router, network \u003d self._notify_del_nw_port_from_router(row)"},{"line_number":400,"context_line":"        if router and network:"},{"line_number":401,"context_line":"            router_lb \u003d {str(lb.uuid) for lb in router.load_balancer}"},{"line_number":402,"context_line":"            network_lb \u003d {str(lb.uuid) for lb in network.load_balancer}"},{"line_number":403,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":404,"context_line":"                lb for lb in network.load_balancer]"},{"line_number":405,"context_line":"            if not delete:"}],"source_content_type":"text/x-python","patch_set":33,"id":"9fdfeff1_491bfbc8","line":402,"range":{"start_line":402,"start_character":12,"end_line":402,"end_character":22},"in_reply_to":"9fdfeff1_3b75accb","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"7bda11e5ac17177a9ddb7fc57ddc612d51115b2f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"dece5e33d8de9fc36375614d9747b27c739eadd7","unresolved":false,"context_lines":[{"line_number":400,"context_line":"        if router and network:"},{"line_number":401,"context_line":"            router_lb \u003d {str(lb.uuid) for lb in router.load_balancer}"},{"line_number":402,"context_line":"            network_lb \u003d {str(lb.uuid) for lb in network.load_balancer}"},{"line_number":403,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":404,"context_line":"                lb for lb in network.load_balancer]"},{"line_number":405,"context_line":"            if not delete:"},{"line_number":406,"context_line":"                # if the network has any loadbalancer not in router lb"}],"source_content_type":"text/x-python","patch_set":33,"id":"9fdfeff1_bb9bdc15","line":403,"range":{"start_line":403,"start_character":12,"end_line":403,"end_character":19},"updated":"2019-01-30 16:52:18.000000000","message":"lb_list is used only in the \u0027if not delete\u0027 branch, so you shouldn\u0027t pull it here","commit_id":"7bda11e5ac17177a9ddb7fc57ddc612d51115b2f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"401e40e63c33327ff4d5badc37c1d1c24255ba3f","unresolved":false,"context_lines":[{"line_number":400,"context_line":"        if router and network:"},{"line_number":401,"context_line":"            router_lb \u003d {str(lb.uuid) for lb in router.load_balancer}"},{"line_number":402,"context_line":"            network_lb \u003d {str(lb.uuid) for lb in network.load_balancer}"},{"line_number":403,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":404,"context_line":"                lb for lb in network.load_balancer]"},{"line_number":405,"context_line":"            if not delete:"},{"line_number":406,"context_line":"                # if the network has any loadbalancer not in router lb"}],"source_content_type":"text/x-python","patch_set":33,"id":"9fdfeff1_a98147c5","line":403,"range":{"start_line":403,"start_character":12,"end_line":403,"end_character":19},"in_reply_to":"9fdfeff1_bb9bdc15","updated":"2019-01-31 11:52:32.000000000","message":"Done","commit_id":"7bda11e5ac17177a9ddb7fc57ddc612d51115b2f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"3c311417cf84ef8b88d476ff8c72b67c9bb47e1a","unresolved":false,"context_lines":[{"line_number":217,"context_line":"LB_EXT_IDS_VIP_KEY \u003d \u0027neutron:vip\u0027"},{"line_number":218,"context_line":"LB_EXT_IDS_VIP_PORT_ID_KEY \u003d \u0027neutron:vip_port_id\u0027"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"# ToDo(Reedip): Try to move Event Handler delete code here and below"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"class LogicalRouterPortEvent(row_event.RowEvent):"}],"source_content_type":"text/x-python","patch_set":34,"id":"9fdfeff1_ecdf5d0a","line":220,"range":{"start_line":220,"start_character":0,"end_line":220,"end_character":68},"updated":"2019-01-31 12:37:15.000000000","message":"Not sure if that was what Terry asked for.\n\nI think he only asked to move the different actions (delete and create/update) to separated methods to avoid having too many conditionals and indentation which were making the code hard to read.\n\nThe new methods could still belong to the same class that the current event_handler() one does.","commit_id":"3b2c6f45814ab0825f187a4086020732c4b06728"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b2b745795ede03ba029d90cf2623445eb5e1560a","unresolved":false,"context_lines":[{"line_number":217,"context_line":"LB_EXT_IDS_VIP_KEY \u003d \u0027neutron:vip\u0027"},{"line_number":218,"context_line":"LB_EXT_IDS_VIP_PORT_ID_KEY \u003d \u0027neutron:vip_port_id\u0027"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"# ToDo(Reedip): Try to move Event Handler delete code here and below"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"class LogicalRouterPortEvent(row_event.RowEvent):"}],"source_content_type":"text/x-python","patch_set":34,"id":"9fdfeff1_bc52cc11","line":220,"range":{"start_line":220,"start_character":0,"end_line":220,"end_character":68},"in_reply_to":"9fdfeff1_ecdf5d0a","updated":"2019-02-01 13:38:26.000000000","message":"Thats what is in my mind. Let me try that","commit_id":"3b2c6f45814ab0825f187a4086020732c4b06728"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"3c311417cf84ef8b88d476ff8c72b67c9bb47e1a","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                    if str(lb_id) \u003d\u003d str(lb.uuid):"},{"line_number":449,"context_line":"                        output.append(ls)"},{"line_number":450,"context_line":"            return output"},{"line_number":451,"context_line":"        else:"},{"line_number":452,"context_line":"            LOG.error(\"No Loadbalancer ID passed\")"},{"line_number":453,"context_line":""},{"line_number":454,"context_line":"    def request_handler(self):"},{"line_number":455,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":34,"id":"9fdfeff1_ec30bda1","line":452,"range":{"start_line":451,"start_character":0,"end_line":452,"end_character":50},"updated":"2019-01-31 12:37:15.000000000","message":"Make lb_id mandatory instead of defaulting it to None","commit_id":"3b2c6f45814ab0825f187a4086020732c4b06728"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b2b745795ede03ba029d90cf2623445eb5e1560a","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                    if str(lb_id) \u003d\u003d str(lb.uuid):"},{"line_number":449,"context_line":"                        output.append(ls)"},{"line_number":450,"context_line":"            return output"},{"line_number":451,"context_line":"        else:"},{"line_number":452,"context_line":"            LOG.error(\"No Loadbalancer ID passed\")"},{"line_number":453,"context_line":""},{"line_number":454,"context_line":"    def request_handler(self):"},{"line_number":455,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":34,"id":"9fdfeff1_bc7bac89","line":452,"range":{"start_line":451,"start_character":0,"end_line":452,"end_character":50},"in_reply_to":"9fdfeff1_ec30bda1","updated":"2019-02-01 13:38:26.000000000","message":"Yeah, that makes sense.","commit_id":"3b2c6f45814ab0825f187a4086020732c4b06728"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"3c311417cf84ef8b88d476ff8c72b67c9bb47e1a","unresolved":false,"context_lines":[{"line_number":563,"context_line":""},{"line_number":564,"context_line":"        return commands"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"    def _del_lb_to_lr_assocaition(self, ovn_lb, ovn_lr, lr_ref):"},{"line_number":567,"context_line":"        commands \u003d []"},{"line_number":568,"context_line":"        if lr_ref:"},{"line_number":569,"context_line":"            lr_ref \u003d lr_ref.replace(ovn_lr.name, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9fdfeff1_0c342192","line":566,"range":{"start_line":566,"start_character":27,"end_line":566,"end_character":29},"updated":"2019-01-31 12:37:15.000000000","message":"association was correct before","commit_id":"3b2c6f45814ab0825f187a4086020732c4b06728"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b2b745795ede03ba029d90cf2623445eb5e1560a","unresolved":false,"context_lines":[{"line_number":563,"context_line":""},{"line_number":564,"context_line":"        return commands"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"    def _del_lb_to_lr_assocaition(self, ovn_lb, ovn_lr, lr_ref):"},{"line_number":567,"context_line":"        commands \u003d []"},{"line_number":568,"context_line":"        if lr_ref:"},{"line_number":569,"context_line":"            lr_ref \u003d lr_ref.replace(ovn_lr.name, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9fdfeff1_fc5cd419","line":566,"range":{"start_line":566,"start_character":27,"end_line":566,"end_character":29},"in_reply_to":"9fdfeff1_0c342192","updated":"2019-02-01 13:38:26.000000000","message":"oops","commit_id":"3b2c6f45814ab0825f187a4086020732c4b06728"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"527d82b9be79d9f6129a1ed2ff0f0012974ac586","unresolved":false,"context_lines":[{"line_number":217,"context_line":"LB_EXT_IDS_VIP_KEY \u003d \u0027neutron:vip\u0027"},{"line_number":218,"context_line":"LB_EXT_IDS_VIP_PORT_ID_KEY \u003d \u0027neutron:vip_port_id\u0027"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"# ToDo(Reedip): Try to move Event Handler delete code here and below"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"class LogicalRouterPortEvent(row_event.RowEvent):"}],"source_content_type":"text/x-python","patch_set":35,"id":"9fdfeff1_dceeb0eb","line":220,"range":{"start_line":220,"start_character":7,"end_line":220,"end_character":13},"updated":"2019-02-02 06:39:47.000000000","message":"Need to remove this ToDo once the code is accepted by the reviewers :)","commit_id":"ac3896b020ca0220b6565169918e42ce408388ff"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":41,"context_line":"from networking_ovn.common import utils as ovn_utils"},{"line_number":42,"context_line":"from networking_ovn.ovsdb import ovsdb_monitor"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"import tenacity"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":36,"id":"9fdfeff1_13f84747","line":44,"range":{"start_line":44,"start_character":0,"end_line":44,"end_character":15},"updated":"2019-02-07 17:20:28.000000000","message":"T","commit_id":"104f9bff2969a4fbdc0bbd478991d7f48478fdb6"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"33c3111b772746b07d6d7e27c6e5eda51c1fac53","unresolved":false,"context_lines":[{"line_number":367,"context_line":"        except IndexError:"},{"line_number":368,"context_line":"            return None, None"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":"    def _get_nw_router_info_on_interface_rem(self, row):"},{"line_number":371,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":372,"context_line":"            \u0027Logical_Router_Port\u0027, row.options.get(\u0027router-port\u0027),"},{"line_number":373,"context_line":"            default\u003dNone)"}],"source_content_type":"text/x-python","patch_set":36,"id":"9fdfeff1_be3efcd7","line":370,"range":{"start_line":370,"start_character":8,"end_line":370,"end_character":44},"updated":"2019-02-06 14:55:06.000000000","message":"can we rename this to ..._delete instead of _rem? :)","commit_id":"104f9bff2969a4fbdc0bbd478991d7f48478fdb6"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"33c3111b772746b07d6d7e27c6e5eda51c1fac53","unresolved":false,"context_lines":[{"line_number":383,"context_line":"        except IndexError:"},{"line_number":384,"context_line":"            return None, None"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":387,"context_line":"        commands \u003d []"},{"line_number":388,"context_line":"        router, network \u003d self._get_nw_router_info_on_interface_rem(row)"},{"line_number":389,"context_line":"        if router and network:"}],"source_content_type":"text/x-python","patch_set":36,"id":"9fdfeff1_b90cd63b","line":386,"updated":"2019-02-06 14:55:06.000000000","message":"A comment here would help understand: \"We need to remove all the references to this load balancer on all existing Logical Switches/Routers\".\n\nBTW. Numan and I discussed this and it would be great to change the schema to make lbs being a weak reference so that we don\u0027t need to care about this from networking-ovn and just delete the LB row. Will try to raise this/send a patch to core OVN","commit_id":"104f9bff2969a4fbdc0bbd478991d7f48478fdb6"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"33c3111b772746b07d6d7e27c6e5eda51c1fac53","unresolved":false,"context_lines":[{"line_number":386,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":387,"context_line":"        commands \u003d []"},{"line_number":388,"context_line":"        router, network \u003d self._get_nw_router_info_on_interface_rem(row)"},{"line_number":389,"context_line":"        if router and network:"},{"line_number":390,"context_line":"            nw_lb \u003d set(self._find_lb_in_ls(network\u003dnetwork))"},{"line_number":391,"context_line":"            r_lb \u003d {str(r.uuid) for r in router.load_balancer} - nw_lb"},{"line_number":392,"context_line":"            # Delete all LB on N/W from Router"}],"source_content_type":"text/x-python","patch_set":36,"id":"9fdfeff1_9920f29d","line":389,"range":{"start_line":389,"start_character":8,"end_line":389,"end_character":30},"updated":"2019-02-06 14:55:06.000000000","message":"Couldn\u0027t there be a situation where LB is applied to LSs but not to a LR? ie. I think that the condition should be \"if router or network:\". No?","commit_id":"104f9bff2969a4fbdc0bbd478991d7f48478fdb6"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"33c3111b772746b07d6d7e27c6e5eda51c1fac53","unresolved":false,"context_lines":[{"line_number":424,"context_line":"        if commands:"},{"line_number":425,"context_line":"            self._execute_commands(commands)"},{"line_number":426,"context_line":""},{"line_number":427,"context_line":"    def _find_lb_in_ls(self, network\u003dNone):"},{"line_number":428,"context_line":"        # Find LB associated to a Network"},{"line_number":429,"context_line":"        output \u003d []"},{"line_number":430,"context_line":"        if network:"},{"line_number":431,"context_line":"            try:"},{"line_number":432,"context_line":"                for lb in network.load_balancer:"},{"line_number":433,"context_line":"                    if network.name in lb.external_ids.get("},{"line_number":434,"context_line":"                        LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":435,"context_line":"                        output.append(str(lb.uuid))"},{"line_number":436,"context_line":"                return output"},{"line_number":437,"context_line":"            except TypeError:"},{"line_number":438,"context_line":"                LOG.error(\u0027Network with name %s not found\u0027, str(network.name))"},{"line_number":439,"context_line":"        else:"},{"line_number":440,"context_line":"            LOG.error(\"No Network information passed\")"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":"    def _find_lb_in_ls_using_id(self, lb_id):"},{"line_number":443,"context_line":"        # Find LB associated to a Network"},{"line_number":444,"context_line":"        output \u003d []"},{"line_number":445,"context_line":"        for ls in self.ovn_nbdb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":446,"context_line":"            for lb in ls.load_balancer:"},{"line_number":447,"context_line":"                if str(lb_id) \u003d\u003d str(lb.uuid):"},{"line_number":448,"context_line":"                    output.append(ls)"},{"line_number":449,"context_line":"        return output"},{"line_number":450,"context_line":""},{"line_number":451,"context_line":"    def request_handler(self):"},{"line_number":452,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":36,"id":"9fdfeff1_7ef5f482","line":449,"range":{"start_line":427,"start_character":0,"end_line":449,"end_character":21},"updated":"2019-02-06 14:55:06.000000000","message":"Shouldn\u0027t we move this somewhere else like ovsdb/..?","commit_id":"104f9bff2969a4fbdc0bbd478991d7f48478fdb6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":396,"context_line":"            for loadb in r_lb:"},{"line_number":397,"context_line":"                commands.append(self.ovn_nbdb_api.ls_lb_del("},{"line_number":398,"context_line":"                    network.uuid, loadb))"},{"line_number":399,"context_line":"        if commands:"},{"line_number":400,"context_line":"            self._execute_commands(commands)"},{"line_number":401,"context_line":""},{"line_number":402,"context_line":"    def add_event_handler(self, row, old):"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_30554151","line":399,"range":{"start_line":399,"start_character":8,"end_line":399,"end_character":20},"updated":"2019-02-07 16:33:41.000000000","message":"Kinda of a nit but, I\u0027ve seem this \"if commands: self._execute_commands()\" in many places. I think it\u0027s easier to just add this safe guard to the _execute_commands() method itself, e.g:\n\ndef _execute_commands(commands):\n    if not commands:\n         return\n     ...\n\nSo that you don\u0027t need to keep repeating it over and over each time you have to invoke that method","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":396,"context_line":"            for loadb in r_lb:"},{"line_number":397,"context_line":"                commands.append(self.ovn_nbdb_api.ls_lb_del("},{"line_number":398,"context_line":"                    network.uuid, loadb))"},{"line_number":399,"context_line":"        if commands:"},{"line_number":400,"context_line":"            self._execute_commands(commands)"},{"line_number":401,"context_line":""},{"line_number":402,"context_line":"    def add_event_handler(self, row, old):"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_fefe7f03","line":399,"range":{"start_line":399,"start_character":8,"end_line":399,"end_character":20},"in_reply_to":"9fdfeff1_25f41387","updated":"2019-02-11 16:44:08.000000000","message":"Actually, this isnt required. The acutal definition of _execute_commands actually runs over the list of commands.\nIn case commands is [], no trasnaction would be added and therefore this check for \"if commands\" is redundant here","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"d78d2a53ffe733d5e73db26fb4c049802b919909","unresolved":false,"context_lines":[{"line_number":396,"context_line":"            for loadb in r_lb:"},{"line_number":397,"context_line":"                commands.append(self.ovn_nbdb_api.ls_lb_del("},{"line_number":398,"context_line":"                    network.uuid, loadb))"},{"line_number":399,"context_line":"        if commands:"},{"line_number":400,"context_line":"            self._execute_commands(commands)"},{"line_number":401,"context_line":""},{"line_number":402,"context_line":"    def add_event_handler(self, row, old):"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_25f41387","line":399,"range":{"start_line":399,"start_character":8,"end_line":399,"end_character":20},"in_reply_to":"9fdfeff1_30554151","updated":"2019-02-08 12:53:38.000000000","message":"Will see to it in the next PS","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":413,"context_line":"                    if str(l.uuid) \u003d\u003d lb:"},{"line_number":414,"context_line":"                        commands.extend("},{"line_number":415,"context_line":"                            self._update_lb_to_lr_association("},{"line_number":416,"context_line":"                                self._find_ovn_lb("},{"line_number":417,"context_line":"                                    uuid.UUID(lb), uuid\u003dTrue), router))"},{"line_number":418,"context_line":"                for lb in (router_lb - network_lb):"},{"line_number":419,"context_line":"                    if str(l.uuid) \u003d\u003d lb:"},{"line_number":420,"context_line":"                        commands.append(self.ovn_nbdb_api.ls_lb_add("}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_f091f9f2","line":417,"range":{"start_line":416,"start_character":32,"end_line":417,"end_character":61},"updated":"2019-02-07 16:33:41.000000000","message":"Question: Isn\u0027t \"l\" (the variable from looping lb_list) already a load balance instance ?\n\nI\u0027m wondering why we need to find it again.","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"d78d2a53ffe733d5e73db26fb4c049802b919909","unresolved":false,"context_lines":[{"line_number":413,"context_line":"                    if str(l.uuid) \u003d\u003d lb:"},{"line_number":414,"context_line":"                        commands.extend("},{"line_number":415,"context_line":"                            self._update_lb_to_lr_association("},{"line_number":416,"context_line":"                                self._find_ovn_lb("},{"line_number":417,"context_line":"                                    uuid.UUID(lb), uuid\u003dTrue), router))"},{"line_number":418,"context_line":"                for lb in (router_lb - network_lb):"},{"line_number":419,"context_line":"                    if str(l.uuid) \u003d\u003d lb:"},{"line_number":420,"context_line":"                        commands.append(self.ovn_nbdb_api.ls_lb_add("}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_453a77e7","line":417,"range":{"start_line":416,"start_character":32,"end_line":417,"end_character":61},"in_reply_to":"9fdfeff1_f091f9f2","updated":"2019-02-08 12:53:38.000000000","message":"It is possible to use LB ID in update_lb_to_lr_association","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":434,"context_line":"                return output"},{"line_number":435,"context_line":"            except TypeError:"},{"line_number":436,"context_line":"                LOG.error(\u0027Network with name %s not found\u0027, str(network.name))"},{"line_number":437,"context_line":"        else:"},{"line_number":438,"context_line":"            LOG.error(\"No Network information passed\")"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    def _find_lb_in_ls_using_id(self, lb_id):"},{"line_number":441,"context_line":"        # Find LB associated to a Network"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_f0aa5917","line":438,"range":{"start_line":437,"start_character":0,"end_line":438,"end_character":54},"updated":"2019-02-07 16:33:41.000000000","message":"Let\u0027s make the network parameter mandatory (by removing the default parameter from it)","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"d78d2a53ffe733d5e73db26fb4c049802b919909","unresolved":false,"context_lines":[{"line_number":434,"context_line":"                return output"},{"line_number":435,"context_line":"            except TypeError:"},{"line_number":436,"context_line":"                LOG.error(\u0027Network with name %s not found\u0027, str(network.name))"},{"line_number":437,"context_line":"        else:"},{"line_number":438,"context_line":"            LOG.error(\"No Network information passed\")"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    def _find_lb_in_ls_using_id(self, lb_id):"},{"line_number":441,"context_line":"        # Find LB associated to a Network"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_050d4f3d","line":438,"range":{"start_line":437,"start_character":0,"end_line":438,"end_character":54},"in_reply_to":"9fdfeff1_f0aa5917","updated":"2019-02-08 12:53:38.000000000","message":"Yeah we can doit","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":437,"context_line":"        else:"},{"line_number":438,"context_line":"            LOG.error(\"No Network information passed\")"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    def _find_lb_in_ls_using_id(self, lb_id):"},{"line_number":441,"context_line":"        # Find LB associated to a Network"},{"line_number":442,"context_line":"        output \u003d []"},{"line_number":443,"context_line":"        for ls in self.ovn_nbdb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":444,"context_line":"            for lb in ls.load_balancer:"},{"line_number":445,"context_line":"                if str(lb_id) \u003d\u003d str(lb.uuid):"},{"line_number":446,"context_line":"                    output.append(ls)"},{"line_number":447,"context_line":"        return output"},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"    def _find_lb_in_lr_using_id(self, lb_id):"},{"line_number":450,"context_line":"        # Find LB associated to a Network"},{"line_number":451,"context_line":"        output \u003d []"},{"line_number":452,"context_line":"        for lr in self.ovn_nbdb_api.tables[\u0027Logical_Router\u0027].rows.values():"},{"line_number":453,"context_line":"            for lb in lr.load_balancer:"},{"line_number":454,"context_line":"                if str(lb_id) \u003d\u003d str(lb.uuid):"},{"line_number":455,"context_line":"                    output.append(lr)"},{"line_number":456,"context_line":"        return output"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    def request_handler(self):"},{"line_number":459,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_b0193189","line":456,"range":{"start_line":440,"start_character":0,"end_line":456,"end_character":21},"updated":"2019-02-07 16:33:41.000000000","message":"These two methods contains the same logic, we should abstract it for easy maintenability, what about:\n\ndef _find_lb_using_id(self, lb_id, table):\n    output \u003d []\n    for i in self.ovn_nbdb_api.tables[table].rows.values():\n         for lb on l.load_balance:\n             ...\n\ndef _find_lb_in_ls_using_id(self, lb_id):\n     self._find_lb_using_id(lb_id, \u0027Logical_Switch\u0027)\n\n\ndef _find_lb_in_lr_using_id(self, lb_id):\n     self._find_lb_using_id(lb_id, \u0027Logical_Router\u0027)","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"d78d2a53ffe733d5e73db26fb4c049802b919909","unresolved":false,"context_lines":[{"line_number":437,"context_line":"        else:"},{"line_number":438,"context_line":"            LOG.error(\"No Network information passed\")"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    def _find_lb_in_ls_using_id(self, lb_id):"},{"line_number":441,"context_line":"        # Find LB associated to a Network"},{"line_number":442,"context_line":"        output \u003d []"},{"line_number":443,"context_line":"        for ls in self.ovn_nbdb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":444,"context_line":"            for lb in ls.load_balancer:"},{"line_number":445,"context_line":"                if str(lb_id) \u003d\u003d str(lb.uuid):"},{"line_number":446,"context_line":"                    output.append(ls)"},{"line_number":447,"context_line":"        return output"},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"    def _find_lb_in_lr_using_id(self, lb_id):"},{"line_number":450,"context_line":"        # Find LB associated to a Network"},{"line_number":451,"context_line":"        output \u003d []"},{"line_number":452,"context_line":"        for lr in self.ovn_nbdb_api.tables[\u0027Logical_Router\u0027].rows.values():"},{"line_number":453,"context_line":"            for lb in lr.load_balancer:"},{"line_number":454,"context_line":"                if str(lb_id) \u003d\u003d str(lb.uuid):"},{"line_number":455,"context_line":"                    output.append(lr)"},{"line_number":456,"context_line":"        return output"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    def request_handler(self):"},{"line_number":459,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_3808b626","line":456,"range":{"start_line":440,"start_character":0,"end_line":456,"end_character":21},"in_reply_to":"9fdfeff1_b0193189","updated":"2019-02-08 12:53:38.000000000","message":"Yes, we can do it","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":472,"context_line":"            except Exception as e:"},{"line_number":473,"context_line":"                # If any unexpected exception happens we don\u0027t want the"},{"line_number":474,"context_line":"                # notify_loop to exit."},{"line_number":475,"context_line":"                LOG.exception(\u0027Unexpected exception in request_handler:%s\u0027, e)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    def add_request(self, req):"},{"line_number":478,"context_line":"        self.requests.put(req)"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_930bd722","line":475,"range":{"start_line":475,"start_character":20,"end_line":475,"end_character":29},"updated":"2019-02-07 16:33:41.000000000","message":"LOG.exception() already logs the traceback so we do not need to pass the \"e\" in the message","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"d78d2a53ffe733d5e73db26fb4c049802b919909","unresolved":false,"context_lines":[{"line_number":472,"context_line":"            except Exception as e:"},{"line_number":473,"context_line":"                # If any unexpected exception happens we don\u0027t want the"},{"line_number":474,"context_line":"                # notify_loop to exit."},{"line_number":475,"context_line":"                LOG.exception(\u0027Unexpected exception in request_handler:%s\u0027, e)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    def add_request(self, req):"},{"line_number":478,"context_line":"        self.requests.put(req)"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_f811ce54","line":475,"range":{"start_line":475,"start_character":20,"end_line":475,"end_character":29},"in_reply_to":"9fdfeff1_930bd722","updated":"2019-02-08 12:53:38.000000000","message":"I was appending this exception :)","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":487,"context_line":"            # TODO(numans): Handle the exception properly"},{"line_number":488,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027, e)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uuid\u003dFalse):"},{"line_number":491,"context_line":"        # loadbalancer_id can be either name or uuid. Put uuid\u003dTrue if"},{"line_number":492,"context_line":"        # searching with uuid instead of name"},{"line_number":493,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uuid else ("}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_f334a3e0","line":490,"range":{"start_line":490,"start_character":44,"end_line":490,"end_character":48},"updated":"2019-02-07 16:33:41.000000000","message":"\"uuid\" shares the same name as the standard python library to manipulate uuids (import uuid, which is used in this module). We should name it \"uuid_\" to avoid conflict.\n\nAlso, every time uuid\u003dTrue it means that loadbalance_id is an instance from uuid.UUID() right ?\n\nTo make the interface easier why we just don\u0027t do:\n\nis_uuid \u003d isinstance(loadbalance_id, uuid.UUID)\nfind_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not is_uuid else (...)","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":487,"context_line":"            # TODO(numans): Handle the exception properly"},{"line_number":488,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027, e)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uuid\u003dFalse):"},{"line_number":491,"context_line":"        # loadbalancer_id can be either name or uuid. Put uuid\u003dTrue if"},{"line_number":492,"context_line":"        # searching with uuid instead of name"},{"line_number":493,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uuid else ("}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_5e5eab12","line":490,"range":{"start_line":490,"start_character":44,"end_line":490,"end_character":48},"in_reply_to":"9fdfeff1_d8164a4a","updated":"2019-02-11 16:44:08.000000000","message":"I didnt change much, but changed the uuid param","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"d78d2a53ffe733d5e73db26fb4c049802b919909","unresolved":false,"context_lines":[{"line_number":487,"context_line":"            # TODO(numans): Handle the exception properly"},{"line_number":488,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027, e)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uuid\u003dFalse):"},{"line_number":491,"context_line":"        # loadbalancer_id can be either name or uuid. Put uuid\u003dTrue if"},{"line_number":492,"context_line":"        # searching with uuid instead of name"},{"line_number":493,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uuid else ("}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_d8164a4a","line":490,"range":{"start_line":490,"start_character":44,"end_line":490,"end_character":48},"in_reply_to":"9fdfeff1_f334a3e0","updated":"2019-02-08 12:53:38.000000000","message":"Yeah, can be done","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":514,"context_line":""},{"line_number":515,"context_line":"    def _update_lb_to_ls_association(self, ovn_lb, network_id\u003dNone,"},{"line_number":516,"context_line":"                                     subnet_id\u003dNone, associate\u003dTrue):"},{"line_number":517,"context_line":"        # This function deals with updating the Logical References in LB"},{"line_number":518,"context_line":"        # and addition of LB to LS"},{"line_number":519,"context_line":"        commands \u003d []"},{"line_number":520,"context_line":"        if not network_id and not subnet_id:"},{"line_number":521,"context_line":"            return commands"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_f36263d8","line":518,"range":{"start_line":517,"start_character":2,"end_line":518,"end_character":34},"updated":"2019-02-07 16:33:41.000000000","message":"Should be a docstring","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"d78d2a53ffe733d5e73db26fb4c049802b919909","unresolved":false,"context_lines":[{"line_number":514,"context_line":""},{"line_number":515,"context_line":"    def _update_lb_to_ls_association(self, ovn_lb, network_id\u003dNone,"},{"line_number":516,"context_line":"                                     subnet_id\u003dNone, associate\u003dTrue):"},{"line_number":517,"context_line":"        # This function deals with updating the Logical References in LB"},{"line_number":518,"context_line":"        # and addition of LB to LS"},{"line_number":519,"context_line":"        commands \u003d []"},{"line_number":520,"context_line":"        if not network_id and not subnet_id:"},{"line_number":521,"context_line":"            return commands"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_78271eb8","line":518,"range":{"start_line":517,"start_character":2,"end_line":518,"end_character":34},"in_reply_to":"9fdfeff1_f36263d8","updated":"2019-02-08 12:53:38.000000000","message":"\u0027\u0027\u0027 ok\n\n\u0027\u0027\u0027","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":632,"context_line":"        except IndexError:"},{"line_number":633,"context_line":"            LOG.warning(\u0027Router named %s not found\u0027, lr_name)"},{"line_number":634,"context_line":"        except Exception as e:"},{"line_number":635,"context_line":"            LOG.exception(\u0027Unknown exception occurred : %s\u0027, e)"},{"line_number":636,"context_line":"        return net_ids"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"    def _find_lr_of_ls(self, ovn_ls):"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_9343d713","line":635,"updated":"2019-02-07 16:33:41.000000000","message":"ditto re LOG.exception, passing \"e\" is not needed since it will already print the traceback","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"d78d2a53ffe733d5e73db26fb4c049802b919909","unresolved":false,"context_lines":[{"line_number":632,"context_line":"        except IndexError:"},{"line_number":633,"context_line":"            LOG.warning(\u0027Router named %s not found\u0027, lr_name)"},{"line_number":634,"context_line":"        except Exception as e:"},{"line_number":635,"context_line":"            LOG.exception(\u0027Unknown exception occurred : %s\u0027, e)"},{"line_number":636,"context_line":"        return net_ids"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"    def _find_lr_of_ls(self, ovn_ls):"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_382196a0","line":635,"in_reply_to":"9fdfeff1_9343d713","updated":"2019-02-08 12:53:38.000000000","message":"ok, I just wanted to add a helpful message with the traceback. I think I can overall avoid the try except clause and let the code fail itself.","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":801,"context_line":"        # For now lets report immediately."},{"line_number":802,"context_line":"        except Exception as e:"},{"line_number":803,"context_line":"            LOG.exception(\u0027Unexpected exception during loadbalancer \u0027"},{"line_number":804,"context_line":"                          \u0027create: %s\u0027, e)"},{"line_number":805,"context_line":"            # Any Exception set the status to ERROR"},{"line_number":806,"context_line":"            status \u003d {"},{"line_number":807,"context_line":"                \u0027loadbalancers\u0027: [{\"id\": loadbalancer[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_d3395fa3","line":804,"updated":"2019-02-07 16:33:41.000000000","message":"ditto re LOG.exception, passing \"e\" is not needed since it will already print the traceback","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":801,"context_line":"        # For now lets report immediately."},{"line_number":802,"context_line":"        except Exception as e:"},{"line_number":803,"context_line":"            LOG.exception(\u0027Unexpected exception during loadbalancer \u0027"},{"line_number":804,"context_line":"                          \u0027create: %s\u0027, e)"},{"line_number":805,"context_line":"            # Any Exception set the status to ERROR"},{"line_number":806,"context_line":"            status \u003d {"},{"line_number":807,"context_line":"                \u0027loadbalancers\u0027: [{\"id\": loadbalancer[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_9e92d39e","line":804,"in_reply_to":"9fdfeff1_d3395fa3","updated":"2019-02-11 16:44:08.000000000","message":"Done","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":886,"context_line":"            commands.append(self.ovn_nbdb_api.lb_del(ovn_lb.uuid))"},{"line_number":887,"context_line":"            self._execute_commands(commands)"},{"line_number":888,"context_line":"        except Exception as e:"},{"line_number":889,"context_line":"            LOG.exception(\u0027Exception during load balancer delete: %s\u0027, e)"},{"line_number":890,"context_line":"            status \u003d {"},{"line_number":891,"context_line":"                \u0027loadbalancers\u0027: [{\"id\": loadbalancer[\u0027id\u0027],"},{"line_number":892,"context_line":"                                   \"provisioning_status\": constants.ERROR,"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_d3eb9f0f","line":889,"updated":"2019-02-07 16:33:41.000000000","message":"ditto re LOG.exception, passing \"e\" is not needed since it will already print the traceback","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":886,"context_line":"            commands.append(self.ovn_nbdb_api.lb_del(ovn_lb.uuid))"},{"line_number":887,"context_line":"            self._execute_commands(commands)"},{"line_number":888,"context_line":"        except Exception as e:"},{"line_number":889,"context_line":"            LOG.exception(\u0027Exception during load balancer delete: %s\u0027, e)"},{"line_number":890,"context_line":"            status \u003d {"},{"line_number":891,"context_line":"                \u0027loadbalancers\u0027: [{\"id\": loadbalancer[\u0027id\u0027],"},{"line_number":892,"context_line":"                                   \"provisioning_status\": constants.ERROR,"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_7e97ef91","line":889,"in_reply_to":"9fdfeff1_d3eb9f0f","updated":"2019-02-11 16:44:08.000000000","message":"Done","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":929,"context_line":"                operating_status \u003d constants.OFFLINE"},{"line_number":930,"context_line":"            lb_status[\u0027operating_status\u0027] \u003d operating_status"},{"line_number":931,"context_line":"        except Exception as e:"},{"line_number":932,"context_line":"            LOG.exception(\u0027Exception during loadbalancer update: %s\u0027, e)"},{"line_number":933,"context_line":"            lb_status[\u0027provisioning_status\u0027] \u003d constants.ERROR"},{"line_number":934,"context_line":"            lb_status[\u0027operating_status\u0027] \u003d constants.ERROR"},{"line_number":935,"context_line":""}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_73f2f308","line":932,"updated":"2019-02-07 16:33:41.000000000","message":"ditto re LOG.exception, passing \"e\" is not needed since it will already print the traceback","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":929,"context_line":"                operating_status \u003d constants.OFFLINE"},{"line_number":930,"context_line":"            lb_status[\u0027operating_status\u0027] \u003d operating_status"},{"line_number":931,"context_line":"        except Exception as e:"},{"line_number":932,"context_line":"            LOG.exception(\u0027Exception during loadbalancer update: %s\u0027, e)"},{"line_number":933,"context_line":"            lb_status[\u0027provisioning_status\u0027] \u003d constants.ERROR"},{"line_number":934,"context_line":"            lb_status[\u0027operating_status\u0027] \u003d constants.ERROR"},{"line_number":935,"context_line":""}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_5e8c6b7e","line":932,"in_reply_to":"9fdfeff1_73f2f308","updated":"2019-02-11 16:44:08.000000000","message":"Done","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":977,"context_line":"                \u0027loadbalancers\u0027: [{\"id\": listener[\u0027loadbalancer_id\u0027],"},{"line_number":978,"context_line":"                                   \"provisioning_status\": constants.ACTIVE}]}"},{"line_number":979,"context_line":"        except Exception as e:"},{"line_number":980,"context_line":"            LOG.exception(\u0027Exception during listener create: %s\u0027, e)"},{"line_number":981,"context_line":"            status \u003d {"},{"line_number":982,"context_line":"                \u0027listeners\u0027: [{\"id\": listener[\u0027id\u0027],"},{"line_number":983,"context_line":"                               \"provisioning_status\": constants.ERROR,"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_93f517f0","line":980,"updated":"2019-02-07 16:33:41.000000000","message":"ditto re LOG.exception, passing \"e\" is not needed since it will already print the traceback","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":977,"context_line":"                \u0027loadbalancers\u0027: [{\"id\": listener[\u0027loadbalancer_id\u0027],"},{"line_number":978,"context_line":"                                   \"provisioning_status\": constants.ACTIVE}]}"},{"line_number":979,"context_line":"        except Exception as e:"},{"line_number":980,"context_line":"            LOG.exception(\u0027Exception during listener create: %s\u0027, e)"},{"line_number":981,"context_line":"            status \u003d {"},{"line_number":982,"context_line":"                \u0027listeners\u0027: [{\"id\": listener[\u0027id\u0027],"},{"line_number":983,"context_line":"                               \"provisioning_status\": constants.ERROR,"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_def5bbee","line":980,"in_reply_to":"9fdfeff1_93f517f0","updated":"2019-02-11 16:44:08.000000000","message":"Done","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":1014,"context_line":"                \u0027loadbalancers\u0027: [{\"id\": listener[\u0027loadbalancer_id\u0027],"},{"line_number":1015,"context_line":"                                   \"provisioning_status\": constants.ACTIVE}]}"},{"line_number":1016,"context_line":"        except Exception as e:"},{"line_number":1017,"context_line":"            LOG.exception(\u0027Exception during listener delete:%s\u0027, e)"},{"line_number":1018,"context_line":"            status \u003d {"},{"line_number":1019,"context_line":"                \u0027listeners\u0027: [{\"id\": listener[\u0027id\u0027],"},{"line_number":1020,"context_line":"                               \"provisioning_status\": constants.ERROR,"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_33dc6b73","line":1017,"updated":"2019-02-07 16:33:41.000000000","message":"ditto re LOG.exception, passing \"e\" is not needed since it will already print the traceback","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":1014,"context_line":"                \u0027loadbalancers\u0027: [{\"id\": listener[\u0027loadbalancer_id\u0027],"},{"line_number":1015,"context_line":"                                   \"provisioning_status\": constants.ACTIVE}]}"},{"line_number":1016,"context_line":"        except Exception as e:"},{"line_number":1017,"context_line":"            LOG.exception(\u0027Exception during listener delete:%s\u0027, e)"},{"line_number":1018,"context_line":"            status \u003d {"},{"line_number":1019,"context_line":"                \u0027listeners\u0027: [{\"id\": listener[\u0027id\u0027],"},{"line_number":1020,"context_line":"                               \"provisioning_status\": constants.ERROR,"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_3ee64746","line":1017,"in_reply_to":"9fdfeff1_33dc6b73","updated":"2019-02-11 16:44:08.000000000","message":"Done","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":1102,"context_line":"                self._refresh_lb_vips(ovn_lb.uuid, external_ids))"},{"line_number":1103,"context_line":"            self._execute_commands(commands)"},{"line_number":1104,"context_line":"        except Exception as e:"},{"line_number":1105,"context_line":"            LOG.exception(\u0027Exception during listener update: %s\u0027, e)"},{"line_number":1106,"context_line":"            status \u003d {"},{"line_number":1107,"context_line":"                \u0027listeners\u0027: [{\u0027id\u0027: listener[\u0027id\u0027],"},{"line_number":1108,"context_line":"                               \u0027provisioning_status\u0027: constants.ERROR}],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_53d7af50","line":1105,"updated":"2019-02-07 16:33:41.000000000","message":"ditto re LOG.exception, passing \"e\" is not needed since it will already print the traceback","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":1102,"context_line":"                self._refresh_lb_vips(ovn_lb.uuid, external_ids))"},{"line_number":1103,"context_line":"            self._execute_commands(commands)"},{"line_number":1104,"context_line":"        except Exception as e:"},{"line_number":1105,"context_line":"            LOG.exception(\u0027Exception during listener update: %s\u0027, e)"},{"line_number":1106,"context_line":"            status \u003d {"},{"line_number":1107,"context_line":"                \u0027listeners\u0027: [{\u0027id\u0027: listener[\u0027id\u0027],"},{"line_number":1108,"context_line":"                               \u0027provisioning_status\u0027: constants.ERROR}],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_fe367fb4","line":1105,"in_reply_to":"9fdfeff1_53d7af50","updated":"2019-02-11 16:44:08.000000000","message":"Done","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":1141,"context_line":"                                    \u0027provisioning_status\u0027: constants.ACTIVE}]"},{"line_number":1142,"context_line":"                status[\u0027listeners\u0027] \u003d listener_status"},{"line_number":1143,"context_line":"        except Exception as e:"},{"line_number":1144,"context_line":"            LOG.exception(\u0027Exception during pool create: %s\u0027, e)"},{"line_number":1145,"context_line":"            status \u003d {"},{"line_number":1146,"context_line":"                \u0027pools\u0027: [{\"id\": pool[\u0027id\u0027],"},{"line_number":1147,"context_line":"                           \"provisioning_status\": constants.ERROR}],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_13e1272b","line":1144,"updated":"2019-02-07 16:33:41.000000000","message":"ditto re LOG.exception, passing \"e\" is not needed since it will already print the traceback","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":1201,"context_line":"                    \u0027id\u0027: listener_id,"},{"line_number":1202,"context_line":"                    \u0027provisioning_status\u0027: constants.ACTIVE}]"},{"line_number":1203,"context_line":"        except Exception as e:"},{"line_number":1204,"context_line":"            LOG.exception(\u0027Exception during pool delete:%s\u0027, e)"},{"line_number":1205,"context_line":"            status \u003d {"},{"line_number":1206,"context_line":"                \u0027pools\u0027: [{\"id\": pool[\u0027id\u0027],"},{"line_number":1207,"context_line":"                           \"provisioning_status\": constants.ERROR}],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_d3d4ff49","line":1204,"updated":"2019-02-07 16:33:41.000000000","message":"ditto re LOG.exception, passing \"e\" is not needed since it will already print the traceback","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":1201,"context_line":"                    \u0027id\u0027: listener_id,"},{"line_number":1202,"context_line":"                    \u0027provisioning_status\u0027: constants.ACTIVE}]"},{"line_number":1203,"context_line":"        except Exception as e:"},{"line_number":1204,"context_line":"            LOG.exception(\u0027Exception during pool delete:%s\u0027, e)"},{"line_number":1205,"context_line":"            status \u003d {"},{"line_number":1206,"context_line":"                \u0027pools\u0027: [{\"id\": pool[\u0027id\u0027],"},{"line_number":1207,"context_line":"                           \"provisioning_status\": constants.ERROR}],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_1e3a6397","line":1204,"in_reply_to":"9fdfeff1_d3d4ff49","updated":"2019-02-11 16:44:08.000000000","message":"Done","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":1274,"context_line":"                     \u0027provisioning_status\u0027: constants.ACTIVE})"},{"line_number":1275,"context_line":"            status[\u0027listeners\u0027] \u003d listener_status"},{"line_number":1276,"context_line":"        except Exception as e:"},{"line_number":1277,"context_line":"            LOG.exception(\u0027Exception during pool delete: %s\u0027, e)"},{"line_number":1278,"context_line":"            status \u003d {"},{"line_number":1279,"context_line":"                \u0027pools\u0027: [{\"id\": pool[\u0027id\u0027],"},{"line_number":1280,"context_line":"                           \u0027provisioning_status\u0027: constants.ERROR}],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_73cbd3a4","line":1277,"updated":"2019-02-07 16:33:41.000000000","message":"ditto re LOG.exception, passing \"e\" is not needed since it will already print the traceback","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":1274,"context_line":"                     \u0027provisioning_status\u0027: constants.ACTIVE})"},{"line_number":1275,"context_line":"            status[\u0027listeners\u0027] \u003d listener_status"},{"line_number":1276,"context_line":"        except Exception as e:"},{"line_number":1277,"context_line":"            LOG.exception(\u0027Exception during pool delete: %s\u0027, e)"},{"line_number":1278,"context_line":"            status \u003d {"},{"line_number":1279,"context_line":"                \u0027pools\u0027: [{\"id\": pool[\u0027id\u0027],"},{"line_number":1280,"context_line":"                           \u0027provisioning_status\u0027: constants.ERROR}],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_be40f708","line":1277,"in_reply_to":"9fdfeff1_73cbd3a4","updated":"2019-02-11 16:44:08.000000000","message":"Done","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":1336,"context_line":"                     \u0027provisioning_status\u0027: constants.ACTIVE})"},{"line_number":1337,"context_line":"            status[\u0027listeners\u0027] \u003d listener_status"},{"line_number":1338,"context_line":"        except Exception as e:"},{"line_number":1339,"context_line":"            LOG.exception(\u0027Exception during member create: %s\u0027, e)"},{"line_number":1340,"context_line":"            status \u003d {"},{"line_number":1341,"context_line":"                \u0027pools\u0027: [{\"id\": member[\u0027pool_id\u0027],"},{"line_number":1342,"context_line":"                           \"provisioning_status\": constants.ERROR}],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_33c54b8f","line":1339,"updated":"2019-02-07 16:33:41.000000000","message":"ditto re LOG.exception, passing \"e\" is not needed since it will already print the traceback","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":1394,"context_line":"                     \u0027provisioning_status\u0027: constants.ACTIVE})"},{"line_number":1395,"context_line":"            status[\u0027listeners\u0027] \u003d listener_status"},{"line_number":1396,"context_line":"        except Exception as e:"},{"line_number":1397,"context_line":"            LOG.exception(\u0027Exception during member delete:%s\u0027, e)"},{"line_number":1398,"context_line":"            status \u003d {"},{"line_number":1399,"context_line":"                \u0027pools\u0027: [{\"id\": member[\u0027pool_id\u0027],"},{"line_number":1400,"context_line":"                           \"provisioning_status\": constants.ACTIVE}],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_53c00f7d","line":1397,"updated":"2019-02-07 16:33:41.000000000","message":"ditto re LOG.exception, passing \"e\" is not needed since it will already print the traceback","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":1394,"context_line":"                     \u0027provisioning_status\u0027: constants.ACTIVE})"},{"line_number":1395,"context_line":"            status[\u0027listeners\u0027] \u003d listener_status"},{"line_number":1396,"context_line":"        except Exception as e:"},{"line_number":1397,"context_line":"            LOG.exception(\u0027Exception during member delete:%s\u0027, e)"},{"line_number":1398,"context_line":"            status \u003d {"},{"line_number":1399,"context_line":"                \u0027pools\u0027: [{\"id\": member[\u0027pool_id\u0027],"},{"line_number":1400,"context_line":"                           \"provisioning_status\": constants.ACTIVE}],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_7e4a8f27","line":1397,"in_reply_to":"9fdfeff1_53c00f7d","updated":"2019-02-11 16:44:08.000000000","message":"Done","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d401e1ae82b8a6ed63600d863c5b7f45b06ca76d","unresolved":false,"context_lines":[{"line_number":1439,"context_line":"                     \u0027provisioning_status\u0027: constants.ACTIVE})"},{"line_number":1440,"context_line":"            status[\u0027listeners\u0027] \u003d listener_status"},{"line_number":1441,"context_line":"        except Exception as e:"},{"line_number":1442,"context_line":"            LOG.error(\"Exception occurred during Member Update:%s\", e)"},{"line_number":1443,"context_line":"            status \u003d {"},{"line_number":1444,"context_line":"                \u0027pools\u0027: [{\u0027id\u0027: member[\u0027pool_id\u0027],"},{"line_number":1445,"context_line":"                           \u0027provisioning_status\u0027: constants.ACTIVE}],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_f3bee3fd","line":1442,"updated":"2019-02-07 16:33:41.000000000","message":"ditto re LOG.exception, passing \"e\" is not needed since it will already print the traceback","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":1439,"context_line":"                     \u0027provisioning_status\u0027: constants.ACTIVE})"},{"line_number":1440,"context_line":"            status[\u0027listeners\u0027] \u003d listener_status"},{"line_number":1441,"context_line":"        except Exception as e:"},{"line_number":1442,"context_line":"            LOG.error(\"Exception occurred during Member Update:%s\", e)"},{"line_number":1443,"context_line":"            status \u003d {"},{"line_number":1444,"context_line":"                \u0027pools\u0027: [{\u0027id\u0027: member[\u0027pool_id\u0027],"},{"line_number":1445,"context_line":"                           \u0027provisioning_status\u0027: constants.ACTIVE}],"}],"source_content_type":"text/x-python","patch_set":38,"id":"9fdfeff1_de437b12","line":1442,"in_reply_to":"9fdfeff1_f3bee3fd","updated":"2019-02-11 16:44:08.000000000","message":"Done","commit_id":"8c4d32c4532e9ea682cd9407f2b41c46c4cf9626"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":41,"context_line":"from networking_ovn.common import utils as ovn_utils"},{"line_number":42,"context_line":"from networking_ovn.ovsdb import ovsdb_monitor"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"import tenacity"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_53ac8f34","line":44,"range":{"start_line":44,"start_character":0,"end_line":44,"end_character":15},"updated":"2019-02-07 17:20:28.000000000","message":"Weird \nhttps://docs.openstack.org/hacking/latest/user/hacking.html#imports\n\n{{stdlib imports in human alphabetical order}}\n\\n\n{{third-party lib imports in human alphabetical order}}\n\\n\n{{project imports in human alphabetical order}}\n\\n\n\\n\n{{begin your code}}","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":41,"context_line":"from networking_ovn.common import utils as ovn_utils"},{"line_number":42,"context_line":"from networking_ovn.ovsdb import ovsdb_monitor"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"import tenacity"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_5e3ea629","line":44,"range":{"start_line":44,"start_character":0,"end_line":44,"end_character":15},"in_reply_to":"9fdfeff1_53ac8f34","updated":"2019-02-11 16:44:08.000000000","message":"Works ... :)","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":345,"context_line":"        LogicalSwitchPortEvent.set_driver(self)"},{"line_number":346,"context_line":"        self.helper_thread.start()"},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"    def _get_nw_router_info_on_interface_add(self, row):"},{"line_number":349,"context_line":"        network \u003d None"},{"line_number":350,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, ovn_utils.ovn_name(row.external_ids.get("},{"line_number":351,"context_line":"            ovn_const.NEUTRON_ROUTER_NAME)))"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_f3582357","line":348,"range":{"start_line":348,"start_character":51,"end_line":348,"end_character":54},"updated":"2019-02-07 17:20:28.000000000","message":"What would this be?","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":345,"context_line":"        LogicalSwitchPortEvent.set_driver(self)"},{"line_number":346,"context_line":"        self.helper_thread.start()"},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"    def _get_nw_router_info_on_interface_add(self, row):"},{"line_number":349,"context_line":"        network \u003d None"},{"line_number":350,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, ovn_utils.ovn_name(row.external_ids.get("},{"line_number":351,"context_line":"            ovn_const.NEUTRON_ROUTER_NAME)))"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_9e596eff","line":348,"range":{"start_line":348,"start_character":51,"end_line":348,"end_character":54},"in_reply_to":"9fdfeff1_f3582357","updated":"2019-02-11 16:44:08.000000000","message":"A row event generated by an action of Adding/deleting a subnet from a router","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":362,"context_line":"                    ovn_const.NEUTRON_NET_NAME), default\u003dNone)"},{"line_number":363,"context_line":"        try:"},{"line_number":364,"context_line":"            return router[0], network[0]"},{"line_number":365,"context_line":"        except IndexError:"},{"line_number":366,"context_line":"            return None, None"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    def _get_nw_router_info_on_interface_rem(self, row):"},{"line_number":369,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_137b67be","line":366,"range":{"start_line":365,"start_character":7,"end_line":366,"end_character":29},"updated":"2019-02-07 17:20:28.000000000","message":"I don\u0027t get this, if we have a LS hosting this LB but no LR is hosting it you\u0027ll still hit IndexError and return None, None. It should be possible to apply the LB only to a LS even without a router right?\nA docstring will be useful to understand what\u0027s expected and unit tests for this.","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":362,"context_line":"                    ovn_const.NEUTRON_NET_NAME), default\u003dNone)"},{"line_number":363,"context_line":"        try:"},{"line_number":364,"context_line":"            return router[0], network[0]"},{"line_number":365,"context_line":"        except IndexError:"},{"line_number":366,"context_line":"            return None, None"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    def _get_nw_router_info_on_interface_rem(self, row):"},{"line_number":369,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_fe08ba91","line":366,"range":{"start_line":365,"start_character":7,"end_line":366,"end_character":29},"in_reply_to":"9fdfeff1_137b67be","updated":"2019-02-11 16:44:08.000000000","message":"Loadbalancer is not in focus in the code above :)\nThe above code occurs when a subnet is added to a router.\nThe Lin#352 here will just return Router ID on which the subnet is being added. And the LSP is basically returning the Logical Switch/Subnet which is added to the Router. Generally we shouldnt even reach the Line#365. Should I raise an exception here?","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":362,"context_line":"                    ovn_const.NEUTRON_NET_NAME), default\u003dNone)"},{"line_number":363,"context_line":"        try:"},{"line_number":364,"context_line":"            return router[0], network[0]"},{"line_number":365,"context_line":"        except IndexError:"},{"line_number":366,"context_line":"            return None, None"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    def _get_nw_router_info_on_interface_rem(self, row):"},{"line_number":369,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_fea3daaf","line":366,"range":{"start_line":365,"start_character":7,"end_line":366,"end_character":29},"in_reply_to":"9fdfeff1_137b67be","updated":"2019-02-11 16:44:08.000000000","message":"The event is raised when a Subnet is added to a router.\nIf there is a LB on a Logical Switch but not on any router,","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":365,"context_line":"        except IndexError:"},{"line_number":366,"context_line":"            return None, None"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    def _get_nw_router_info_on_interface_rem(self, row):"},{"line_number":369,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":370,"context_line":"            \u0027Logical_Router_Port\u0027, row.options.get(\u0027router-port\u0027),"},{"line_number":371,"context_line":"            default\u003dNone)"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_6621d39f","line":368,"range":{"start_line":368,"start_character":8,"end_line":368,"end_character":44},"updated":"2019-02-07 17:20:28.000000000","message":"I think i commented this earlier, \u0027delete\u0027 by \u0027rem\u0027 would seem more clear. Problem with not addressing the comments is that reviewers need to go over the same stuff again :)","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":365,"context_line":"        except IndexError:"},{"line_number":366,"context_line":"            return None, None"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    def _get_nw_router_info_on_interface_rem(self, row):"},{"line_number":369,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":370,"context_line":"            \u0027Logical_Router_Port\u0027, row.options.get(\u0027router-port\u0027),"},{"line_number":371,"context_line":"            default\u003dNone)"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_1ef33ea0","line":368,"range":{"start_line":368,"start_character":8,"end_line":368,"end_character":44},"in_reply_to":"9fdfeff1_6621d39f","updated":"2019-02-11 16:44:08.000000000","message":"I didnt see it. Will rewrite it to delete here","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":379,"context_line":"        try:"},{"line_number":380,"context_line":"            return router[0], network[0]"},{"line_number":381,"context_line":"        except IndexError:"},{"line_number":382,"context_line":"            return None, None"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":385,"context_line":"        commands \u003d []"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_8624f7b0","line":382,"updated":"2019-02-07 17:20:28.000000000","message":"ditto","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":379,"context_line":"        try:"},{"line_number":380,"context_line":"            return router[0], network[0]"},{"line_number":381,"context_line":"        except IndexError:"},{"line_number":382,"context_line":"            return None, None"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":385,"context_line":"        commands \u003d []"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_3eee42b4","line":382,"in_reply_to":"9fdfeff1_8624f7b0","updated":"2019-02-11 16:44:08.000000000","message":"Ditto :)","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        if commands:"},{"line_number":423,"context_line":"            self._execute_commands(commands)"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    def _find_lb_in_ls(self, network\u003dNone):"},{"line_number":426,"context_line":"        # Find LB associated to a Network"},{"line_number":427,"context_line":"        output \u003d []"},{"line_number":428,"context_line":"        if network:"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_46a92fdb","line":425,"range":{"start_line":425,"start_character":29,"end_line":425,"end_character":41},"updated":"2019-02-07 17:20:28.000000000","message":"Why make it optional? doesn\u0027t make sense to call this function to try to get the network LBs without a network.","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        if commands:"},{"line_number":423,"context_line":"            self._execute_commands(commands)"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    def _find_lb_in_ls(self, network\u003dNone):"},{"line_number":426,"context_line":"        # Find LB associated to a Network"},{"line_number":427,"context_line":"        output \u003d []"},{"line_number":428,"context_line":"        if network:"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_fe2d1f46","line":425,"range":{"start_line":425,"start_character":29,"end_line":425,"end_character":41},"in_reply_to":"9fdfeff1_46a92fdb","updated":"2019-02-11 16:44:08.000000000","message":"Done","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":432,"context_line":"                        LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":433,"context_line":"                        output.append(str(lb.uuid))"},{"line_number":434,"context_line":"                return output"},{"line_number":435,"context_line":"            except TypeError:"},{"line_number":436,"context_line":"                LOG.error(\u0027Network with name %s not found\u0027, str(network.name))"},{"line_number":437,"context_line":"        else:"},{"line_number":438,"context_line":"            LOG.error(\"No Network information passed\")"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_c69d1fbc","line":435,"range":{"start_line":435,"start_character":19,"end_line":435,"end_character":28},"updated":"2019-02-07 17:20:28.000000000","message":"This is a bit obscure, if some lb.external_ids.get fails for just one LB of the logical switch, then a trace will be logged and nothing will happen, you\u0027ll be returning None (not an empty list). Again docstring would help and you may consider raising exception and handling it in callers","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":432,"context_line":"                        LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":433,"context_line":"                        output.append(str(lb.uuid))"},{"line_number":434,"context_line":"                return output"},{"line_number":435,"context_line":"            except TypeError:"},{"line_number":436,"context_line":"                LOG.error(\u0027Network with name %s not found\u0027, str(network.name))"},{"line_number":437,"context_line":"        else:"},{"line_number":438,"context_line":"            LOG.error(\"No Network information passed\")"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_5e55464f","line":435,"range":{"start_line":435,"start_character":19,"end_line":435,"end_character":28},"in_reply_to":"9fdfeff1_c69d1fbc","updated":"2019-02-11 16:44:08.000000000","message":"I can raise an exception here instead of just a LOG.error.\nWhat do you think?","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":469,"context_line":"                    if status:"},{"line_number":470,"context_line":"                        self._update_status_to_octavia(status)"},{"line_number":471,"context_line":"                self.requests.task_done()"},{"line_number":472,"context_line":"            except Exception as e:"},{"line_number":473,"context_line":"                # If any unexpected exception happens we don\u0027t want the"},{"line_number":474,"context_line":"                # notify_loop to exit."},{"line_number":475,"context_line":"                LOG.exception(\u0027Unexpected exception in request_handler:%s\u0027, e)"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_e6b7033a","line":472,"range":{"start_line":472,"start_character":31,"end_line":472,"end_character":33},"updated":"2019-02-07 17:20:28.000000000","message":"not needed","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":469,"context_line":"                    if status:"},{"line_number":470,"context_line":"                        self._update_status_to_octavia(status)"},{"line_number":471,"context_line":"                self.requests.task_done()"},{"line_number":472,"context_line":"            except Exception as e:"},{"line_number":473,"context_line":"                # If any unexpected exception happens we don\u0027t want the"},{"line_number":474,"context_line":"                # notify_loop to exit."},{"line_number":475,"context_line":"                LOG.exception(\u0027Unexpected exception in request_handler:%s\u0027, e)"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_be279764","line":472,"range":{"start_line":472,"start_character":31,"end_line":472,"end_character":33},"in_reply_to":"9fdfeff1_e6b7033a","updated":"2019-02-11 16:44:08.000000000","message":"Done","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":488,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027, e)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uuid\u003dFalse):"},{"line_number":491,"context_line":"        # loadbalancer_id can be either name or uuid. Put uuid\u003dTrue if"},{"line_number":492,"context_line":"        # searching with uuid instead of name"},{"line_number":493,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uuid else ("},{"line_number":494,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"},{"line_number":495,"context_line":"        # ToDo(Reedip): You can use lookup here instead of db_find"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_c6867f66","line":492,"range":{"start_line":491,"start_character":8,"end_line":492,"end_character":45},"updated":"2019-02-07 17:20:28.000000000","message":"We could do this automatic,  we do this in a bunch of places ie. figuring out if the arg is an uuid or a name.","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"78b27dcbe4adf6f42a278fac75d697625c07d964","unresolved":false,"context_lines":[{"line_number":488,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027, e)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uuid\u003dFalse):"},{"line_number":491,"context_line":"        # loadbalancer_id can be either name or uuid. Put uuid\u003dTrue if"},{"line_number":492,"context_line":"        # searching with uuid instead of name"},{"line_number":493,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uuid else ("},{"line_number":494,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"},{"line_number":495,"context_line":"        # ToDo(Reedip): You can use lookup here instead of db_find"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_c53e2cb7","line":492,"range":{"start_line":491,"start_character":8,"end_line":492,"end_character":45},"in_reply_to":"9fdfeff1_9e45ee72","updated":"2019-02-12 17:43:15.000000000","message":"I still don\u0027t understand why we don\u0027t just use api.lookup() instead of doing a db_find. It is literally for looking up by name or uuid.","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"4a08d03f0e55dcd6d3e8935daf302928c3216117","unresolved":false,"context_lines":[{"line_number":488,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027, e)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uuid\u003dFalse):"},{"line_number":491,"context_line":"        # loadbalancer_id can be either name or uuid. Put uuid\u003dTrue if"},{"line_number":492,"context_line":"        # searching with uuid instead of name"},{"line_number":493,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uuid else ("},{"line_number":494,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"},{"line_number":495,"context_line":"        # ToDo(Reedip): You can use lookup here instead of db_find"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_8a849f5f","line":492,"range":{"start_line":491,"start_character":8,"end_line":492,"end_character":45},"in_reply_to":"9fdfeff1_c53e2cb7","updated":"2019-02-13 10:50:07.000000000","message":"Let me try this out once","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":488,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027, e)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uuid\u003dFalse):"},{"line_number":491,"context_line":"        # loadbalancer_id can be either name or uuid. Put uuid\u003dTrue if"},{"line_number":492,"context_line":"        # searching with uuid instead of name"},{"line_number":493,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uuid else ("},{"line_number":494,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"},{"line_number":495,"context_line":"        # ToDo(Reedip): You can use lookup here instead of db_find"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_9e45ee72","line":492,"range":{"start_line":491,"start_character":8,"end_line":492,"end_character":45},"in_reply_to":"9fdfeff1_c6867f66","updated":"2019-02-11 16:44:08.000000000","message":"We can do that, but I think the code isnt wrong as of now","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":496,"context_line":"        ovn_lb \u003d self.ovn_nbdb_api.db_find("},{"line_number":497,"context_line":"            \u0027Load_Balancer\u0027, find_condition, row\u003dTrue).execute("},{"line_number":498,"context_line":"                check_error\u003dTrue)"},{"line_number":499,"context_line":"        if len(ovn_lb) \u003e 1:"},{"line_number":500,"context_line":"            LOG.warning(\"Two or more load balancer named \u0027%s\u0027 \""},{"line_number":501,"context_line":"                        \"have been found in the database\" % loadbalancer_id)"},{"line_number":502,"context_line":"        return ovn_lb[0] if len(ovn_lb) \u003d\u003d 1 else None"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_c6ebdf0f","line":499,"range":{"start_line":499,"start_character":8,"end_line":499,"end_character":26},"updated":"2019-02-07 17:20:28.000000000","message":"Is this possible?\nWouldn\u0027t it be better to raise an exception instead of returning None if there\u0027s more than 1 LB with the same name? If it\u0027s possible,  I would raise an exception and let the caller figure out or search by uuid or...","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":496,"context_line":"        ovn_lb \u003d self.ovn_nbdb_api.db_find("},{"line_number":497,"context_line":"            \u0027Load_Balancer\u0027, find_condition, row\u003dTrue).execute("},{"line_number":498,"context_line":"                check_error\u003dTrue)"},{"line_number":499,"context_line":"        if len(ovn_lb) \u003e 1:"},{"line_number":500,"context_line":"            LOG.warning(\"Two or more load balancer named \u0027%s\u0027 \""},{"line_number":501,"context_line":"                        \"have been found in the database\" % loadbalancer_id)"},{"line_number":502,"context_line":"        return ovn_lb[0] if len(ovn_lb) \u003d\u003d 1 else None"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_3e1ba71b","line":499,"range":{"start_line":499,"start_character":8,"end_line":499,"end_character":26},"in_reply_to":"9fdfeff1_c6ebdf0f","updated":"2019-02-11 16:44:08.000000000","message":"Ok, I can return Exception here","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":514,"context_line":""},{"line_number":515,"context_line":"    def _update_lb_to_ls_association(self, ovn_lb, network_id\u003dNone,"},{"line_number":516,"context_line":"                                     subnet_id\u003dNone, associate\u003dTrue):"},{"line_number":517,"context_line":"        # This function deals with updating the Logical References in LB"},{"line_number":518,"context_line":"        # and addition of LB to LS"},{"line_number":519,"context_line":"        commands \u003d []"},{"line_number":520,"context_line":"        if not network_id and not subnet_id:"},{"line_number":521,"context_line":"            return commands"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_c6399fa3","line":518,"range":{"start_line":517,"start_character":7,"end_line":518,"end_character":34},"updated":"2019-02-07 17:20:28.000000000","message":"I don\u0027t understand the comment. What are \u0027Logical References\u0027? I guess you mean that this method will update the \u0027LB_EXT_IDS_LS_REFS_KEY\u0027 external id for the Load Balancer and will add it to the Logical Switch corresponding to the Neutron Network passed?","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":514,"context_line":""},{"line_number":515,"context_line":"    def _update_lb_to_ls_association(self, ovn_lb, network_id\u003dNone,"},{"line_number":516,"context_line":"                                     subnet_id\u003dNone, associate\u003dTrue):"},{"line_number":517,"context_line":"        # This function deals with updating the Logical References in LB"},{"line_number":518,"context_line":"        # and addition of LB to LS"},{"line_number":519,"context_line":"        commands \u003d []"},{"line_number":520,"context_line":"        if not network_id and not subnet_id:"},{"line_number":521,"context_line":"            return commands"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_1e2edea4","line":518,"range":{"start_line":517,"start_character":7,"end_line":518,"end_character":34},"in_reply_to":"9fdfeff1_c6399fa3","updated":"2019-02-11 16:44:08.000000000","message":"Done","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":865,"context_line":"                    commands.append("},{"line_number":866,"context_line":"                        self.ovn_nbdb_api.ls_lb_del(ovn_ls.uuid, ovn_lb.uuid)"},{"line_number":867,"context_line":"                    )"},{"line_number":868,"context_line":"            # Delete LoadBalancer from all Networks its indirectly associated"},{"line_number":869,"context_line":"            for ls in self._find_lb_in_ls_using_id(ovn_lb.uuid):"},{"line_number":870,"context_line":"                commands.append("},{"line_number":871,"context_line":"                    self.ovn_nbdb_api.ls_lb_del(ls.uuid, ovn_lb.uuid,"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_46ca8f6e","line":868,"range":{"start_line":868,"start_character":52,"end_line":868,"end_character":55},"updated":"2019-02-07 17:20:28.000000000","message":"nit nit: which this LB is","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":865,"context_line":"                    commands.append("},{"line_number":866,"context_line":"                        self.ovn_nbdb_api.ls_lb_del(ovn_ls.uuid, ovn_lb.uuid)"},{"line_number":867,"context_line":"                    )"},{"line_number":868,"context_line":"            # Delete LoadBalancer from all Networks its indirectly associated"},{"line_number":869,"context_line":"            for ls in self._find_lb_in_ls_using_id(ovn_lb.uuid):"},{"line_number":870,"context_line":"                commands.append("},{"line_number":871,"context_line":"                    self.ovn_nbdb_api.ls_lb_del(ls.uuid, ovn_lb.uuid,"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_de193688","line":868,"range":{"start_line":868,"start_character":52,"end_line":868,"end_character":55},"in_reply_to":"9fdfeff1_46ca8f6e","updated":"2019-02-11 16:44:08.000000000","message":"which may be extra, but I fixed it","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9c5f5bc5f0b8ac685ae787dd04ba410590fad39f","unresolved":false,"context_lines":[{"line_number":878,"context_line":"                        commands.append(self.ovn_nbdb_api.lr_lb_del("},{"line_number":879,"context_line":"                            lr.uuid, ovn_lb.uuid))"},{"line_number":880,"context_line":"                        break"},{"line_number":881,"context_line":"            # Delete LoadBalancer from all Routers its indirectly associated"},{"line_number":882,"context_line":"            for lr in self._find_lb_in_lr_using_id(ovn_lb.uuid):"},{"line_number":883,"context_line":"                commands.append("},{"line_number":884,"context_line":"                    self.ovn_nbdb_api.lr_lb_del(lr.uuid, ovn_lb.uuid,"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_e6c86375","line":881,"range":{"start_line":881,"start_character":51,"end_line":881,"end_character":54},"updated":"2019-02-07 17:20:28.000000000","message":"ditto","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7ea5c0be4a42136a3fcdd4cbe2625c4889a69452","unresolved":false,"context_lines":[{"line_number":878,"context_line":"                        commands.append(self.ovn_nbdb_api.lr_lb_del("},{"line_number":879,"context_line":"                            lr.uuid, ovn_lb.uuid))"},{"line_number":880,"context_line":"                        break"},{"line_number":881,"context_line":"            # Delete LoadBalancer from all Routers its indirectly associated"},{"line_number":882,"context_line":"            for lr in self._find_lb_in_lr_using_id(ovn_lb.uuid):"},{"line_number":883,"context_line":"                commands.append("},{"line_number":884,"context_line":"                    self.ovn_nbdb_api.lr_lb_del(lr.uuid, ovn_lb.uuid,"}],"source_content_type":"text/x-python","patch_set":39,"id":"9fdfeff1_9e13ae66","line":881,"range":{"start_line":881,"start_character":51,"end_line":881,"end_character":54},"in_reply_to":"9fdfeff1_e6c86375","updated":"2019-02-11 16:44:08.000000000","message":"ditto","commit_id":"6964426ceea7ec6bf570aca8598d3e89fadc986f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"71e7824b778d81968fb43bb672e6b3d2876d5398","unresolved":false,"context_lines":[{"line_number":387,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":388,"context_line":"        commands \u003d []"},{"line_number":389,"context_line":"        router, network \u003d self._get_nw_router_info_on_interface_delete(row)"},{"line_number":390,"context_line":"        if router and network:"},{"line_number":391,"context_line":"            nw_lb \u003d set(self._find_lb_in_ls(network\u003dnetwork))"},{"line_number":392,"context_line":"            r_lb \u003d {str(r.uuid) for r in router.load_balancer} - nw_lb"},{"line_number":393,"context_line":"            # Delete all LB on N/W from Router"},{"line_number":394,"context_line":"            for lb in nw_lb:"},{"line_number":395,"context_line":"                commands.extend(self._update_lb_to_lr_association("},{"line_number":396,"context_line":"                    self._find_ovn_lb("},{"line_number":397,"context_line":"                        uuid.UUID(lb), uid\u003dTrue), router, delete\u003dTrue))"},{"line_number":398,"context_line":"            # Delete all LB on Router from N/W"},{"line_number":399,"context_line":"            for loadb in r_lb:"},{"line_number":400,"context_line":"                commands.append(self.ovn_nbdb_api.ls_lb_del("},{"line_number":401,"context_line":"                    network.uuid, loadb))"},{"line_number":402,"context_line":"        self._execute_commands(commands)"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"    def add_event_handler(self, row, old):"}],"source_content_type":"text/x-python","patch_set":41,"id":"9fdfeff1_63306557","line":401,"range":{"start_line":390,"start_character":0,"end_line":401,"end_character":41},"updated":"2019-02-14 17:28:12.000000000","message":"This is not necessary anymore for OVS master thanks to this patch we landed in core OVN [0]. Please add a note to remove this code eventually when we can rely on OVS \u003e\u003d 2.12.\nIn that case, we\u0027ll just need to remove the LB from the Load_Balancer table and will ease things as we don\u0027t need to remove all references.\n\n[0] https://github.com/openvswitch/ovs/commit/612f80fa8ebf88dad2e204364c6c02b451dca36c","commit_id":"b113801a034956c820318e79847954a549b7db96"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a8be5e7def08ed793561905ddf85a14080356b0c","unresolved":false,"context_lines":[{"line_number":387,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":388,"context_line":"        commands \u003d []"},{"line_number":389,"context_line":"        router, network \u003d self._get_nw_router_info_on_interface_delete(row)"},{"line_number":390,"context_line":"        if router and network:"},{"line_number":391,"context_line":"            nw_lb \u003d set(self._find_lb_in_ls(network\u003dnetwork))"},{"line_number":392,"context_line":"            r_lb \u003d {str(r.uuid) for r in router.load_balancer} - nw_lb"},{"line_number":393,"context_line":"            # Delete all LB on N/W from Router"},{"line_number":394,"context_line":"            for lb in nw_lb:"},{"line_number":395,"context_line":"                commands.extend(self._update_lb_to_lr_association("},{"line_number":396,"context_line":"                    self._find_ovn_lb("},{"line_number":397,"context_line":"                        uuid.UUID(lb), uid\u003dTrue), router, delete\u003dTrue))"},{"line_number":398,"context_line":"            # Delete all LB on Router from N/W"},{"line_number":399,"context_line":"            for loadb in r_lb:"},{"line_number":400,"context_line":"                commands.append(self.ovn_nbdb_api.ls_lb_del("},{"line_number":401,"context_line":"                    network.uuid, loadb))"},{"line_number":402,"context_line":"        self._execute_commands(commands)"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"    def add_event_handler(self, row, old):"}],"source_content_type":"text/x-python","patch_set":41,"id":"9fdfeff1_c8041881","line":401,"range":{"start_line":390,"start_character":0,"end_line":401,"end_character":41},"in_reply_to":"9fdfeff1_63306557","updated":"2019-02-25 08:06:06.000000000","message":"Done","commit_id":"b113801a034956c820318e79847954a549b7db96"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"5033b4e0b1308ec6a2ff54651dbdd976ded4c71d","unresolved":false,"context_lines":[{"line_number":247,"context_line":"            return None, None"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":250,"context_line":"        # ToDo(Reedip): When OVS\u003e\u003d2.12, LB can be deleted without removing"},{"line_number":251,"context_line":"        # Network and Router references as pushed in the patch"},{"line_number":252,"context_line":"        # +https://github.com/openvswitch/ovs/commit"},{"line_number":253,"context_line":"        # /612f80fa8ebf88dad2e204364c6c02b451dca36c"}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_cca44c4e","line":250,"range":{"start_line":250,"start_character":10,"end_line":250,"end_character":22},"updated":"2019-02-22 09:39:28.000000000","message":"nit: TODO(reedip)\n\nhttps://docs.openstack.org/hacking/latest/user/hacking.html#general","commit_id":"a5ec93511196e6d826251339d5a6141e9389a541"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"5033b4e0b1308ec6a2ff54651dbdd976ded4c71d","unresolved":false,"context_lines":[{"line_number":249,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":250,"context_line":"        # ToDo(Reedip): When OVS\u003e\u003d2.12, LB can be deleted without removing"},{"line_number":251,"context_line":"        # Network and Router references as pushed in the patch"},{"line_number":252,"context_line":"        # +https://github.com/openvswitch/ovs/commit"},{"line_number":253,"context_line":"        # /612f80fa8ebf88dad2e204364c6c02b451dca36c"},{"line_number":254,"context_line":"        commands \u003d []"},{"line_number":255,"context_line":"        router, network \u003d self._get_nw_router_info_on_interface_delete(row)"}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_8c640423","line":252,"range":{"start_line":252,"start_character":10,"end_line":252,"end_character":11},"updated":"2019-02-22 09:39:28.000000000","message":"?","commit_id":"a5ec93511196e6d826251339d5a6141e9389a541"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"5033b4e0b1308ec6a2ff54651dbdd976ded4c71d","unresolved":false,"context_lines":[{"line_number":355,"context_line":"        # searching with uuid instead of name"},{"line_number":356,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uid else ("},{"line_number":357,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"},{"line_number":358,"context_line":"        # ToDo(Reedip): You can use lookup here instead of db_find"},{"line_number":359,"context_line":"        ovn_lb \u003d self.ovn_nbdb_api.db_find("},{"line_number":360,"context_line":"            \u0027Load_Balancer\u0027, find_condition, row\u003dTrue).execute("},{"line_number":361,"context_line":"                check_error\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_2c6b98f1","line":358,"range":{"start_line":358,"start_character":10,"end_line":358,"end_character":21},"updated":"2019-02-22 09:39:28.000000000","message":"ditto","commit_id":"a5ec93511196e6d826251339d5a6141e9389a541"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"64a26a1267dd98d544b2675486cba82214181dd6","unresolved":false,"context_lines":[{"line_number":242,"context_line":"            \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":243,"context_line":"                ovn_const.NEUTRON_NET_NAME), default\u003dNone)"},{"line_number":244,"context_line":"        try:"},{"line_number":245,"context_line":"            return router[0], network[0]"},{"line_number":246,"context_line":"        except IndexError:"},{"line_number":247,"context_line":"            return None, None"},{"line_number":248,"context_line":""}],"source_content_type":"text/x-python","patch_set":44,"id":"9fdfeff1_e572274a","line":245,"updated":"2019-02-27 15:01:20.000000000","message":"Since you are defaulting to None in lines 234/241, you can get a TypeError for doing None[0]. Also, lookup() won\u0027t return an array anyway. it\u0027ll return a single Row. Seems like it would be better to not default, return router, network, and on RowNotFound return None, None? Or don\u0027t return anything and just raise the exception and handle it later. Returning None when something fails often makes code more complex than using Exceptions. Python code generally prefers the EAFP style (easier to ask forgiveness than permission), so you don\u0027t have to do all of these \u0027if\u0027 checks to make sure something didn\u0027t fail before doing what you really want to do.\n\nIn any case, style aside, this line will always fail due to indexing a Row result.","commit_id":"5d4571be2ef4acdcea98fbc7739aee716288bcfc"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"96e89d03bec4317430ac21d7d8d825853c044742","unresolved":false,"context_lines":[{"line_number":242,"context_line":"            \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":243,"context_line":"                ovn_const.NEUTRON_NET_NAME), default\u003dNone)"},{"line_number":244,"context_line":"        try:"},{"line_number":245,"context_line":"            return router[0], network[0]"},{"line_number":246,"context_line":"        except IndexError:"},{"line_number":247,"context_line":"            return None, None"},{"line_number":248,"context_line":""}],"source_content_type":"text/x-python","patch_set":44,"id":"9fdfeff1_86a31c43","line":245,"in_reply_to":"9fdfeff1_e572274a","updated":"2019-02-27 19:40:40.000000000","message":"+1 for not returning nothing and raise an exception. If you want, you can to create custom exceptions (if they don\u0027t exist yet) like \"RouterNotFound\" / \"NetworkNotFound\" but otherwise raising the RowNotFound would be fine as well ?","commit_id":"5d4571be2ef4acdcea98fbc7739aee716288bcfc"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a5239a79e2720261d7090f78c35be2c04fff510b","unresolved":false,"context_lines":[{"line_number":242,"context_line":"            \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":243,"context_line":"                ovn_const.NEUTRON_NET_NAME), default\u003dNone)"},{"line_number":244,"context_line":"        try:"},{"line_number":245,"context_line":"            return router[0], network[0]"},{"line_number":246,"context_line":"        except IndexError:"},{"line_number":247,"context_line":"            return None, None"},{"line_number":248,"context_line":""}],"source_content_type":"text/x-python","patch_set":44,"id":"9fdfeff1_1a61c1a9","line":245,"in_reply_to":"9fdfeff1_e572274a","updated":"2019-03-01 09:52:30.000000000","message":"Nothing will execute in Line#255 if the return is None here.But I will remove the default\u003dNone , that makes sense","commit_id":"5d4571be2ef4acdcea98fbc7739aee716288bcfc"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"21491dad4be0f83624086e37904b5baa84baddde","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        except IndexError:"},{"line_number":231,"context_line":"            return None, None"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    def _get_nw_router_info_on_interface_delete(self, row):"},{"line_number":234,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":235,"context_line":"            \u0027Logical_Router_Port\u0027, row.options.get(\u0027router-port\u0027),"},{"line_number":236,"context_line":"            default\u003dNone)"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fdfeff1_d14689a7","line":233,"updated":"2019-03-02 05:19:43.000000000","message":"Some of the comments on this may stem from things that may not happen in a real-world scenario. Since this function is only called with a LogicalSwitchPort row from the Event and the Event rejects any port that isn\u0027t part of a router, maybe options like router-port are guaranteed to be set (I haven\u0027t looked to see if that is true or not), for example. That\u0027s one reason I pushed for all of this code to be in the Event, because it makes it more clear what this function does and what conditions apply to it, and is the only place the function is useful.\n\nMany of these issues also apply to _get_nw_router_info_on_interface_add(). I have a local patch with many of these issues fixed. I\u0027m still just trying to get to a point where all of the tests pass.","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"21491dad4be0f83624086e37904b5baa84baddde","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    def _get_nw_router_info_on_interface_delete(self, row):"},{"line_number":234,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":235,"context_line":"            \u0027Logical_Router_Port\u0027, row.options.get(\u0027router-port\u0027),"},{"line_number":236,"context_line":"            default\u003dNone)"},{"line_number":237,"context_line":"        router \u003d self.ovn_nbdb_api.lookup("},{"line_number":238,"context_line":"            \u0027Logical_Router\u0027,"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fdfeff1_916321b1","line":235,"updated":"2019-03-02 05:19:43.000000000","message":"row.options.get(\u0027router-port\u0027) can return None. Doing a lookup() with something other than a uuid or a string will throw a TypeError.","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a477f47894dc0b72693dffe120ab64e71bbfbf8c","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    def _get_nw_router_info_on_interface_delete(self, row):"},{"line_number":234,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":235,"context_line":"            \u0027Logical_Router_Port\u0027, row.options.get(\u0027router-port\u0027),"},{"line_number":236,"context_line":"            default\u003dNone)"},{"line_number":237,"context_line":"        router \u003d self.ovn_nbdb_api.lookup("},{"line_number":238,"context_line":"            \u0027Logical_Router\u0027,"}],"source_content_type":"text/x-python","patch_set":46,"id":"5fc1f717_5dc1fe7f","line":235,"in_reply_to":"9fdfeff1_916321b1","updated":"2019-03-08 14:52:03.000000000","message":"Would that hurt?\nI can add everything in the try except block and catch the type-error","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"21491dad4be0f83624086e37904b5baa84baddde","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    def _get_nw_router_info_on_interface_delete(self, row):"},{"line_number":234,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":235,"context_line":"            \u0027Logical_Router_Port\u0027, row.options.get(\u0027router-port\u0027),"},{"line_number":236,"context_line":"            default\u003dNone)"},{"line_number":237,"context_line":"        router \u003d self.ovn_nbdb_api.lookup("},{"line_number":238,"context_line":"            \u0027Logical_Router\u0027,"},{"line_number":239,"context_line":"            rport.external_ids[ovn_const.NEUTRON_ROUTER_NAME])"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fdfeff1_8e4f8090","line":236,"updated":"2019-03-02 05:19:43.000000000","message":"You left the default\u003dNone here, then in line 239 do default.external_ids, which None.external_ids will raise an AttributeError.","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a477f47894dc0b72693dffe120ab64e71bbfbf8c","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    def _get_nw_router_info_on_interface_delete(self, row):"},{"line_number":234,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":235,"context_line":"            \u0027Logical_Router_Port\u0027, row.options.get(\u0027router-port\u0027),"},{"line_number":236,"context_line":"            default\u003dNone)"},{"line_number":237,"context_line":"        router \u003d self.ovn_nbdb_api.lookup("},{"line_number":238,"context_line":"            \u0027Logical_Router\u0027,"},{"line_number":239,"context_line":"            rport.external_ids[ovn_const.NEUTRON_ROUTER_NAME])"}],"source_content_type":"text/x-python","patch_set":46,"id":"5fc1f717_fd546acc","line":236,"in_reply_to":"9fdfeff1_8e4f8090","updated":"2019-03-08 14:52:03.000000000","message":"I have removed the default\u003dNone attribute from here","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"21491dad4be0f83624086e37904b5baa84baddde","unresolved":false,"context_lines":[{"line_number":236,"context_line":"            default\u003dNone)"},{"line_number":237,"context_line":"        router \u003d self.ovn_nbdb_api.lookup("},{"line_number":238,"context_line":"            \u0027Logical_Router\u0027,"},{"line_number":239,"context_line":"            rport.external_ids[ovn_const.NEUTRON_ROUTER_NAME])"},{"line_number":240,"context_line":"        network \u003d self.ovn_nbdb_api.lookup("},{"line_number":241,"context_line":"            \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":242,"context_line":"                ovn_const.NEUTRON_NET_NAME))"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fdfeff1_f1e62d16","line":239,"updated":"2019-03-02 05:19:43.000000000","message":"Assuming rport is not None, this could throw a KeyError. (Don\u0027t switch it to get() though, because you can\u0027t do a lookup() with None.","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a477f47894dc0b72693dffe120ab64e71bbfbf8c","unresolved":false,"context_lines":[{"line_number":236,"context_line":"            default\u003dNone)"},{"line_number":237,"context_line":"        router \u003d self.ovn_nbdb_api.lookup("},{"line_number":238,"context_line":"            \u0027Logical_Router\u0027,"},{"line_number":239,"context_line":"            rport.external_ids[ovn_const.NEUTRON_ROUTER_NAME])"},{"line_number":240,"context_line":"        network \u003d self.ovn_nbdb_api.lookup("},{"line_number":241,"context_line":"            \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":242,"context_line":"                ovn_const.NEUTRON_NET_NAME))"}],"source_content_type":"text/x-python","patch_set":46,"id":"5fc1f717_9db9a6ea","line":239,"in_reply_to":"9fdfeff1_f1e62d16","updated":"2019-03-08 14:52:03.000000000","message":"Catching exceptions and reporting them as Driver Error would be my idea to move forward. Since that would mean that the flow entries are messed up","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"21491dad4be0f83624086e37904b5baa84baddde","unresolved":false,"context_lines":[{"line_number":238,"context_line":"            \u0027Logical_Router\u0027,"},{"line_number":239,"context_line":"            rport.external_ids[ovn_const.NEUTRON_ROUTER_NAME])"},{"line_number":240,"context_line":"        network \u003d self.ovn_nbdb_api.lookup("},{"line_number":241,"context_line":"            \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":242,"context_line":"                ovn_const.NEUTRON_NET_NAME))"},{"line_number":243,"context_line":"        try:"},{"line_number":244,"context_line":"            return router[0], network[0]"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fdfeff1_31b27507","line":241,"updated":"2019-03-02 05:19:43.000000000","message":"Same issue with lookup/None.","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a477f47894dc0b72693dffe120ab64e71bbfbf8c","unresolved":false,"context_lines":[{"line_number":238,"context_line":"            \u0027Logical_Router\u0027,"},{"line_number":239,"context_line":"            rport.external_ids[ovn_const.NEUTRON_ROUTER_NAME])"},{"line_number":240,"context_line":"        network \u003d self.ovn_nbdb_api.lookup("},{"line_number":241,"context_line":"            \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":242,"context_line":"                ovn_const.NEUTRON_NET_NAME))"},{"line_number":243,"context_line":"        try:"},{"line_number":244,"context_line":"            return router[0], network[0]"}],"source_content_type":"text/x-python","patch_set":46,"id":"5fc1f717_3dd0b21f","line":241,"in_reply_to":"9fdfeff1_31b27507","updated":"2019-03-08 14:52:03.000000000","message":"same","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"21491dad4be0f83624086e37904b5baa84baddde","unresolved":false,"context_lines":[{"line_number":241,"context_line":"            \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":242,"context_line":"                ovn_const.NEUTRON_NET_NAME))"},{"line_number":243,"context_line":"        try:"},{"line_number":244,"context_line":"            return router[0], network[0]"},{"line_number":245,"context_line":"        except IndexError:"},{"line_number":246,"context_line":"            return None, None"},{"line_number":247,"context_line":""}],"source_content_type":"text/x-python","patch_set":46,"id":"9fdfeff1_eeb16c90","line":244,"updated":"2019-03-02 05:19:43.000000000","message":"As mentioned on patch set 44, lookup() returns a Row object, not a list.","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"34e03f94241d2182f51162c7c54c1b96f0a1677c","unresolved":false,"context_lines":[{"line_number":241,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":242,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"},{"line_number":243,"context_line":"            return router, network"},{"line_number":244,"context_line":"        except TypeError as e:"},{"line_number":245,"context_line":"            raise driver_exceptions.DriverError(e)"},{"line_number":246,"context_line":"        except KeyError as e:"},{"line_number":247,"context_line":"            raise driver_exceptions.DriverError(e)"},{"line_number":248,"context_line":"        except IndexError:"},{"line_number":249,"context_line":"            return None, None"},{"line_number":250,"context_line":""}],"source_content_type":"text/x-python","patch_set":48,"id":"5fc1f717_d892dc4b","line":247,"range":{"start_line":244,"start_character":0,"end_line":247,"end_character":50},"updated":"2019-03-08 15:31:26.000000000","message":"These are so broad and not user friendly. Imagine a user seeing something like it in either the logs or the API (not sure if octavia bubbles up the error string from a DriverException):\n\nDriverError: \"router-port\"\n\nHow would they know what\u0027s going on ? It doesn\u0027t give \u0027em any context.\n\nSame for attribute error.\n\n...\n\nThat\u0027s all you get from a KeyError, here\u0027s an example:\n\nIn [1]: a \u003d {}\n\nIn [2]: a[\u0027aaa\u0027]\n---------------------------------------------------------------------------\nKeyError                                  Traceback (most recent call last)\n\u003cipython-input-2-39bdb34ace4b\u003e in \u003cmodule\u003e\n----\u003e 1 a[\u0027aaa\u0027]\n\nKeyError: \u0027aaa\u0027","commit_id":"19ca1609b20d4986ebf9bcb610fd5f06fd34aa5e"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"bb54ee363ac01b37ade54a54072c1c7644a45c8d","unresolved":false,"context_lines":[{"line_number":241,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":242,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"},{"line_number":243,"context_line":"            return router, network"},{"line_number":244,"context_line":"        except TypeError as e:"},{"line_number":245,"context_line":"            raise driver_exceptions.DriverError(e)"},{"line_number":246,"context_line":"        except KeyError as e:"},{"line_number":247,"context_line":"            raise driver_exceptions.DriverError(e)"},{"line_number":248,"context_line":"        except IndexError:"},{"line_number":249,"context_line":"            return None, None"},{"line_number":250,"context_line":""}],"source_content_type":"text/x-python","patch_set":48,"id":"5fc1f717_36177054","line":247,"range":{"start_line":244,"start_character":0,"end_line":247,"end_character":50},"in_reply_to":"5fc1f717_d892dc4b","updated":"2019-03-08 18:01:38.000000000","message":"1) Octavia doesnt bubble the errors out to the user. It generally gets stuck in the PENDING_CREATE/PENDING_DELETE ( This is an interesting point which I need to draft in the error documentation)\n2)SysAdmin can see the logs and try to get some understanding. I got your point here. Can TRY to add more information based on the exception generated.","commit_id":"19ca1609b20d4986ebf9bcb610fd5f06fd34aa5e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d11b7018692e9d6f00ea31b531711b0c637d3693","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                    ovn_const.NEUTRON_NET_NAME), default\u003dNone)"},{"line_number":228,"context_line":"        try:"},{"line_number":229,"context_line":"            return router[0], network"},{"line_number":230,"context_line":"        except TypeError as e:"},{"line_number":231,"context_line":"            raise driver_exceptions.DriverError(e)"},{"line_number":232,"context_line":"        except KeyError as e:"},{"line_number":233,"context_line":"            raise driver_exceptions.DriverError(e)"},{"line_number":234,"context_line":"        except IndexError:"},{"line_number":235,"context_line":"            return None, None"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_1aa2eafc","line":233,"range":{"start_line":230,"start_character":0,"end_line":233,"end_character":50},"updated":"2019-03-29 10:22:51.000000000","message":"I don\u0027t see how \"return router[0], network\" can raise a KeyError or TypeError.","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"dffbdbce74060b8d122f432170c30353979c3f66","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                    ovn_const.NEUTRON_NET_NAME), default\u003dNone)"},{"line_number":228,"context_line":"        try:"},{"line_number":229,"context_line":"            return router[0], network"},{"line_number":230,"context_line":"        except TypeError as e:"},{"line_number":231,"context_line":"            raise driver_exceptions.DriverError(e)"},{"line_number":232,"context_line":"        except KeyError as e:"},{"line_number":233,"context_line":"            raise driver_exceptions.DriverError(e)"},{"line_number":234,"context_line":"        except IndexError:"},{"line_number":235,"context_line":"            return None, None"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_ba2636ca","line":233,"range":{"start_line":230,"start_character":0,"end_line":233,"end_character":50},"in_reply_to":"5fc1f717_1aa2eafc","updated":"2019-03-29 10:46:50.000000000","message":"Done","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d11b7018692e9d6f00ea31b531711b0c637d3693","unresolved":false,"context_lines":[{"line_number":245,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":246,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"},{"line_number":247,"context_line":"            return router, network"},{"line_number":248,"context_line":"        except TypeError as e:"},{"line_number":249,"context_line":"            raise driver_exceptions.DriverError(e)"},{"line_number":250,"context_line":"        except KeyError as e:"},{"line_number":251,"context_line":"            raise driver_exceptions.DriverError(e)"},{"line_number":252,"context_line":"        except IndexError:"},{"line_number":253,"context_line":"            return None, None"},{"line_number":254,"context_line":""}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_fa935ea1","line":251,"range":{"start_line":248,"start_character":0,"end_line":251,"end_character":50},"updated":"2019-03-29 10:22:51.000000000","message":"ditto, unless lookup() would raise those which I don\u0027t think it does.","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"dffbdbce74060b8d122f432170c30353979c3f66","unresolved":false,"context_lines":[{"line_number":245,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":246,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"},{"line_number":247,"context_line":"            return router, network"},{"line_number":248,"context_line":"        except TypeError as e:"},{"line_number":249,"context_line":"            raise driver_exceptions.DriverError(e)"},{"line_number":250,"context_line":"        except KeyError as e:"},{"line_number":251,"context_line":"            raise driver_exceptions.DriverError(e)"},{"line_number":252,"context_line":"        except IndexError:"},{"line_number":253,"context_line":"            return None, None"},{"line_number":254,"context_line":""}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_5a1b927f","line":251,"range":{"start_line":248,"start_character":0,"end_line":251,"end_character":50},"in_reply_to":"5fc1f717_fa935ea1","updated":"2019-03-29 10:46:50.000000000","message":"Done","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d11b7018692e9d6f00ea31b531711b0c637d3693","unresolved":false,"context_lines":[{"line_number":302,"context_line":"                    if network.name in lb.external_ids.get("},{"line_number":303,"context_line":"                        LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":304,"context_line":"                        output.append(str(lb.uuid))"},{"line_number":305,"context_line":"                return output"},{"line_number":306,"context_line":"            except TypeError:"},{"line_number":307,"context_line":"                msg \u003d _(\u0027No network found with network name: %s\u0027) % str("},{"line_number":308,"context_line":"                    network.name)"}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_dafa2273","line":305,"range":{"start_line":305,"start_character":16,"end_line":305,"end_character":29},"updated":"2019-03-29 10:22:51.000000000","message":"I would suggest adding this return at the end of the execution body so that we always return a list from this method (instead of mixing and match returning values)","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"dffbdbce74060b8d122f432170c30353979c3f66","unresolved":false,"context_lines":[{"line_number":302,"context_line":"                    if network.name in lb.external_ids.get("},{"line_number":303,"context_line":"                        LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":304,"context_line":"                        output.append(str(lb.uuid))"},{"line_number":305,"context_line":"                return output"},{"line_number":306,"context_line":"            except TypeError:"},{"line_number":307,"context_line":"                msg \u003d _(\u0027No network found with network name: %s\u0027) % str("},{"line_number":308,"context_line":"                    network.name)"}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_7ac20eeb","line":305,"range":{"start_line":305,"start_character":16,"end_line":305,"end_character":29},"in_reply_to":"5fc1f717_dafa2273","updated":"2019-03-29 10:46:50.000000000","message":"ohk","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d11b7018692e9d6f00ea31b531711b0c637d3693","unresolved":false,"context_lines":[{"line_number":303,"context_line":"                        LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":304,"context_line":"                        output.append(str(lb.uuid))"},{"line_number":305,"context_line":"                return output"},{"line_number":306,"context_line":"            except TypeError:"},{"line_number":307,"context_line":"                msg \u003d _(\u0027No network found with network name: %s\u0027) % str("},{"line_number":308,"context_line":"                    network.name)"},{"line_number":309,"context_line":"                raise Exception(msg)"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"    def _find_lb_in_table_using_id(self, lb_id, table):"},{"line_number":312,"context_line":"        output \u003d []"}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_da954241","line":309,"range":{"start_line":306,"start_character":0,"end_line":309,"end_character":36},"updated":"2019-03-29 10:22:51.000000000","message":"I don\u0027t see how a TypeError would be raised there ?","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"dffbdbce74060b8d122f432170c30353979c3f66","unresolved":false,"context_lines":[{"line_number":303,"context_line":"                        LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":304,"context_line":"                        output.append(str(lb.uuid))"},{"line_number":305,"context_line":"                return output"},{"line_number":306,"context_line":"            except TypeError:"},{"line_number":307,"context_line":"                msg \u003d _(\u0027No network found with network name: %s\u0027) % str("},{"line_number":308,"context_line":"                    network.name)"},{"line_number":309,"context_line":"                raise Exception(msg)"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"    def _find_lb_in_table_using_id(self, lb_id, table):"},{"line_number":312,"context_line":"        output \u003d []"}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_5abf1260","line":309,"range":{"start_line":306,"start_character":0,"end_line":309,"end_character":36},"in_reply_to":"5fc1f717_da954241","updated":"2019-03-29 10:46:50.000000000","message":"Can be removed. This was existing in previous patches and code change now seems to avoid this scenario","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d11b7018692e9d6f00ea31b531711b0c637d3693","unresolved":false,"context_lines":[{"line_number":321,"context_line":"        return self._find_lb_in_table_using_id(lb_id, \u0027Logical_Switch\u0027)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    def _find_lb_in_lr_using_id(self, lb_id):"},{"line_number":324,"context_line":"        # Find LB associated to a Network"},{"line_number":325,"context_line":"        return self._find_lb_in_table_using_id(lb_id, \u0027Logical_Router\u0027)"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"    def request_handler(self):"}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_bac15650","line":324,"range":{"start_line":324,"start_character":34,"end_line":324,"end_character":41},"updated":"2019-03-29 10:22:51.000000000","message":"Router","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"dffbdbce74060b8d122f432170c30353979c3f66","unresolved":false,"context_lines":[{"line_number":321,"context_line":"        return self._find_lb_in_table_using_id(lb_id, \u0027Logical_Switch\u0027)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    def _find_lb_in_lr_using_id(self, lb_id):"},{"line_number":324,"context_line":"        # Find LB associated to a Network"},{"line_number":325,"context_line":"        return self._find_lb_in_table_using_id(lb_id, \u0027Logical_Router\u0027)"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"    def request_handler(self):"}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_1ab50a7e","line":324,"range":{"start_line":324,"start_character":34,"end_line":324,"end_character":41},"in_reply_to":"5fc1f717_bac15650","updated":"2019-03-29 10:46:50.000000000","message":"copy paste ! Sorry","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d11b7018692e9d6f00ea31b531711b0c637d3693","unresolved":false,"context_lines":[{"line_number":358,"context_line":"                      e.fault_string)"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uid\u003dFalse):"},{"line_number":361,"context_line":"        # loadbalancer_id can be either name or uuid. Put uid\u003dTrue if"},{"line_number":362,"context_line":"        # searching with uuid instead of name"},{"line_number":363,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uid else ("},{"line_number":364,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"},{"line_number":365,"context_line":"        ovn_lb \u003d self.ovn_nbdb_api.db_find("}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_3ab6c6fa","line":362,"range":{"start_line":361,"start_character":0,"end_line":362,"end_character":45},"updated":"2019-03-29 10:22:51.000000000","message":"this is a docstring","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"dffbdbce74060b8d122f432170c30353979c3f66","unresolved":false,"context_lines":[{"line_number":358,"context_line":"                      e.fault_string)"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uid\u003dFalse):"},{"line_number":361,"context_line":"        # loadbalancer_id can be either name or uuid. Put uid\u003dTrue if"},{"line_number":362,"context_line":"        # searching with uuid instead of name"},{"line_number":363,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uid else ("},{"line_number":364,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"},{"line_number":365,"context_line":"        ovn_lb \u003d self.ovn_nbdb_api.db_find("}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_3ab80673","line":362,"range":{"start_line":361,"start_character":0,"end_line":362,"end_character":45},"in_reply_to":"5fc1f717_3ab6c6fa","updated":"2019-03-29 10:46:50.000000000","message":"ohk, will update it","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d11b7018692e9d6f00ea31b531711b0c637d3693","unresolved":false,"context_lines":[{"line_number":388,"context_line":""},{"line_number":389,"context_line":"           This function deals with updating the References of Logical Switch"},{"line_number":390,"context_line":"           in LB and addition of LB to LS."},{"line_number":391,"context_line":"        \u0027\u0027\u0027"},{"line_number":392,"context_line":"        commands \u003d []"},{"line_number":393,"context_line":"        if not network_id and not subnet_id:"},{"line_number":394,"context_line":"            return commands"}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_fae27e00","line":391,"range":{"start_line":391,"start_character":8,"end_line":391,"end_character":11},"updated":"2019-03-29 10:22:51.000000000","message":"nit: \"\"\" (double quotes for docstrings)","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d11b7018692e9d6f00ea31b531711b0c637d3693","unresolved":false,"context_lines":[{"line_number":806,"context_line":"                operating_status \u003d constants.OFFLINE"},{"line_number":807,"context_line":"            lb_status[\u0027operating_status\u0027] \u003d operating_status"},{"line_number":808,"context_line":"        except Exception:"},{"line_number":809,"context_line":"            LOG.exception(\u0027Exception during loadbalancer update\u0027)"},{"line_number":810,"context_line":"            lb_status[\u0027provisioning_status\u0027] \u003d constants.ERROR"},{"line_number":811,"context_line":"            lb_status[\u0027operating_status\u0027] \u003d constants.ERROR"},{"line_number":812,"context_line":""}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_ba65d6b0","line":809,"updated":"2019-03-29 10:22:51.000000000","message":"Let\u0027s make the exception messages consistent.\n\nL681 says \"Unexpected exception during loadbalancer create\"\n\nL894 says \"Exception during listener delete\"\n\nL1319 says \"Exception occurred during member update\"\n\nIt\u0027s all different, let\u0027s pick one and use across the code. Preferable, let\u0027s create a custom exception for that so u don\u0027t need to copy and paste the same message over and over (and helps with i18n too).","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"12be5344b799ff2cf9b2a8615f93f0a1c1c54f68","unresolved":false,"context_lines":[{"line_number":806,"context_line":"                operating_status \u003d constants.OFFLINE"},{"line_number":807,"context_line":"            lb_status[\u0027operating_status\u0027] \u003d operating_status"},{"line_number":808,"context_line":"        except Exception:"},{"line_number":809,"context_line":"            LOG.exception(\u0027Exception during loadbalancer update\u0027)"},{"line_number":810,"context_line":"            lb_status[\u0027provisioning_status\u0027] \u003d constants.ERROR"},{"line_number":811,"context_line":"            lb_status[\u0027operating_status\u0027] \u003d constants.ERROR"},{"line_number":812,"context_line":""}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_90af717c","line":809,"in_reply_to":"5fc1f717_757a2188","updated":"2019-04-02 03:22:02.000000000","message":"I have currently pushed all Exception Logs in https://review.openstack.org/649213. Note: I cannot raise an exception until I update the Octavia DB, and since the driver runs under o-api, once the control goes back to Octavia, the driver wont be able to get it back till the next API call","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"dffbdbce74060b8d122f432170c30353979c3f66","unresolved":false,"context_lines":[{"line_number":806,"context_line":"                operating_status \u003d constants.OFFLINE"},{"line_number":807,"context_line":"            lb_status[\u0027operating_status\u0027] \u003d operating_status"},{"line_number":808,"context_line":"        except Exception:"},{"line_number":809,"context_line":"            LOG.exception(\u0027Exception during loadbalancer update\u0027)"},{"line_number":810,"context_line":"            lb_status[\u0027provisioning_status\u0027] \u003d constants.ERROR"},{"line_number":811,"context_line":"            lb_status[\u0027operating_status\u0027] \u003d constants.ERROR"},{"line_number":812,"context_line":""}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_757a2188","line":809,"in_reply_to":"5fc1f717_ba65d6b0","updated":"2019-03-29 10:46:50.000000000","message":"Will do it in a separate patch","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d11b7018692e9d6f00ea31b531711b0c637d3693","unresolved":false,"context_lines":[{"line_number":1316,"context_line":"                     \u0027provisioning_status\u0027: constants.ACTIVE})"},{"line_number":1317,"context_line":"            status[\u0027listeners\u0027] \u003d listener_status"},{"line_number":1318,"context_line":"        except Exception:"},{"line_number":1319,"context_line":"            LOG.error(\"Exception occurred during Member Update:%s\")"},{"line_number":1320,"context_line":"            status \u003d {"},{"line_number":1321,"context_line":"                \u0027pools\u0027: [{\u0027id\u0027: member[\u0027pool_id\u0027],"},{"line_number":1322,"context_line":"                           \u0027provisioning_status\u0027: constants.ACTIVE}],"}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_ba4cf63e","line":1319,"range":{"start_line":1319,"start_character":62,"end_line":1319,"end_character":65},"updated":"2019-03-29 10:22:51.000000000","message":"missing the parameter","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"39a04256f0e3876d2146c7e4bac1c711b24a9b6d","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        return idl_ovn.OvnNbApiIdlImpl(self.conn)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def stop(self):"},{"line_number":157,"context_line":"        LOG.info(\"Calling Shutdown\")"},{"line_number":158,"context_line":"        self.conn.stop(timeout\u003dovn_cfg.get_ovn_ovsdb_timeout())"},{"line_number":159,"context_line":"        self.notify_handler.shutdown()"},{"line_number":160,"context_line":"        self.close()"}],"source_content_type":"text/x-python","patch_set":58,"id":"5fc1f717_bdd0542d","line":157,"range":{"start_line":157,"start_character":0,"end_line":157,"end_character":36},"updated":"2019-04-01 12:48:55.000000000","message":"Info? This looks more like a debug trace for you right?","commit_id":"c5734ce39bd8e20b994067e55438435a5dd0705d"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"a4ae9c7f47d4da9bc3e6500b1c133db3dd41f8f5","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        return idl_ovn.OvnNbApiIdlImpl(self.conn)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def stop(self):"},{"line_number":157,"context_line":"        LOG.info(\"Calling Shutdown\")"},{"line_number":158,"context_line":"        self.conn.stop(timeout\u003dovn_cfg.get_ovn_ovsdb_timeout())"},{"line_number":159,"context_line":"        self.notify_handler.shutdown()"},{"line_number":160,"context_line":"        self.close()"}],"source_content_type":"text/x-python","patch_set":58,"id":"5fc1f717_dd64404c","line":157,"range":{"start_line":157,"start_character":0,"end_line":157,"end_character":36},"in_reply_to":"5fc1f717_1d72c84a","updated":"2019-04-01 12:59:25.000000000","message":"An engineer during troubleshooting/debugging right? That looks to me more like a DBG trace plus if you want it to be useful, I think it\u0027d be nice to have it also during the initialization as well and a bit more of context than \"Calling Shutdown\".\n\nIf you want to log when the driver is started and when it\u0027s shutdown, then INFO is ok but I think then that the message itself has to be changed to something more meaningful.\n\nhttps://specs.openstack.org/openstack/openstack-specs/specs/log-guidelines.html#definition-of-log-levels","commit_id":"c5734ce39bd8e20b994067e55438435a5dd0705d"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"673c0f642b684cba2092318b80c8a97b64b0fd39","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        return idl_ovn.OvnNbApiIdlImpl(self.conn)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def stop(self):"},{"line_number":157,"context_line":"        LOG.info(\"Calling Shutdown\")"},{"line_number":158,"context_line":"        self.conn.stop(timeout\u003dovn_cfg.get_ovn_ovsdb_timeout())"},{"line_number":159,"context_line":"        self.notify_handler.shutdown()"},{"line_number":160,"context_line":"        self.close()"}],"source_content_type":"text/x-python","patch_set":58,"id":"5fc1f717_1d72c84a","line":157,"range":{"start_line":157,"start_character":0,"end_line":157,"end_character":36},"in_reply_to":"5fc1f717_bdd0542d","updated":"2019-04-01 12:53:26.000000000","message":"This can be put in a debug log.\nI thought it would be convenient for an engineer on the customer site to know when the service was shutdown, thats why I thought of keeping it in Info","commit_id":"c5734ce39bd8e20b994067e55438435a5dd0705d"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"4791179f0f7e6d6f305b211e780a10005a29570e","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        return idl_ovn.OvnNbApiIdlImpl(self.conn)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def stop(self):"},{"line_number":157,"context_line":"        LOG.info(\"Calling Shutdown\")"},{"line_number":158,"context_line":"        self.conn.stop(timeout\u003dovn_cfg.get_ovn_ovsdb_timeout())"},{"line_number":159,"context_line":"        self.notify_handler.shutdown()"},{"line_number":160,"context_line":"        self.close()"}],"source_content_type":"text/x-python","patch_set":58,"id":"5fc1f717_fd7d7cb2","line":157,"range":{"start_line":157,"start_character":0,"end_line":157,"end_character":36},"in_reply_to":"5fc1f717_dd64404c","updated":"2019-04-01 13:08:34.000000000","message":"Yeah, I understand that :)\nWill do so for startup/shutdown","commit_id":"c5734ce39bd8e20b994067e55438435a5dd0705d"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7e38b592de6fd14d5e94a1c3c69369f4f0dc80b3","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        return idl_ovn.OvnNbApiIdlImpl(self.conn)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def stop(self):"},{"line_number":157,"context_line":"        LOG.info(\"Calling Shutdown\")"},{"line_number":158,"context_line":"        self.conn.stop(timeout\u003dovn_cfg.get_ovn_ovsdb_timeout())"},{"line_number":159,"context_line":"        self.notify_handler.shutdown()"},{"line_number":160,"context_line":"        self.close()"}],"source_content_type":"text/x-python","patch_set":58,"id":"3fce034c_ad923d4a","line":157,"range":{"start_line":157,"start_character":0,"end_line":157,"end_character":36},"in_reply_to":"5fc1f717_fd7d7cb2","updated":"2019-04-15 11:38:59.000000000","message":"Hi Daniel, I am not going to include this in the new PS, I think it can be skipped since o-api does give the other information.\nDo let me know if you feel otherwise.","commit_id":"c5734ce39bd8e20b994067e55438435a5dd0705d"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"044e2be8a053b3ad9cc01abd8d46a08e5b9715a6","unresolved":false,"context_lines":[{"line_number":318,"context_line":"                    LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":319,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":320,"context_line":"        if not output:"},{"line_number":321,"context_line":"            msg \u003d _(\u0027No network found with network name: %s\u0027) % str("},{"line_number":322,"context_line":"                network.name)"},{"line_number":323,"context_line":"            raise Exception(msg)"},{"line_number":324,"context_line":"        return output"}],"source_content_type":"text/x-python","patch_set":59,"id":"3fce034c_3a3653e8","line":321,"range":{"start_line":321,"start_character":20,"end_line":321,"end_character":62},"updated":"2019-04-17 05:44:24.000000000","message":"Message is incorrect here.\nThe logic here should not raise an exception message.\nThis exception should have been caught only if the network is not there but if the network is present but not directly connected to the LoadBalancer, then thats a positive scenario.","commit_id":"104421ad61b9abc3288533c995655f4812b70a5d"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"0b00c4b9620a951c92477b7bf5c683a014b41084","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            REQ_TYPE_MEMBER_UPDATE: self.member_update,"},{"line_number":199,"context_line":"        }"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def _init_ovnnb_db_api(self):"},{"line_number":202,"context_line":"        if OvnProviderHelper.ovn_nbdb_api:"},{"line_number":203,"context_line":"            return"},{"line_number":204,"context_line":"        # idl_ovn.OvnNbApiIdlImpl.ovsdb_connection is a class variable."}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_c3464a7d","line":201,"range":{"start_line":201,"start_character":8,"end_line":201,"end_character":26},"updated":"2019-04-17 08:46:32.000000000","message":"This method\u0027s name doesn\u0027t make much sense anymore since the ovn_nbdb_api is now started at start() (L223)","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b1ef3902f344814e455a8ed93f650e6966f569c0","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            REQ_TYPE_MEMBER_UPDATE: self.member_update,"},{"line_number":199,"context_line":"        }"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def _init_ovnnb_db_api(self):"},{"line_number":202,"context_line":"        if OvnProviderHelper.ovn_nbdb_api:"},{"line_number":203,"context_line":"            return"},{"line_number":204,"context_line":"        # idl_ovn.OvnNbApiIdlImpl.ovsdb_connection is a class variable."}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_ce9c315f","line":201,"range":{"start_line":201,"start_character":8,"end_line":201,"end_character":26},"in_reply_to":"3fce034c_c3464a7d","updated":"2019-04-17 15:13:45.000000000","message":"This can be modified to _check_and_set_ssl_files, as per Line#207. What do you think?","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"fb6bc4b1cfedd0b2abcbffc60b4d923c8fa25761","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            REQ_TYPE_MEMBER_UPDATE: self.member_update,"},{"line_number":199,"context_line":"        }"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def _init_ovnnb_db_api(self):"},{"line_number":202,"context_line":"        if OvnProviderHelper.ovn_nbdb_api:"},{"line_number":203,"context_line":"            return"},{"line_number":204,"context_line":"        # idl_ovn.OvnNbApiIdlImpl.ovsdb_connection is a class variable."}],"source_content_type":"text/x-python","patch_set":60,"id":"ffb9cba7_943229a7","line":201,"range":{"start_line":201,"start_character":8,"end_line":201,"end_character":26},"in_reply_to":"3fce034c_ce9c315f","updated":"2019-04-21 15:41:35.000000000","message":"Updated with _check_and_set_ssl_files","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":201,"context_line":"    def _init_ovnnb_db_api(self):"},{"line_number":202,"context_line":"        if OvnProviderHelper.ovn_nbdb_api:"},{"line_number":203,"context_line":"            return"},{"line_number":204,"context_line":"        # idl_ovn.OvnNbApiIdlImpl.ovsdb_connection is a class variable."},{"line_number":205,"context_line":"        # So set it to None so that we don\u0027t use any old connection object."},{"line_number":206,"context_line":"        # See ovsdbapp.backend.ovs_idl.Backend class for more details."},{"line_number":207,"context_line":"        # This is a copy of ovsdb_monitor._check_and_set_ssl_files"},{"line_number":208,"context_line":"        priv_key_file \u003d ovn_cfg.get_ovn_nb_private_key()"},{"line_number":209,"context_line":"        cert_file \u003d ovn_cfg.get_ovn_nb_certificate()"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_0e445d1a","line":206,"range":{"start_line":204,"start_character":0,"end_line":206,"end_character":70},"updated":"2019-04-18 20:50:32.000000000","message":"It looks like we no longer do this now?","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":201,"context_line":"    def _init_ovnnb_db_api(self):"},{"line_number":202,"context_line":"        if OvnProviderHelper.ovn_nbdb_api:"},{"line_number":203,"context_line":"            return"},{"line_number":204,"context_line":"        # idl_ovn.OvnNbApiIdlImpl.ovsdb_connection is a class variable."},{"line_number":205,"context_line":"        # So set it to None so that we don\u0027t use any old connection object."},{"line_number":206,"context_line":"        # See ovsdbapp.backend.ovs_idl.Backend class for more details."},{"line_number":207,"context_line":"        # This is a copy of ovsdb_monitor._check_and_set_ssl_files"},{"line_number":208,"context_line":"        priv_key_file \u003d ovn_cfg.get_ovn_nb_private_key()"},{"line_number":209,"context_line":"        cert_file \u003d ovn_cfg.get_ovn_nb_certificate()"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_49cecd2d","line":206,"range":{"start_line":204,"start_character":0,"end_line":206,"end_character":70},"in_reply_to":"3fce034c_0e445d1a","updated":"2019-04-20 17:49:56.000000000","message":"Moved out","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    def _get_nw_router_info_on_interface_add(self, row):"},{"line_number":234,"context_line":"        network \u003d None"},{"line_number":235,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, ovn_utils.ovn_name(row.external_ids.get("},{"line_number":236,"context_line":"            ovn_const.NEUTRON_ROUTER_NAME)))"},{"line_number":237,"context_line":"        router \u003d self.ovn_nbdb_api.db_find("},{"line_number":238,"context_line":"            \u0027Logical_Router\u0027, find_cond, row\u003dTrue,"},{"line_number":239,"context_line":"            columns\u003d[\u0027_uuid\u0027, \u0027external_ids\u0027, \u0027load_balancer\u0027,"},{"line_number":240,"context_line":"                     \u0027name\u0027, \u0027options\u0027, \u0027ports\u0027]).execute(check_error\u003dTrue)"},{"line_number":241,"context_line":"        lsp \u003d self.ovn_nbdb_api.lookup("},{"line_number":242,"context_line":"            \u0027Logical_Switch_Port\u0027, row.name["},{"line_number":243,"context_line":"                len(ovn_const.LRP_NAME):], default\u003dNone)"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_426794be","line":240,"range":{"start_line":235,"start_character":0,"end_line":240,"end_character":75},"updated":"2019-04-18 20:50:32.000000000","message":"This should be a lookup() (in addition, just FYI, if row\u003dTrue, columns\u003d doesn\u0027t matter).\n\nThis function would be better if it didn\u0027t return None, None on error and instead the caller just caught idlutils.RowNotFound. That way you don\u0027t have to have add_event_handler have everything under an \u0027if network and router\u0027.","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"fb6bc4b1cfedd0b2abcbffc60b4d923c8fa25761","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    def _get_nw_router_info_on_interface_add(self, row):"},{"line_number":234,"context_line":"        network \u003d None"},{"line_number":235,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, ovn_utils.ovn_name(row.external_ids.get("},{"line_number":236,"context_line":"            ovn_const.NEUTRON_ROUTER_NAME)))"},{"line_number":237,"context_line":"        router \u003d self.ovn_nbdb_api.db_find("},{"line_number":238,"context_line":"            \u0027Logical_Router\u0027, find_cond, row\u003dTrue,"},{"line_number":239,"context_line":"            columns\u003d[\u0027_uuid\u0027, \u0027external_ids\u0027, \u0027load_balancer\u0027,"},{"line_number":240,"context_line":"                     \u0027name\u0027, \u0027options\u0027, \u0027ports\u0027]).execute(check_error\u003dTrue)"},{"line_number":241,"context_line":"        lsp \u003d self.ovn_nbdb_api.lookup("},{"line_number":242,"context_line":"            \u0027Logical_Switch_Port\u0027, row.name["},{"line_number":243,"context_line":"                len(ovn_const.LRP_NAME):], default\u003dNone)"}],"source_content_type":"text/x-python","patch_set":60,"id":"ffb9cba7_3427bd67","line":240,"range":{"start_line":235,"start_character":0,"end_line":240,"end_character":75},"in_reply_to":"3fce034c_29d901f2","updated":"2019-04-21 15:41:35.000000000","message":"I have modified the code with the patch which you proposed and some nit changes. Hope you like them :)","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    def _get_nw_router_info_on_interface_add(self, row):"},{"line_number":234,"context_line":"        network \u003d None"},{"line_number":235,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, ovn_utils.ovn_name(row.external_ids.get("},{"line_number":236,"context_line":"            ovn_const.NEUTRON_ROUTER_NAME)))"},{"line_number":237,"context_line":"        router \u003d self.ovn_nbdb_api.db_find("},{"line_number":238,"context_line":"            \u0027Logical_Router\u0027, find_cond, row\u003dTrue,"},{"line_number":239,"context_line":"            columns\u003d[\u0027_uuid\u0027, \u0027external_ids\u0027, \u0027load_balancer\u0027,"},{"line_number":240,"context_line":"                     \u0027name\u0027, \u0027options\u0027, \u0027ports\u0027]).execute(check_error\u003dTrue)"},{"line_number":241,"context_line":"        lsp \u003d self.ovn_nbdb_api.lookup("},{"line_number":242,"context_line":"            \u0027Logical_Switch_Port\u0027, row.name["},{"line_number":243,"context_line":"                len(ovn_const.LRP_NAME):], default\u003dNone)"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_29d901f2","line":240,"range":{"start_line":235,"start_character":0,"end_line":240,"end_character":75},"in_reply_to":"3fce034c_426794be","updated":"2019-04-20 17:49:56.000000000","message":"Ok, so I was under the assumption that it is possible that the Network/Router is not found. In that case, I returned None and skipped the Add Event Handler/ Delete Event handler.\nI can catch the RowNotFound exception and treat it in the same way, I think the same is proposed in the next patch submitted by you :)","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":253,"context_line":"    def _get_nw_router_info_on_interface_delete(self, row):"},{"line_number":254,"context_line":"        try:"},{"line_number":255,"context_line":"            rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":256,"context_line":"                \u0027Logical_Router_Port\u0027, row.options.get(\u0027router-port\u0027))"},{"line_number":257,"context_line":"            router \u003d self.ovn_nbdb_api.lookup("},{"line_number":258,"context_line":"                \u0027Logical_Router\u0027,"},{"line_number":259,"context_line":"                ovn_utils.ovn_name("}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_5d19b51f","line":256,"updated":"2019-04-18 20:50:32.000000000","message":"possible TypeError if router-port not in options.","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"fb6bc4b1cfedd0b2abcbffc60b4d923c8fa25761","unresolved":false,"context_lines":[{"line_number":253,"context_line":"    def _get_nw_router_info_on_interface_delete(self, row):"},{"line_number":254,"context_line":"        try:"},{"line_number":255,"context_line":"            rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":256,"context_line":"                \u0027Logical_Router_Port\u0027, row.options.get(\u0027router-port\u0027))"},{"line_number":257,"context_line":"            router \u003d self.ovn_nbdb_api.lookup("},{"line_number":258,"context_line":"                \u0027Logical_Router\u0027,"},{"line_number":259,"context_line":"                ovn_utils.ovn_name("}],"source_content_type":"text/x-python","patch_set":60,"id":"ffb9cba7_d41741ed","line":256,"in_reply_to":"3fce034c_49e7adad","updated":"2019-04-21 15:41:35.000000000","message":"Done","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":253,"context_line":"    def _get_nw_router_info_on_interface_delete(self, row):"},{"line_number":254,"context_line":"        try:"},{"line_number":255,"context_line":"            rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":256,"context_line":"                \u0027Logical_Router_Port\u0027, row.options.get(\u0027router-port\u0027))"},{"line_number":257,"context_line":"            router \u003d self.ovn_nbdb_api.lookup("},{"line_number":258,"context_line":"                \u0027Logical_Router\u0027,"},{"line_number":259,"context_line":"                ovn_utils.ovn_name("}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_49e7adad","line":256,"in_reply_to":"3fce034c_5d19b51f","updated":"2019-04-20 17:49:56.000000000","message":"As mentioned below, I can catch the TypeError, KeyError and IndexError and return RowNotFound directly","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":257,"context_line":"            router \u003d self.ovn_nbdb_api.lookup("},{"line_number":258,"context_line":"                \u0027Logical_Router\u0027,"},{"line_number":259,"context_line":"                ovn_utils.ovn_name("},{"line_number":260,"context_line":"                    rport.external_ids[ovn_const.NEUTRON_ROUTER_NAME]))"},{"line_number":261,"context_line":"            network \u003d self.ovn_nbdb_api.lookup("},{"line_number":262,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":263,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_9dd15d26","line":260,"updated":"2019-04-18 20:50:32.000000000","message":"Possible KeyError if external_id missing. You don\u0027t want to use get(), because that will just lead to a TypeError later. We need to handle the Exceptions.","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"fb6bc4b1cfedd0b2abcbffc60b4d923c8fa25761","unresolved":false,"context_lines":[{"line_number":257,"context_line":"            router \u003d self.ovn_nbdb_api.lookup("},{"line_number":258,"context_line":"                \u0027Logical_Router\u0027,"},{"line_number":259,"context_line":"                ovn_utils.ovn_name("},{"line_number":260,"context_line":"                    rport.external_ids[ovn_const.NEUTRON_ROUTER_NAME]))"},{"line_number":261,"context_line":"            network \u003d self.ovn_nbdb_api.lookup("},{"line_number":262,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":263,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"}],"source_content_type":"text/x-python","patch_set":60,"id":"ffb9cba7_74d21537","line":260,"in_reply_to":"3fce034c_09052546","updated":"2019-04-21 15:41:35.000000000","message":"Done","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":257,"context_line":"            router \u003d self.ovn_nbdb_api.lookup("},{"line_number":258,"context_line":"                \u0027Logical_Router\u0027,"},{"line_number":259,"context_line":"                ovn_utils.ovn_name("},{"line_number":260,"context_line":"                    rport.external_ids[ovn_const.NEUTRON_ROUTER_NAME]))"},{"line_number":261,"context_line":"            network \u003d self.ovn_nbdb_api.lookup("},{"line_number":262,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":263,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_09052546","line":260,"in_reply_to":"3fce034c_9dd15d26","updated":"2019-04-20 17:49:56.000000000","message":"As mentioned below, I can catch the TypeError, KeyError and IndexError and return RowNotFound directly","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":259,"context_line":"                ovn_utils.ovn_name("},{"line_number":260,"context_line":"                    rport.external_ids[ovn_const.NEUTRON_ROUTER_NAME]))"},{"line_number":261,"context_line":"            network \u003d self.ovn_nbdb_api.lookup("},{"line_number":262,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":263,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"},{"line_number":264,"context_line":"            return router, network"},{"line_number":265,"context_line":"        except IndexError:"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_3da8698b","line":262,"updated":"2019-04-18 20:50:32.000000000","message":"Possible TypeError if get() return None","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":259,"context_line":"                ovn_utils.ovn_name("},{"line_number":260,"context_line":"                    rport.external_ids[ovn_const.NEUTRON_ROUTER_NAME]))"},{"line_number":261,"context_line":"            network \u003d self.ovn_nbdb_api.lookup("},{"line_number":262,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":263,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"},{"line_number":264,"context_line":"            return router, network"},{"line_number":265,"context_line":"        except IndexError:"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_2902613e","line":262,"in_reply_to":"3fce034c_3da8698b","updated":"2019-04-20 17:49:56.000000000","message":"As mentioned below, I can catch the TypeError, KeyError and IndexError and return RowNotFound directly","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"fb6bc4b1cfedd0b2abcbffc60b4d923c8fa25761","unresolved":false,"context_lines":[{"line_number":259,"context_line":"                ovn_utils.ovn_name("},{"line_number":260,"context_line":"                    rport.external_ids[ovn_const.NEUTRON_ROUTER_NAME]))"},{"line_number":261,"context_line":"            network \u003d self.ovn_nbdb_api.lookup("},{"line_number":262,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":263,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"},{"line_number":264,"context_line":"            return router, network"},{"line_number":265,"context_line":"        except IndexError:"}],"source_content_type":"text/x-python","patch_set":60,"id":"ffb9cba7_b4ef2de8","line":262,"in_reply_to":"3fce034c_3da8698b","updated":"2019-04-21 15:41:35.000000000","message":"Done","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"0b00c4b9620a951c92477b7bf5c683a014b41084","unresolved":false,"context_lines":[{"line_number":262,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":263,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"},{"line_number":264,"context_line":"            return router, network"},{"line_number":265,"context_line":"        except IndexError:"},{"line_number":266,"context_line":"            return None, None"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":269,"context_line":"        # TODO(reedip): When OVS\u003e\u003d2.12, LB can be deleted without removing"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_e386e6db","line":266,"range":{"start_line":265,"start_character":8,"end_line":266,"end_character":29},"updated":"2019-04-17 08:46:32.000000000","message":"The only bit that raise an IndexError in the code seems to be L260. \n\nIt\u0027s not a big deal but, I would replace that direct index with a external_ids.get(..., \u0027\u0027) that way we can get rid of this handler here.","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"fb6bc4b1cfedd0b2abcbffc60b4d923c8fa25761","unresolved":false,"context_lines":[{"line_number":262,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":263,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"},{"line_number":264,"context_line":"            return router, network"},{"line_number":265,"context_line":"        except IndexError:"},{"line_number":266,"context_line":"            return None, None"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":269,"context_line":"        # TODO(reedip): When OVS\u003e\u003d2.12, LB can be deleted without removing"}],"source_content_type":"text/x-python","patch_set":60,"id":"ffb9cba7_f4e5a50b","line":266,"range":{"start_line":265,"start_character":8,"end_line":266,"end_character":29},"in_reply_to":"3fce034c_9dc71d97","updated":"2019-04-21 15:41:35.000000000","message":"Done","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":262,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":263,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"},{"line_number":264,"context_line":"            return router, network"},{"line_number":265,"context_line":"        except IndexError:"},{"line_number":266,"context_line":"            return None, None"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":269,"context_line":"        # TODO(reedip): When OVS\u003e\u003d2.12, LB can be deleted without removing"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_e9de99d8","line":266,"range":{"start_line":265,"start_character":8,"end_line":266,"end_character":29},"in_reply_to":"3fce034c_9dc71d97","updated":"2019-04-20 17:49:56.000000000","message":"Ok, will do the same .","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":262,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":263,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"},{"line_number":264,"context_line":"            return router, network"},{"line_number":265,"context_line":"        except IndexError:"},{"line_number":266,"context_line":"            return None, None"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":269,"context_line":"        # TODO(reedip): When OVS\u003e\u003d2.12, LB can be deleted without removing"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_9dc71d97","line":266,"range":{"start_line":265,"start_character":8,"end_line":266,"end_character":29},"in_reply_to":"3fce034c_e386e6db","updated":"2019-04-18 20:50:32.000000000","message":"Wouldn\u0027t line 260 be a KeyError possibility and not an IndexError? Seems like the IndexError came from doing a get() and it could return None and that produced an IndexError (or TypeError? when passed to db_find/lookup).\n\nIn general, we should avoid using get/None w/ ovsdbapp lookups/queries. Accidentally passing a None through can result in weird exceptions in idlutils. I think this try/except can just be removed and delete_event_handler should probably check for idlutils.RowNotFound since we are doing lookup() calls now and not do \"if router and network:\".","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b1ef3902f344814e455a8ed93f650e6966f569c0","unresolved":false,"context_lines":[{"line_number":262,"context_line":"                \u0027Logical_Switch\u0027, row.external_ids.get("},{"line_number":263,"context_line":"                    ovn_const.NEUTRON_NET_NAME))"},{"line_number":264,"context_line":"            return router, network"},{"line_number":265,"context_line":"        except IndexError:"},{"line_number":266,"context_line":"            return None, None"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":269,"context_line":"        # TODO(reedip): When OVS\u003e\u003d2.12, LB can be deleted without removing"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_ce03d172","line":266,"range":{"start_line":265,"start_character":8,"end_line":266,"end_character":29},"in_reply_to":"3fce034c_e386e6db","updated":"2019-04-17 15:13:45.000000000","message":"Yeah, thats possible to be done.\nMakes sense , since we can set the default values directly as well","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        router, network \u003d self._get_nw_router_info_on_interface_delete(row)"},{"line_number":275,"context_line":"        if router and network:"},{"line_number":276,"context_line":"            # Find all loadbalancers which have a reference with the network"},{"line_number":277,"context_line":"            nw_lb \u003d set(self._find_lb_in_ls(network\u003dnetwork))"},{"line_number":278,"context_line":"            # Find all loadbalancers which have a reference with the router"},{"line_number":279,"context_line":"            r_lb \u003d {str(r.uuid) for r in router.load_balancer} - nw_lb"},{"line_number":280,"context_line":"            # Delete all LB on N/W from Router"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_e8af817a","line":277,"updated":"2019-04-18 20:50:32.000000000","message":"see below, _find_lb_in_ls should return rows, not stringified uuids.","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        router, network \u003d self._get_nw_router_info_on_interface_delete(row)"},{"line_number":275,"context_line":"        if router and network:"},{"line_number":276,"context_line":"            # Find all loadbalancers which have a reference with the network"},{"line_number":277,"context_line":"            nw_lb \u003d set(self._find_lb_in_ls(network\u003dnetwork))"},{"line_number":278,"context_line":"            # Find all loadbalancers which have a reference with the router"},{"line_number":279,"context_line":"            r_lb \u003d {str(r.uuid) for r in router.load_balancer} - nw_lb"},{"line_number":280,"context_line":"            # Delete all LB on N/W from Router"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_2987c1b7","line":277,"in_reply_to":"3fce034c_e8af817a","updated":"2019-04-20 17:49:56.000000000","message":"ok","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":276,"context_line":"            # Find all loadbalancers which have a reference with the network"},{"line_number":277,"context_line":"            nw_lb \u003d set(self._find_lb_in_ls(network\u003dnetwork))"},{"line_number":278,"context_line":"            # Find all loadbalancers which have a reference with the router"},{"line_number":279,"context_line":"            r_lb \u003d {str(r.uuid) for r in router.load_balancer} - nw_lb"},{"line_number":280,"context_line":"            # Delete all LB on N/W from Router"},{"line_number":281,"context_line":"            for lb in nw_lb:"},{"line_number":282,"context_line":"                commands.extend(self._update_lb_to_lr_association("}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_c8cac54c","line":279,"updated":"2019-04-18 20:50:32.000000000","message":"no need to do str/.uuid here, just set(router.load_balancer) - nw_lb","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":276,"context_line":"            # Find all loadbalancers which have a reference with the network"},{"line_number":277,"context_line":"            nw_lb \u003d set(self._find_lb_in_ls(network\u003dnetwork))"},{"line_number":278,"context_line":"            # Find all loadbalancers which have a reference with the router"},{"line_number":279,"context_line":"            r_lb \u003d {str(r.uuid) for r in router.load_balancer} - nw_lb"},{"line_number":280,"context_line":"            # Delete all LB on N/W from Router"},{"line_number":281,"context_line":"            for lb in nw_lb:"},{"line_number":282,"context_line":"                commands.extend(self._update_lb_to_lr_association("}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_098a05be","line":279,"in_reply_to":"3fce034c_c8cac54c","updated":"2019-04-20 17:49:56.000000000","message":"ok","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":280,"context_line":"            # Delete all LB on N/W from Router"},{"line_number":281,"context_line":"            for lb in nw_lb:"},{"line_number":282,"context_line":"                commands.extend(self._update_lb_to_lr_association("},{"line_number":283,"context_line":"                    self._find_ovn_lb("},{"line_number":284,"context_line":"                        uuid.UUID(lb), uid\u003dTrue), router, delete\u003dTrue))"},{"line_number":285,"context_line":"            # Delete all LB on Router from N/W"},{"line_number":286,"context_line":"            for loadb in r_lb:"},{"line_number":287,"context_line":"                commands.append(self.ovn_nbdb_api.ls_lb_del("}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_c8cf2554","line":284,"range":{"start_line":283,"start_character":20,"end_line":284,"end_character":37},"updated":"2019-04-18 20:50:32.000000000","message":"If we have Row objects here after my previous suggestions, no need to find a Row we already have. Just becomes \u0027lb\u0027.","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"fb6bc4b1cfedd0b2abcbffc60b4d923c8fa25761","unresolved":false,"context_lines":[{"line_number":280,"context_line":"            # Delete all LB on N/W from Router"},{"line_number":281,"context_line":"            for lb in nw_lb:"},{"line_number":282,"context_line":"                commands.extend(self._update_lb_to_lr_association("},{"line_number":283,"context_line":"                    self._find_ovn_lb("},{"line_number":284,"context_line":"                        uuid.UUID(lb), uid\u003dTrue), router, delete\u003dTrue))"},{"line_number":285,"context_line":"            # Delete all LB on Router from N/W"},{"line_number":286,"context_line":"            for loadb in r_lb:"},{"line_number":287,"context_line":"                commands.append(self.ovn_nbdb_api.ls_lb_del("}],"source_content_type":"text/x-python","patch_set":60,"id":"ffb9cba7_948ea92c","line":284,"range":{"start_line":283,"start_character":20,"end_line":284,"end_character":37},"in_reply_to":"3fce034c_c8cf2554","updated":"2019-04-21 15:41:35.000000000","message":"Done","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":280,"context_line":"            # Delete all LB on N/W from Router"},{"line_number":281,"context_line":"            for lb in nw_lb:"},{"line_number":282,"context_line":"                commands.extend(self._update_lb_to_lr_association("},{"line_number":283,"context_line":"                    self._find_ovn_lb("},{"line_number":284,"context_line":"                        uuid.UUID(lb), uid\u003dTrue), router, delete\u003dTrue))"},{"line_number":285,"context_line":"            # Delete all LB on Router from N/W"},{"line_number":286,"context_line":"            for loadb in r_lb:"},{"line_number":287,"context_line":"                commands.append(self.ovn_nbdb_api.ls_lb_del("}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_89bfd55f","line":284,"range":{"start_line":283,"start_character":20,"end_line":284,"end_character":37},"in_reply_to":"3fce034c_c8cf2554","updated":"2019-04-20 17:49:56.000000000","message":"if find_lb_in_ls returns rows, then definitely not required to do another find here","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":292,"context_line":"        commands \u003d []"},{"line_number":293,"context_line":"        router, network \u003d self._get_nw_router_info_on_interface_add(row)"},{"line_number":294,"context_line":"        if router and network:"},{"line_number":295,"context_line":"            router_lb \u003d {str(lb.uuid) for lb in router.load_balancer}"},{"line_number":296,"context_line":"            network_lb \u003d {str(lb.uuid) for lb in network.load_balancer}"},{"line_number":297,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":298,"context_line":"                lb for lb in network.load_balancer]"},{"line_number":299,"context_line":"            # if the network has any loadbalancer not in router lb"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_a2a438a7","line":296,"range":{"start_line":295,"start_character":0,"end_line":296,"end_character":71},"updated":"2019-04-18 20:50:32.000000000","message":"There is no reason to use str() or .uuid here and in lines 302, and 306. __eq__ in Row checks by uuid. Also, can just be set(router.load_balancer) etc. no need to do comprehension.","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"fb6bc4b1cfedd0b2abcbffc60b4d923c8fa25761","unresolved":false,"context_lines":[{"line_number":292,"context_line":"        commands \u003d []"},{"line_number":293,"context_line":"        router, network \u003d self._get_nw_router_info_on_interface_add(row)"},{"line_number":294,"context_line":"        if router and network:"},{"line_number":295,"context_line":"            router_lb \u003d {str(lb.uuid) for lb in router.load_balancer}"},{"line_number":296,"context_line":"            network_lb \u003d {str(lb.uuid) for lb in network.load_balancer}"},{"line_number":297,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":298,"context_line":"                lb for lb in network.load_balancer]"},{"line_number":299,"context_line":"            # if the network has any loadbalancer not in router lb"}],"source_content_type":"text/x-python","patch_set":60,"id":"ffb9cba7_34833d07","line":296,"range":{"start_line":295,"start_character":0,"end_line":296,"end_character":71},"in_reply_to":"3fce034c_a2a438a7","updated":"2019-04-21 15:41:35.000000000","message":"Done","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":292,"context_line":"        commands \u003d []"},{"line_number":293,"context_line":"        router, network \u003d self._get_nw_router_info_on_interface_add(row)"},{"line_number":294,"context_line":"        if router and network:"},{"line_number":295,"context_line":"            router_lb \u003d {str(lb.uuid) for lb in router.load_balancer}"},{"line_number":296,"context_line":"            network_lb \u003d {str(lb.uuid) for lb in network.load_balancer}"},{"line_number":297,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":298,"context_line":"                lb for lb in network.load_balancer]"},{"line_number":299,"context_line":"            # if the network has any loadbalancer not in router lb"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_a9c411f6","line":296,"range":{"start_line":295,"start_character":0,"end_line":296,"end_character":71},"in_reply_to":"3fce034c_a2a438a7","updated":"2019-04-20 17:49:56.000000000","message":"ok","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":297,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":298,"context_line":"                lb for lb in network.load_balancer]"},{"line_number":299,"context_line":"            # if the network has any loadbalancer not in router lb"},{"line_number":300,"context_line":"            for l in lb_list:"},{"line_number":301,"context_line":"                for lb in (network_lb - router_lb):"},{"line_number":302,"context_line":"                    if str(l.uuid) \u003d\u003d lb:"},{"line_number":303,"context_line":"                        commands.extend("}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_5db69540","line":300,"updated":"2019-04-18 20:50:32.000000000","message":"I don\u0027t see any use for this outer loop/lb_list since we are only doing anything when l \u003d\u003d lb in the inner loops. So where you pass l as an argument, you can just pass lb and skip the if l\u003d\u003dlb. The LoadBalancer has to exist if it is linked in the router/switch.","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":297,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":298,"context_line":"                lb for lb in network.load_balancer]"},{"line_number":299,"context_line":"            # if the network has any loadbalancer not in router lb"},{"line_number":300,"context_line":"            for l in lb_list:"},{"line_number":301,"context_line":"                for lb in (network_lb - router_lb):"},{"line_number":302,"context_line":"                    if str(l.uuid) \u003d\u003d lb:"},{"line_number":303,"context_line":"                        commands.extend("}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_496a4ded","line":300,"in_reply_to":"3fce034c_5db69540","updated":"2019-04-20 17:49:56.000000000","message":"Actually, even if it fails, exception will be raised by ovsdbapp, so outer Loop can be removed as such. Just the simple set(n/w)- set(router) can work and vice versa","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"fb6bc4b1cfedd0b2abcbffc60b4d923c8fa25761","unresolved":false,"context_lines":[{"line_number":297,"context_line":"            lb_list \u003d [lb for lb in router.load_balancer] + ["},{"line_number":298,"context_line":"                lb for lb in network.load_balancer]"},{"line_number":299,"context_line":"            # if the network has any loadbalancer not in router lb"},{"line_number":300,"context_line":"            for l in lb_list:"},{"line_number":301,"context_line":"                for lb in (network_lb - router_lb):"},{"line_number":302,"context_line":"                    if str(l.uuid) \u003d\u003d lb:"},{"line_number":303,"context_line":"                        commands.extend("}],"source_content_type":"text/x-python","patch_set":60,"id":"ffb9cba7_f47cc521","line":300,"in_reply_to":"3fce034c_5db69540","updated":"2019-04-21 15:41:35.000000000","message":"Done","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":308,"context_line":"                            network.uuid, l.uuid, may_exist\u003dTrue))"},{"line_number":309,"context_line":"        self._execute_commands(commands)"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"    def _find_lb_in_ls(self, network):"},{"line_number":312,"context_line":"        \"\"\"Find LB associated to a Network"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"        This function retrieves those loadbalancers whose ls_ref"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_481b35cf","line":311,"updated":"2019-04-18 20:50:32.000000000","message":"This method should just return a set of loadbalancers, not a list of stringified uuids that then gets transformed into a set of stringified uuids, which might get turned back into uuids to pass to find() to get back a loadbalancer. :)","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":308,"context_line":"                            network.uuid, l.uuid, may_exist\u003dTrue))"},{"line_number":309,"context_line":"        self._execute_commands(commands)"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"    def _find_lb_in_ls(self, network):"},{"line_number":312,"context_line":"        \"\"\"Find LB associated to a Network"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"        This function retrieves those loadbalancers whose ls_ref"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_297581cb","line":311,"in_reply_to":"3fce034c_481b35cf","updated":"2019-04-20 17:49:56.000000000","message":":D\nYeah, got the pieces in, now they can be improvised in performance :)","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"fb6bc4b1cfedd0b2abcbffc60b4d923c8fa25761","unresolved":false,"context_lines":[{"line_number":308,"context_line":"                            network.uuid, l.uuid, may_exist\u003dTrue))"},{"line_number":309,"context_line":"        self._execute_commands(commands)"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"    def _find_lb_in_ls(self, network):"},{"line_number":312,"context_line":"        \"\"\"Find LB associated to a Network"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"        This function retrieves those loadbalancers whose ls_ref"}],"source_content_type":"text/x-python","patch_set":60,"id":"ffb9cba7_147ab923","line":311,"in_reply_to":"3fce034c_481b35cf","updated":"2019-04-21 15:41:35.000000000","message":"Done","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        network."},{"line_number":321,"context_line":"        \"\"\""},{"line_number":322,"context_line":"        output \u003d []"},{"line_number":323,"context_line":"        if network:"},{"line_number":324,"context_line":"            for lb in network.load_balancer:"},{"line_number":325,"context_line":"                if network.name in lb.external_ids.get("},{"line_number":326,"context_line":"                    LB_EXT_IDS_LS_REFS_KEY):"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_0838cd3a","line":323,"updated":"2019-04-18 20:50:32.000000000","message":"Due to changes above, \u0027if network\u0027 can go away, it is guaranteed. In general, if your Python code has methods that start with \u0027if x:\u0027 and then the rest of the function is nested under that, you\u0027re writing C-like Python not Python-like Python. :)","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        network."},{"line_number":321,"context_line":"        \"\"\""},{"line_number":322,"context_line":"        output \u003d []"},{"line_number":323,"context_line":"        if network:"},{"line_number":324,"context_line":"            for lb in network.load_balancer:"},{"line_number":325,"context_line":"                if network.name in lb.external_ids.get("},{"line_number":326,"context_line":"                    LB_EXT_IDS_LS_REFS_KEY):"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_c97dddb2","line":323,"in_reply_to":"3fce034c_0838cd3a","updated":"2019-04-20 17:49:56.000000000","message":"I do suffer from that :)","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":322,"context_line":"        output \u003d []"},{"line_number":323,"context_line":"        if network:"},{"line_number":324,"context_line":"            for lb in network.load_balancer:"},{"line_number":325,"context_line":"                if network.name in lb.external_ids.get("},{"line_number":326,"context_line":"                    LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":327,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":328,"context_line":"        return output"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_287b49f5","line":325,"updated":"2019-04-18 20:50:32.000000000","message":"Using get() here can would make this possibly \u0027network.name in None\u0027 which is a TypeError, so get() doesn\u0027t actually help you avoid an Exception. If it is an error if this external_id is set, then we should use external_ids[...] and let the exception happen. Otherwise, it should be .get(..., []).","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":322,"context_line":"        output \u003d []"},{"line_number":323,"context_line":"        if network:"},{"line_number":324,"context_line":"            for lb in network.load_balancer:"},{"line_number":325,"context_line":"                if network.name in lb.external_ids.get("},{"line_number":326,"context_line":"                    LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":327,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":328,"context_line":"        return output"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_69486986","line":325,"in_reply_to":"3fce034c_287b49f5","updated":"2019-04-20 17:49:56.000000000","message":"Ok","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":324,"context_line":"            for lb in network.load_balancer:"},{"line_number":325,"context_line":"                if network.name in lb.external_ids.get("},{"line_number":326,"context_line":"                    LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":327,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":328,"context_line":"        return output"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    def _find_lb_in_table_using_id(self, lb_id, table):"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_88dfddd4","line":327,"updated":"2019-04-18 20:50:32.000000000","message":"So essentially, this method should probably just be:\n\n    return {lb for lb in network.load_balancer\n            if network.name in lb.external_ids.get(LB_EXT_IDS_LS_REFS_KEY, [])}","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":324,"context_line":"            for lb in network.load_balancer:"},{"line_number":325,"context_line":"                if network.name in lb.external_ids.get("},{"line_number":326,"context_line":"                    LB_EXT_IDS_LS_REFS_KEY):"},{"line_number":327,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":328,"context_line":"        return output"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    def _find_lb_in_table_using_id(self, lb_id, table):"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_0961a505","line":327,"in_reply_to":"3fce034c_88dfddd4","updated":"2019-04-20 17:49:56.000000000","message":"Ok","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6c626499ae136155e4b147af7af71bdb6951f052","unresolved":false,"context_lines":[{"line_number":327,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":328,"context_line":"        return output"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    def _find_lb_in_table_using_id(self, lb_id, table):"},{"line_number":331,"context_line":"        output \u003d []"},{"line_number":332,"context_line":"        for item in self.ovn_nbdb_api.tables[table].rows.values():"},{"line_number":333,"context_line":"            for row in item.load_balancer:"},{"line_number":334,"context_line":"                if str(lb_id) \u003d\u003d str(row.uuid):"},{"line_number":335,"context_line":"                    output.append(item)"},{"line_number":336,"context_line":"        return output"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def _find_lb_in_ls_using_id(self, lb_id):"},{"line_number":339,"context_line":"        # Find LB associated to a Network"},{"line_number":340,"context_line":"        return self._find_lb_in_table_using_id(lb_id, \u0027Logical_Switch\u0027)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    def _find_lb_in_lr_using_id(self, lb_id):"},{"line_number":343,"context_line":"        # Find LB associated to a Router"},{"line_number":344,"context_line":"        return self._find_lb_in_table_using_id(lb_id, \u0027Logical_Router\u0027)"},{"line_number":345,"context_line":""},{"line_number":346,"context_line":"    def request_handler(self):"},{"line_number":347,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_353e3dda","line":344,"range":{"start_line":330,"start_character":0,"end_line":344,"end_character":71},"updated":"2019-04-18 20:50:32.000000000","message":"nit: there\u0027s no real reason to just do this by uuid since you can just pass the loadbalancer in and then compare it directly to the Row since Row.__eq__ compares uuids. That way instead of\n\n    if (str(lb_id) \u003d\u003d str(row.uuid):\n\nyou can just do:\n\n    if (lb \u003d\u003d row):\n\nIf you want to be fancy, you can avoid all of the appends by making this:\n\n    def _find_lb_in_table_using_id(self, lb, table):\n        return [item for item in self.ovn_nbdb_api.tables[table].rows.values()\n                if lb in item.load_balancer]","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":327,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":328,"context_line":"        return output"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    def _find_lb_in_table_using_id(self, lb_id, table):"},{"line_number":331,"context_line":"        output \u003d []"},{"line_number":332,"context_line":"        for item in self.ovn_nbdb_api.tables[table].rows.values():"},{"line_number":333,"context_line":"            for row in item.load_balancer:"},{"line_number":334,"context_line":"                if str(lb_id) \u003d\u003d str(row.uuid):"},{"line_number":335,"context_line":"                    output.append(item)"},{"line_number":336,"context_line":"        return output"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def _find_lb_in_ls_using_id(self, lb_id):"},{"line_number":339,"context_line":"        # Find LB associated to a Network"},{"line_number":340,"context_line":"        return self._find_lb_in_table_using_id(lb_id, \u0027Logical_Switch\u0027)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    def _find_lb_in_lr_using_id(self, lb_id):"},{"line_number":343,"context_line":"        # Find LB associated to a Router"},{"line_number":344,"context_line":"        return self._find_lb_in_table_using_id(lb_id, \u0027Logical_Router\u0027)"},{"line_number":345,"context_line":""},{"line_number":346,"context_line":"    def request_handler(self):"},{"line_number":347,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_e953f937","line":344,"range":{"start_line":330,"start_character":0,"end_line":344,"end_character":71},"in_reply_to":"3fce034c_353e3dda","updated":"2019-04-20 17:49:56.000000000","message":"I didnt know exactly that the Row__eq__ compares the UUID ( Lucas also explained the same below ). Will make sure that this taken care of :)","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"fb6bc4b1cfedd0b2abcbffc60b4d923c8fa25761","unresolved":false,"context_lines":[{"line_number":327,"context_line":"                    output.append(str(lb.uuid))"},{"line_number":328,"context_line":"        return output"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    def _find_lb_in_table_using_id(self, lb_id, table):"},{"line_number":331,"context_line":"        output \u003d []"},{"line_number":332,"context_line":"        for item in self.ovn_nbdb_api.tables[table].rows.values():"},{"line_number":333,"context_line":"            for row in item.load_balancer:"},{"line_number":334,"context_line":"                if str(lb_id) \u003d\u003d str(row.uuid):"},{"line_number":335,"context_line":"                    output.append(item)"},{"line_number":336,"context_line":"        return output"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def _find_lb_in_ls_using_id(self, lb_id):"},{"line_number":339,"context_line":"        # Find LB associated to a Network"},{"line_number":340,"context_line":"        return self._find_lb_in_table_using_id(lb_id, \u0027Logical_Switch\u0027)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    def _find_lb_in_lr_using_id(self, lb_id):"},{"line_number":343,"context_line":"        # Find LB associated to a Router"},{"line_number":344,"context_line":"        return self._find_lb_in_table_using_id(lb_id, \u0027Logical_Router\u0027)"},{"line_number":345,"context_line":""},{"line_number":346,"context_line":"    def request_handler(self):"},{"line_number":347,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":60,"id":"ffb9cba7_b4abad73","line":344,"range":{"start_line":330,"start_character":0,"end_line":344,"end_character":71},"in_reply_to":"3fce034c_e953f937","updated":"2019-04-21 15:41:35.000000000","message":"So , I have removed the last 2 functions, and kept the first one, because the function definition are one liner and they are called only once, so no need to do the call.","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"0b00c4b9620a951c92477b7bf5c683a014b41084","unresolved":false,"context_lines":[{"line_number":373,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027,"},{"line_number":374,"context_line":"                      e.fault_string)"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uid\u003dFalse):"},{"line_number":377,"context_line":"        \"\"\"loadbalancer_id can be name/id.Use uuid\u003dTrue to find with uuid\"\"\""},{"line_number":378,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uid else ("},{"line_number":379,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_03f1b26b","line":376,"range":{"start_line":376,"start_character":43,"end_line":376,"end_character":53},"updated":"2019-04-17 08:46:32.000000000","message":"nit: This parameter is not really needed:\n\nuid \u003d isinstance(loadbalance_id, uuid.UUID)","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"0f5db94acafe6a9b045480d08fdb0e3759897900","unresolved":false,"context_lines":[{"line_number":373,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027,"},{"line_number":374,"context_line":"                      e.fault_string)"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uid\u003dFalse):"},{"line_number":377,"context_line":"        \"\"\"loadbalancer_id can be name/id.Use uuid\u003dTrue to find with uuid\"\"\""},{"line_number":378,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uid else ("},{"line_number":379,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_0b268469","line":376,"range":{"start_line":376,"start_character":43,"end_line":376,"end_character":53},"in_reply_to":"3fce034c_03f1b26b","updated":"2019-04-18 23:31:57.000000000","message":"Also, nothing ever passes a uid\u003dTrue. And even easier, if you don\u0027t really need the check for duplicate names, this function is just:\n\n   return self.ovn_nbdb_api.lookup(\u0027Load_Balancer\u0027, loadbalancer_id)\n\nbecause it accepts names, indexed values andlookup_table values, uuids and string representations of uuids. If you look up by uuid instead of name, then duplicates wouldn\u0027t be possible.","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b1ef3902f344814e455a8ed93f650e6966f569c0","unresolved":false,"context_lines":[{"line_number":373,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027,"},{"line_number":374,"context_line":"                      e.fault_string)"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uid\u003dFalse):"},{"line_number":377,"context_line":"        \"\"\"loadbalancer_id can be name/id.Use uuid\u003dTrue to find with uuid\"\"\""},{"line_number":378,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uid else ("},{"line_number":379,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_4eefe1af","line":376,"range":{"start_line":376,"start_character":43,"end_line":376,"end_character":53},"in_reply_to":"3fce034c_03f1b26b","updated":"2019-04-17 15:13:45.000000000","message":"Ok, that can be done.","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":373,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027,"},{"line_number":374,"context_line":"                      e.fault_string)"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uid\u003dFalse):"},{"line_number":377,"context_line":"        \"\"\"loadbalancer_id can be name/id.Use uuid\u003dTrue to find with uuid\"\"\""},{"line_number":378,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uid else ("},{"line_number":379,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_49380ded","line":376,"range":{"start_line":376,"start_character":43,"end_line":376,"end_character":53},"in_reply_to":"3fce034c_0b268469","updated":"2019-04-20 17:49:56.000000000","message":"Done","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"fb6bc4b1cfedd0b2abcbffc60b4d923c8fa25761","unresolved":false,"context_lines":[{"line_number":373,"context_line":"            LOG.error(\u0027Error while updating the load balancer status: %s\u0027,"},{"line_number":374,"context_line":"                      e.fault_string)"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"    def _find_ovn_lb(self, loadbalancer_id, uid\u003dFalse):"},{"line_number":377,"context_line":"        \"\"\"loadbalancer_id can be name/id.Use uuid\u003dTrue to find with uuid\"\"\""},{"line_number":378,"context_line":"        find_condition \u003d (\u0027name\u0027, \u0027\u003d\u0027, loadbalancer_id) if not uid else ("},{"line_number":379,"context_line":"            \u0027_uuid\u0027, \u0027\u003d\u0027, loadbalancer_id)"}],"source_content_type":"text/x-python","patch_set":60,"id":"ffb9cba7_74dc5518","line":376,"range":{"start_line":376,"start_character":43,"end_line":376,"end_character":53},"in_reply_to":"3fce034c_0b268469","updated":"2019-04-21 15:41:35.000000000","message":"So the thing is, the loadbalancer_id here is the ID generated by Octavia, which is appended in the loadbalancer\u0027s name in OVN\u0027s Load_balancer table and received by the OVN driver during the API request, and that should never be the same, so yeah, Terry\u0027s comment should work without a hitch","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"0f5db94acafe6a9b045480d08fdb0e3759897900","unresolved":false,"context_lines":[{"line_number":455,"context_line":""},{"line_number":456,"context_line":"        return commands"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    def _del_lb_to_lr_association(self, ovn_lb, ovn_lr, lr_ref):"},{"line_number":459,"context_line":"        commands \u003d []"},{"line_number":460,"context_line":"        if lr_ref:"},{"line_number":461,"context_line":"            lr_ref \u003d lr_ref.replace(\u0027 \u0027 + ovn_lr.name, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_ae717e0e","line":458,"updated":"2019-04-18 23:31:57.000000000","message":"I do not understand the *_lb_to_lr_association methods.\n\nSome places in the code (like lb_delete()) treat LB_EXT_IDS_LR_REF_KEY values as though they are a single value with no space. But the _add_lb_to_lr_association code makes it look like there would always be a leading space for a single value. It seems like at the very least something like\n\n    \u0027 \u0027.join([ref for ref in [lr_ref, ovn_lr.name] if ref])\n\ncould be used to make sure a single item doesn\u0027t have a leading space (and you want to handle \u0027\u0027 and None).\n\nIn this method it looks like: if the ref doesn\u0027t match what we expect from the ovn_lr name, we set the ref on the LB external_keys to...what it was before since lr_ref is passed as ovn_lb.external_ids.get(LB_EXT_IDS_LR_REF_KEY)? Am I reading that right? Otherwise we remove the ref key. But then we end up removing the LB from the LS anyway whether or not lr_ref is set.\n\nI\u0027m sure this all makes sense, but the fact I\u0027ve been staring at this for an hour means at the very least it could use some docs. The whole \u0027 \u0027 + lr_ref for everything stored in the external_id field and having the tests look for field[1:] feels like a hack. Some methods for appending to/processing that field could make it a little less messy and easier to understand as well.","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":455,"context_line":""},{"line_number":456,"context_line":"        return commands"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"    def _del_lb_to_lr_association(self, ovn_lb, ovn_lr, lr_ref):"},{"line_number":459,"context_line":"        commands \u003d []"},{"line_number":460,"context_line":"        if lr_ref:"},{"line_number":461,"context_line":"            lr_ref \u003d lr_ref.replace(\u0027 \u0027 + ovn_lr.name, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_891b557f","line":458,"in_reply_to":"3fce034c_ae717e0e","updated":"2019-04-20 17:49:56.000000000","message":"Thanks, I understood the feedback, and would do something to improvise on this","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"0b00c4b9620a951c92477b7bf5c683a014b41084","unresolved":false,"context_lines":[{"line_number":546,"context_line":"            if ovn_utils.ovn_lrouter_port_name("},{"line_number":547,"context_line":"                lr.external_ids.get(\"neutron:gw_port_id\")) \u003d\u003d lrp_name:"},{"line_number":548,"context_line":"                return lr"},{"line_number":549,"context_line":"            # Handles networks with only gateway Port"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"    def _get_listener_key(self, listener_id, is_enabled\u003dTrue):"},{"line_number":552,"context_line":"        listener_key \u003d LB_EXT_IDS_LISTENER_PREFIX + str(listener_id)"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_c3d16acf","line":549,"range":{"start_line":549,"start_character":12,"end_line":549,"end_character":53},"updated":"2019-04-17 08:46:32.000000000","message":"nit: this probably should be above the code that handles this case","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"fb6bc4b1cfedd0b2abcbffc60b4d923c8fa25761","unresolved":false,"context_lines":[{"line_number":546,"context_line":"            if ovn_utils.ovn_lrouter_port_name("},{"line_number":547,"context_line":"                lr.external_ids.get(\"neutron:gw_port_id\")) \u003d\u003d lrp_name:"},{"line_number":548,"context_line":"                return lr"},{"line_number":549,"context_line":"            # Handles networks with only gateway Port"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"    def _get_listener_key(self, listener_id, is_enabled\u003dTrue):"},{"line_number":552,"context_line":"        listener_key \u003d LB_EXT_IDS_LISTENER_PREFIX + str(listener_id)"}],"source_content_type":"text/x-python","patch_set":60,"id":"ffb9cba7_7405357a","line":549,"range":{"start_line":549,"start_character":12,"end_line":549,"end_character":53},"in_reply_to":"3fce034c_6e3f3d25","updated":"2019-04-21 15:41:35.000000000","message":"Done","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b1ef3902f344814e455a8ed93f650e6966f569c0","unresolved":false,"context_lines":[{"line_number":546,"context_line":"            if ovn_utils.ovn_lrouter_port_name("},{"line_number":547,"context_line":"                lr.external_ids.get(\"neutron:gw_port_id\")) \u003d\u003d lrp_name:"},{"line_number":548,"context_line":"                return lr"},{"line_number":549,"context_line":"            # Handles networks with only gateway Port"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"    def _get_listener_key(self, listener_id, is_enabled\u003dTrue):"},{"line_number":552,"context_line":"        listener_key \u003d LB_EXT_IDS_LISTENER_PREFIX + str(listener_id)"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_6e3f3d25","line":549,"range":{"start_line":549,"start_character":12,"end_line":549,"end_character":53},"in_reply_to":"3fce034c_c3d16acf","updated":"2019-04-17 15:13:45.000000000","message":"yeah, fixing it","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"0b00c4b9620a951c92477b7bf5c683a014b41084","unresolved":false,"context_lines":[{"line_number":1334,"context_line":"                     \u0027provisioning_status\u0027: constants.ACTIVE})"},{"line_number":1335,"context_line":"            status[\u0027listeners\u0027] \u003d listener_status"},{"line_number":1336,"context_line":"        except Exception:"},{"line_number":1337,"context_line":"            LOG.error(\"Exception occurred during Member Update\")"},{"line_number":1338,"context_line":"            status \u003d {"},{"line_number":1339,"context_line":"                \u0027pools\u0027: [{\u0027id\u0027: member[\u0027pool_id\u0027],"},{"line_number":1340,"context_line":"                           \u0027provisioning_status\u0027: constants.ACTIVE}],"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_a3ad3e32","line":1337,"range":{"start_line":1337,"start_character":12,"end_line":1337,"end_character":64},"updated":"2019-04-17 08:46:32.000000000","message":"This should be a LOG.exception() like the other logs in similar situation","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"db21b3fa7ca42be12c6a0f0c36a2cc22751b40e0","unresolved":false,"context_lines":[{"line_number":1334,"context_line":"                     \u0027provisioning_status\u0027: constants.ACTIVE})"},{"line_number":1335,"context_line":"            status[\u0027listeners\u0027] \u003d listener_status"},{"line_number":1336,"context_line":"        except Exception:"},{"line_number":1337,"context_line":"            LOG.error(\"Exception occurred during Member Update\")"},{"line_number":1338,"context_line":"            status \u003d {"},{"line_number":1339,"context_line":"                \u0027pools\u0027: [{\u0027id\u0027: member[\u0027pool_id\u0027],"},{"line_number":1340,"context_line":"                           \u0027provisioning_status\u0027: constants.ACTIVE}],"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_69162958","line":1337,"range":{"start_line":1337,"start_character":12,"end_line":1337,"end_character":64},"in_reply_to":"3fce034c_0e18f9d0","updated":"2019-04-20 17:49:56.000000000","message":"Fixed in the exception message patch","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b1ef3902f344814e455a8ed93f650e6966f569c0","unresolved":false,"context_lines":[{"line_number":1334,"context_line":"                     \u0027provisioning_status\u0027: constants.ACTIVE})"},{"line_number":1335,"context_line":"            status[\u0027listeners\u0027] \u003d listener_status"},{"line_number":1336,"context_line":"        except Exception:"},{"line_number":1337,"context_line":"            LOG.error(\"Exception occurred during Member Update\")"},{"line_number":1338,"context_line":"            status \u003d {"},{"line_number":1339,"context_line":"                \u0027pools\u0027: [{\u0027id\u0027: member[\u0027pool_id\u0027],"},{"line_number":1340,"context_line":"                           \u0027provisioning_status\u0027: constants.ACTIVE}],"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fce034c_0e18f9d0","line":1337,"range":{"start_line":1337,"start_character":12,"end_line":1337,"end_character":64},"in_reply_to":"3fce034c_a3ad3e32","updated":"2019-04-17 15:13:45.000000000","message":"I guess most of these things were handled in the other patch which handles the exceptions, but I can fix it here as well","commit_id":"451f0e49a9b9aa94a41b4d0011254f30e14bb5c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"9db6ba3931bc76c214309ed3002eecb719c2e0ac","unresolved":false,"context_lines":[{"line_number":343,"context_line":"                if network.name in lb.external_ids.get(LB_EXT_IDS_LS_REFS_KEY,"},{"line_number":344,"context_line":"                                                       [])}"},{"line_number":345,"context_line":""},{"line_number":346,"context_line":"    def _find_lb_in_table(self, lb, table):"},{"line_number":347,"context_line":"        return [item for item in self.ovn_nbdb_api.tables[table].rows.values()"},{"line_number":348,"context_line":"                if lb in item.load_balancer]"},{"line_number":349,"context_line":""}],"source_content_type":"text/x-python","patch_set":61,"id":"ffb9cba7_9339cd42","line":346,"range":{"start_line":346,"start_character":32,"end_line":346,"end_character":34},"updated":"2019-04-23 02:55:05.000000000","message":"This fails here, lb is an ID, but should be row, because of the comparisons we are doing below.\nSo need to change the same in the below calling","commit_id":"134f79b217c12053a51af9a2564b73d0b14cfe71"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e708aae158a9a461b9bbe37498e04d594790fbd9","unresolved":false,"context_lines":[{"line_number":493,"context_line":"    def _add_lb_to_lr_association(self, ovn_lb, ovn_lr, lr_rf):"},{"line_number":494,"context_line":"        commands \u003d []"},{"line_number":495,"context_line":"        lr_rf \u003d {LB_EXT_IDS_LR_REF_KEY: ovn_lr.name} if not lr_rf else {"},{"line_number":496,"context_line":"            LB_EXT_IDS_LR_REF_KEY: lr_rf + \",\" + ovn_lr.name}"},{"line_number":497,"context_line":"        # Multiple routers in lr_rf are separated with \u0027,\u0027"},{"line_number":498,"context_line":"        commands.append("},{"line_number":499,"context_line":"            self.ovn_nbdb_api.lr_lb_add(ovn_lr.uuid, ovn_lb.uuid,"}],"source_content_type":"text/x-python","patch_set":61,"id":"ffb9cba7_0c0a97d1","line":496,"updated":"2019-05-31 19:16:22.000000000","message":"nit:\n\n    lr_rf \u003d {LB_EXT_IDS_LR_REF_KEY:\n             \u0027,\u0027.join(x for x in [ovn_lr.name, lr_rf] if x)}","commit_id":"134f79b217c12053a51af9a2564b73d0b14cfe71"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"9db6ba3931bc76c214309ed3002eecb719c2e0ac","unresolved":false,"context_lines":[{"line_number":760,"context_line":"                    ls_refs \u003d jsonutils.loads(ls_refs)"},{"line_number":761,"context_line":"                except ValueError:"},{"line_number":762,"context_line":"                    ls_refs \u003d {}"},{"line_number":763,"context_line":"            # We need to delete the vip port"},{"line_number":764,"context_line":"            network_driver \u003d get_network_driver()"},{"line_number":765,"context_line":"            network_driver.neutron_client.delete_port("},{"line_number":766,"context_line":"                ovn_lb.external_ids[LB_EXT_IDS_VIP_PORT_ID_KEY])"},{"line_number":767,"context_line":"            for ls_name in ls_refs.keys():"},{"line_number":768,"context_line":"                ovn_ls \u003d self.ovn_nbdb_api.ls_get(ls_name).execute("},{"line_number":769,"context_line":"                    check_error\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":61,"id":"ffb9cba7_738219cb","line":766,"range":{"start_line":763,"start_character":0,"end_line":766,"end_character":64},"updated":"2019-04-23 02:55:05.000000000","message":"this is at the wrong place since this makes the delete code non-reentrant. If this section executes and failures occurs later, then port would have been deleted and the LoadBalancer wouldnt. That would cause subsequent lb delete commands to fail since Neutron client may never be able to find the ports","commit_id":"134f79b217c12053a51af9a2564b73d0b14cfe71"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"4682df6a6b3243303ea27a1d188fc48d3e13da43","unresolved":false,"context_lines":[{"line_number":1406,"context_line":"    def create_vip_port(self, project_id, lb_id, vip_d):"},{"line_number":1407,"context_line":"        port \u003d {\u0027port\u0027: {\u0027name\u0027: \u0027ovn-lb-vip-\u0027 + str(lb_id),"},{"line_number":1408,"context_line":"                         \u0027network_id\u0027: vip_d[\u0027vip_network_id\u0027],"},{"line_number":1409,"context_line":"                         \u0027fixed_ips\u0027: [{\u0027subnet_id\u0027: vip_d[\u0027vip_subnet_id\u0027]}],"},{"line_number":1410,"context_line":"                         \u0027admin_state_up\u0027: True,"},{"line_number":1411,"context_line":"                         \u0027project_id\u0027: project_id}}"},{"line_number":1412,"context_line":"        network_driver \u003d get_network_driver()"}],"source_content_type":"text/x-python","patch_set":61,"id":"ffb9cba7_3b1ec50c","line":1409,"range":{"start_line":1409,"start_character":25,"end_line":1409,"end_character":78},"updated":"2019-04-22 10:49:46.000000000","message":"should also consider the IP address if provided by the User.","commit_id":"134f79b217c12053a51af9a2564b73d0b14cfe71"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"42943b70771dc0ca6440e2ad52b6b9d81ea569ca","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        self.event_name \u003d \u0027LogicalRouterPortEvent\u0027"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def run(self, event, row, old):"},{"line_number":99,"context_line":"        if self.driver and not row.gateway_chassis:"},{"line_number":100,"context_line":"            # Ignore any gateway_chassis port"},{"line_number":101,"context_line":"            self.driver.add_event_handler(row, old)"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":66,"id":"bfb3d3c7_8c962793","line":99,"range":{"start_line":99,"start_character":10,"end_line":99,"end_character":22},"updated":"2019-05-24 10:29:05.000000000","message":"nit: Wouldn\u0027t be easier to pass the driver via constructor instead ?","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e708aae158a9a461b9bbe37498e04d594790fbd9","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        self.event_name \u003d \u0027LogicalRouterPortEvent\u0027"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def run(self, event, row, old):"},{"line_number":99,"context_line":"        if self.driver and not row.gateway_chassis:"},{"line_number":100,"context_line":"            # Ignore any gateway_chassis port"},{"line_number":101,"context_line":"            self.driver.add_event_handler(row, old)"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":66,"id":"bfb3d3c7_e2ad679b","line":99,"range":{"start_line":99,"start_character":10,"end_line":99,"end_character":22},"in_reply_to":"bfb3d3c7_8c962793","updated":"2019-05-31 19:16:22.000000000","message":"agreed","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"ee92b365f70068d7289c46f4a3e2045a2b9fc930","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        if events:"},{"line_number":144,"context_line":"            self.notify_handler.watch_events(events)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    @tenacity.retry("},{"line_number":147,"context_line":"        wait\u003dtenacity.wait_exponential(max\u003d180),"},{"line_number":148,"context_line":"        reraise\u003dTrue)"},{"line_number":149,"context_line":"    def _get_ovsdb_helper(self, connection_string):"},{"line_number":150,"context_line":"        return idlutils.get_schema_helper(connection_string, self.SCHEMA)"},{"line_number":151,"context_line":""}],"source_content_type":"text/x-python","patch_set":66,"id":"dfbec78f_7849dab4","line":148,"range":{"start_line":146,"start_character":5,"end_line":148,"end_character":21},"updated":"2019-05-16 09:59:08.000000000","message":"Consider using oslo.service.loopingcall lib:\n\nhttps://github.com/openstack/oslo.service/blob/master/oslo_service/loopingcall.py","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"c2d2c0aa2dd66e54c9e914b1cd02c25fb71c63cb","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        if events:"},{"line_number":144,"context_line":"            self.notify_handler.watch_events(events)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    @tenacity.retry("},{"line_number":147,"context_line":"        wait\u003dtenacity.wait_exponential(max\u003d180),"},{"line_number":148,"context_line":"        reraise\u003dTrue)"},{"line_number":149,"context_line":"    def _get_ovsdb_helper(self, connection_string):"},{"line_number":150,"context_line":"        return idlutils.get_schema_helper(connection_string, self.SCHEMA)"},{"line_number":151,"context_line":""}],"source_content_type":"text/x-python","patch_set":66,"id":"dfbec78f_ee850008","line":148,"range":{"start_line":146,"start_character":5,"end_line":148,"end_character":21},"in_reply_to":"dfbec78f_7849dab4","updated":"2019-05-16 11:01:56.000000000","message":"Need to look into it. But thanks for pointing it out","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"ee92b365f70068d7289c46f4a3e2045a2b9fc930","unresolved":false,"context_lines":[{"line_number":232,"context_line":"    @staticmethod"},{"line_number":233,"context_line":"    def _map_val(row, col, key):"},{"line_number":234,"context_line":"        # If the row doesnt exist, RowNotFound is raised by the _map_val"},{"line_number":235,"context_line":"        # and is expected to ba caught by the caller."},{"line_number":236,"context_line":"        try:"},{"line_number":237,"context_line":"            return getattr(row, col)[key]"},{"line_number":238,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":66,"id":"dfbec78f_b8d8b2ee","line":235,"range":{"start_line":235,"start_character":29,"end_line":235,"end_character":31},"updated":"2019-05-16 09:59:08.000000000","message":"nit: be","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"c437cc6a25089c047cd8c6c39c12fae3a16231eb","unresolved":false,"context_lines":[{"line_number":232,"context_line":"    @staticmethod"},{"line_number":233,"context_line":"    def _map_val(row, col, key):"},{"line_number":234,"context_line":"        # If the row doesnt exist, RowNotFound is raised by the _map_val"},{"line_number":235,"context_line":"        # and is expected to ba caught by the caller."},{"line_number":236,"context_line":"        try:"},{"line_number":237,"context_line":"            return getattr(row, col)[key]"},{"line_number":238,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":66,"id":"bfb3d3c7_16d36b3a","line":235,"range":{"start_line":235,"start_character":29,"end_line":235,"end_character":31},"in_reply_to":"dfbec78f_ae7b8825","updated":"2019-05-21 09:26:54.000000000","message":"I will fix this once the following patch is reviewed by others","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"c2d2c0aa2dd66e54c9e914b1cd02c25fb71c63cb","unresolved":false,"context_lines":[{"line_number":232,"context_line":"    @staticmethod"},{"line_number":233,"context_line":"    def _map_val(row, col, key):"},{"line_number":234,"context_line":"        # If the row doesnt exist, RowNotFound is raised by the _map_val"},{"line_number":235,"context_line":"        # and is expected to ba caught by the caller."},{"line_number":236,"context_line":"        try:"},{"line_number":237,"context_line":"            return getattr(row, col)[key]"},{"line_number":238,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":66,"id":"dfbec78f_ae7b8825","line":235,"range":{"start_line":235,"start_character":29,"end_line":235,"end_character":31},"in_reply_to":"dfbec78f_b8d8b2ee","updated":"2019-05-16 11:01:56.000000000","message":"damn , missed it :)\nThanks","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"42943b70771dc0ca6440e2ad52b6b9d81ea569ca","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        router \u003d self.ovn_nbdb_api.lookup("},{"line_number":255,"context_line":"            \u0027Logical_Router\u0027, ovn_utils.ovn_name(self._map_val("},{"line_number":256,"context_line":"                row, \u0027external_ids\u0027, ovn_const.NEUTRON_ROUTER_NAME)))"},{"line_number":257,"context_line":"        lsp \u003d self.ovn_nbdb_api.lookup("},{"line_number":258,"context_line":"            \u0027Logical_Switch_Port\u0027, row.name["},{"line_number":259,"context_line":"                len(ovn_const.LRP_NAME):], default\u003dNone)"},{"line_number":260,"context_line":"        network \u003d self.ovn_nbdb_api.lookup("},{"line_number":261,"context_line":"            \u0027Logical_Switch\u0027, self._map_val(lsp, \u0027external_ids\u0027,"},{"line_number":262,"context_line":"                                            ovn_const.NEUTRON_NET_NAME))"}],"source_content_type":"text/x-python","patch_set":66,"id":"bfb3d3c7_2cbdbb01","line":259,"range":{"start_line":257,"start_character":0,"end_line":259,"end_character":56},"updated":"2019-05-24 10:29:05.000000000","message":"Isn\u0027t the row itself the LSP already ?\n\nAt L282, you use the \"row\" to get the network:\n\nnetwork \u003d self.ovn_nbdb_api.lookup(\u0027Logical_Switch\u0027, self._map_val(row, \u0027external_ids\u0027, ovn_const.NEUTRON_NET_NAME)\n\nI guess it would also work here ? If so, I think we should do it because out of all resources, we do expect thousands of LSPs and if we can remove that query I bet it would save some time to process the events.","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"6f8e86ba9bd0094b9e21ef21a433d74a7c4d0316","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        router \u003d self.ovn_nbdb_api.lookup("},{"line_number":255,"context_line":"            \u0027Logical_Router\u0027, ovn_utils.ovn_name(self._map_val("},{"line_number":256,"context_line":"                row, \u0027external_ids\u0027, ovn_const.NEUTRON_ROUTER_NAME)))"},{"line_number":257,"context_line":"        lsp \u003d self.ovn_nbdb_api.lookup("},{"line_number":258,"context_line":"            \u0027Logical_Switch_Port\u0027, row.name["},{"line_number":259,"context_line":"                len(ovn_const.LRP_NAME):], default\u003dNone)"},{"line_number":260,"context_line":"        network \u003d self.ovn_nbdb_api.lookup("},{"line_number":261,"context_line":"            \u0027Logical_Switch\u0027, self._map_val(lsp, \u0027external_ids\u0027,"},{"line_number":262,"context_line":"                                            ovn_const.NEUTRON_NET_NAME))"}],"source_content_type":"text/x-python","patch_set":66,"id":"bfb3d3c7_f380d0c1","line":259,"range":{"start_line":257,"start_character":0,"end_line":259,"end_character":56},"in_reply_to":"bfb3d3c7_2cbdbb01","updated":"2019-05-25 12:31:53.000000000","message":"Here the row is coming from the Logical Router Port Event and is of the LRP format, even if the sequence is for Logical Router port.\nThe row in Line#282 is coming from the Logical Switch Port Event and is of the Logical Switch format, even if the row has the name for the Logical Router Port.\n\nI.e. the difference of row is from the table they are generated, therefore this line was used.","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"ee92b365f70068d7289c46f4a3e2045a2b9fc930","unresolved":false,"context_lines":[{"line_number":239,"context_line":"            raise idlutils.RowNotFound(table\u003drow.__table.name,"},{"line_number":240,"context_line":"                                       col\u003dcol, match\u003dkey)"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def _get_nw_router_info_on_interface_add(self, row):"},{"line_number":243,"context_line":"        \"\"\"Get the Router and Network information on a new interface add"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        This function is called when a new interface between a router and"},{"line_number":246,"context_line":"        a network is added."},{"line_number":247,"context_line":"        Input: Logical Router Port row which is coming from"},{"line_number":248,"context_line":"               LogicalRouterPortEvent."},{"line_number":249,"context_line":"        Output: A row from router table and network table matching the router"},{"line_number":250,"context_line":"                and network for which the event was generated."},{"line_number":251,"context_line":"        Exception: RowNotFound exception can be generated."},{"line_number":252,"context_line":"        \"\"\""},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"        router \u003d self.ovn_nbdb_api.lookup("},{"line_number":255,"context_line":"            \u0027Logical_Router\u0027, ovn_utils.ovn_name(self._map_val("},{"line_number":256,"context_line":"                row, \u0027external_ids\u0027, ovn_const.NEUTRON_ROUTER_NAME)))"},{"line_number":257,"context_line":"        lsp \u003d self.ovn_nbdb_api.lookup("},{"line_number":258,"context_line":"            \u0027Logical_Switch_Port\u0027, row.name["},{"line_number":259,"context_line":"                len(ovn_const.LRP_NAME):], default\u003dNone)"},{"line_number":260,"context_line":"        network \u003d self.ovn_nbdb_api.lookup("},{"line_number":261,"context_line":"            \u0027Logical_Switch\u0027, self._map_val(lsp, \u0027external_ids\u0027,"},{"line_number":262,"context_line":"                                            ovn_const.NEUTRON_NET_NAME))"},{"line_number":263,"context_line":"        return router, network"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def _get_nw_router_info_on_interface_delete(self, row):"},{"line_number":266,"context_line":"        \"\"\"Get the Router and Network information on a new interface delete"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        This function is called when an interface between a router and"},{"line_number":269,"context_line":"        a network is deleted."},{"line_number":270,"context_line":"        Input: Logical Router Port row which is coming from"},{"line_number":271,"context_line":"               LogicalSwitchPortEvent."},{"line_number":272,"context_line":"        Output: A row from router table and network table matching the router"},{"line_number":273,"context_line":"                and network for which the event was generated."},{"line_number":274,"context_line":"        Exception: RowNotFound exception can be generated."},{"line_number":275,"context_line":"        \"\"\""},{"line_number":276,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":277,"context_line":"            \u0027Logical_Router_Port\u0027,"},{"line_number":278,"context_line":"            self._map_val(row, \u0027options\u0027, \u0027router-port\u0027))"},{"line_number":279,"context_line":"        router_name \u003d ovn_utils.ovn_name(self._map_val("},{"line_number":280,"context_line":"            rport, \u0027external_ids\u0027, ovn_const.NEUTRON_ROUTER_NAME))"},{"line_number":281,"context_line":"        router \u003d self.ovn_nbdb_api.lookup(\u0027Logical_Router\u0027, router_name)"},{"line_number":282,"context_line":"        network \u003d self.ovn_nbdb_api.lookup("},{"line_number":283,"context_line":"            \u0027Logical_Switch\u0027, self._map_val("},{"line_number":284,"context_line":"                row, \u0027external_ids\u0027, ovn_const.NEUTRON_NET_NAME))"},{"line_number":285,"context_line":"        return router, network"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":288,"context_line":"        # TODO(reedip): When OVS\u003e\u003d2.12, LB can be deleted without removing"}],"source_content_type":"text/x-python","patch_set":66,"id":"dfbec78f_f8470a76","line":285,"range":{"start_line":242,"start_character":3,"end_line":285,"end_character":30},"updated":"2019-05-16 09:59:08.000000000","message":"Sorry for asking, perhaps I\u0027m missing something...\nCan we unique those two functions into one?\n\n_get_nw_router_info_on_interface_action(self, row, action\u003dadd)?\n\nThe body is pretty the same.","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"7cf370d051aa20206b083cc581b0efb8e85773fa","unresolved":false,"context_lines":[{"line_number":239,"context_line":"            raise idlutils.RowNotFound(table\u003drow.__table.name,"},{"line_number":240,"context_line":"                                       col\u003dcol, match\u003dkey)"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def _get_nw_router_info_on_interface_add(self, row):"},{"line_number":243,"context_line":"        \"\"\"Get the Router and Network information on a new interface add"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        This function is called when a new interface between a router and"},{"line_number":246,"context_line":"        a network is added."},{"line_number":247,"context_line":"        Input: Logical Router Port row which is coming from"},{"line_number":248,"context_line":"               LogicalRouterPortEvent."},{"line_number":249,"context_line":"        Output: A row from router table and network table matching the router"},{"line_number":250,"context_line":"                and network for which the event was generated."},{"line_number":251,"context_line":"        Exception: RowNotFound exception can be generated."},{"line_number":252,"context_line":"        \"\"\""},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"        router \u003d self.ovn_nbdb_api.lookup("},{"line_number":255,"context_line":"            \u0027Logical_Router\u0027, ovn_utils.ovn_name(self._map_val("},{"line_number":256,"context_line":"                row, \u0027external_ids\u0027, ovn_const.NEUTRON_ROUTER_NAME)))"},{"line_number":257,"context_line":"        lsp \u003d self.ovn_nbdb_api.lookup("},{"line_number":258,"context_line":"            \u0027Logical_Switch_Port\u0027, row.name["},{"line_number":259,"context_line":"                len(ovn_const.LRP_NAME):], default\u003dNone)"},{"line_number":260,"context_line":"        network \u003d self.ovn_nbdb_api.lookup("},{"line_number":261,"context_line":"            \u0027Logical_Switch\u0027, self._map_val(lsp, \u0027external_ids\u0027,"},{"line_number":262,"context_line":"                                            ovn_const.NEUTRON_NET_NAME))"},{"line_number":263,"context_line":"        return router, network"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def _get_nw_router_info_on_interface_delete(self, row):"},{"line_number":266,"context_line":"        \"\"\"Get the Router and Network information on a new interface delete"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        This function is called when an interface between a router and"},{"line_number":269,"context_line":"        a network is deleted."},{"line_number":270,"context_line":"        Input: Logical Router Port row which is coming from"},{"line_number":271,"context_line":"               LogicalSwitchPortEvent."},{"line_number":272,"context_line":"        Output: A row from router table and network table matching the router"},{"line_number":273,"context_line":"                and network for which the event was generated."},{"line_number":274,"context_line":"        Exception: RowNotFound exception can be generated."},{"line_number":275,"context_line":"        \"\"\""},{"line_number":276,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":277,"context_line":"            \u0027Logical_Router_Port\u0027,"},{"line_number":278,"context_line":"            self._map_val(row, \u0027options\u0027, \u0027router-port\u0027))"},{"line_number":279,"context_line":"        router_name \u003d ovn_utils.ovn_name(self._map_val("},{"line_number":280,"context_line":"            rport, \u0027external_ids\u0027, ovn_const.NEUTRON_ROUTER_NAME))"},{"line_number":281,"context_line":"        router \u003d self.ovn_nbdb_api.lookup(\u0027Logical_Router\u0027, router_name)"},{"line_number":282,"context_line":"        network \u003d self.ovn_nbdb_api.lookup("},{"line_number":283,"context_line":"            \u0027Logical_Switch\u0027, self._map_val("},{"line_number":284,"context_line":"                row, \u0027external_ids\u0027, ovn_const.NEUTRON_NET_NAME))"},{"line_number":285,"context_line":"        return router, network"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":288,"context_line":"        # TODO(reedip): When OVS\u003e\u003d2.12, LB can be deleted without removing"}],"source_content_type":"text/x-python","patch_set":66,"id":"dfbec78f_c76b3fee","line":285,"range":{"start_line":242,"start_character":3,"end_line":285,"end_character":30},"in_reply_to":"dfbec78f_0ebf34d1","updated":"2019-05-16 14:01:51.000000000","message":"Thank you for the background, lets keep this as it is then :)","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"c2d2c0aa2dd66e54c9e914b1cd02c25fb71c63cb","unresolved":false,"context_lines":[{"line_number":239,"context_line":"            raise idlutils.RowNotFound(table\u003drow.__table.name,"},{"line_number":240,"context_line":"                                       col\u003dcol, match\u003dkey)"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def _get_nw_router_info_on_interface_add(self, row):"},{"line_number":243,"context_line":"        \"\"\"Get the Router and Network information on a new interface add"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        This function is called when a new interface between a router and"},{"line_number":246,"context_line":"        a network is added."},{"line_number":247,"context_line":"        Input: Logical Router Port row which is coming from"},{"line_number":248,"context_line":"               LogicalRouterPortEvent."},{"line_number":249,"context_line":"        Output: A row from router table and network table matching the router"},{"line_number":250,"context_line":"                and network for which the event was generated."},{"line_number":251,"context_line":"        Exception: RowNotFound exception can be generated."},{"line_number":252,"context_line":"        \"\"\""},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"        router \u003d self.ovn_nbdb_api.lookup("},{"line_number":255,"context_line":"            \u0027Logical_Router\u0027, ovn_utils.ovn_name(self._map_val("},{"line_number":256,"context_line":"                row, \u0027external_ids\u0027, ovn_const.NEUTRON_ROUTER_NAME)))"},{"line_number":257,"context_line":"        lsp \u003d self.ovn_nbdb_api.lookup("},{"line_number":258,"context_line":"            \u0027Logical_Switch_Port\u0027, row.name["},{"line_number":259,"context_line":"                len(ovn_const.LRP_NAME):], default\u003dNone)"},{"line_number":260,"context_line":"        network \u003d self.ovn_nbdb_api.lookup("},{"line_number":261,"context_line":"            \u0027Logical_Switch\u0027, self._map_val(lsp, \u0027external_ids\u0027,"},{"line_number":262,"context_line":"                                            ovn_const.NEUTRON_NET_NAME))"},{"line_number":263,"context_line":"        return router, network"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def _get_nw_router_info_on_interface_delete(self, row):"},{"line_number":266,"context_line":"        \"\"\"Get the Router and Network information on a new interface delete"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        This function is called when an interface between a router and"},{"line_number":269,"context_line":"        a network is deleted."},{"line_number":270,"context_line":"        Input: Logical Router Port row which is coming from"},{"line_number":271,"context_line":"               LogicalSwitchPortEvent."},{"line_number":272,"context_line":"        Output: A row from router table and network table matching the router"},{"line_number":273,"context_line":"                and network for which the event was generated."},{"line_number":274,"context_line":"        Exception: RowNotFound exception can be generated."},{"line_number":275,"context_line":"        \"\"\""},{"line_number":276,"context_line":"        rport \u003d self.ovn_nbdb_api.lookup("},{"line_number":277,"context_line":"            \u0027Logical_Router_Port\u0027,"},{"line_number":278,"context_line":"            self._map_val(row, \u0027options\u0027, \u0027router-port\u0027))"},{"line_number":279,"context_line":"        router_name \u003d ovn_utils.ovn_name(self._map_val("},{"line_number":280,"context_line":"            rport, \u0027external_ids\u0027, ovn_const.NEUTRON_ROUTER_NAME))"},{"line_number":281,"context_line":"        router \u003d self.ovn_nbdb_api.lookup(\u0027Logical_Router\u0027, router_name)"},{"line_number":282,"context_line":"        network \u003d self.ovn_nbdb_api.lookup("},{"line_number":283,"context_line":"            \u0027Logical_Switch\u0027, self._map_val("},{"line_number":284,"context_line":"                row, \u0027external_ids\u0027, ovn_const.NEUTRON_NET_NAME))"},{"line_number":285,"context_line":"        return router, network"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def delete_event_handler(self, row, old):"},{"line_number":288,"context_line":"        # TODO(reedip): When OVS\u003e\u003d2.12, LB can be deleted without removing"}],"source_content_type":"text/x-python","patch_set":66,"id":"dfbec78f_0ebf34d1","line":285,"range":{"start_line":242,"start_character":3,"end_line":285,"end_character":30},"in_reply_to":"dfbec78f_f8470a76","updated":"2019-05-16 11:01:56.000000000","message":"This has definitely undergone several iterations.\nIt was in a single function and then broken down and stuff :)\nI think I can keep it separate. Its not a big deal and even in that case, we can work on it in another patch?","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"42943b70771dc0ca6440e2ad52b6b9d81ea569ca","unresolved":false,"context_lines":[{"line_number":470,"context_line":"            except ValueError:"},{"line_number":471,"context_line":"                LOG.warning(\"Loadbalancer %s not associated with router\","},{"line_number":472,"context_line":"                            ovn_lr.name)"},{"line_number":473,"context_line":"            if lr_ref !\u003d []:"},{"line_number":474,"context_line":"                commands.append("},{"line_number":475,"context_line":"                    self.ovn_nbdb_api.db_set("},{"line_number":476,"context_line":"                        \u0027Load_Balancer\u0027, ovn_lb.uuid,"}],"source_content_type":"text/x-python","patch_set":66,"id":"bfb3d3c7_ac0c4bec","line":473,"range":{"start_line":473,"start_character":12,"end_line":473,"end_character":28},"updated":"2019-05-24 10:29:05.000000000","message":"nit: if lr_ref:","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"6f8e86ba9bd0094b9e21ef21a433d74a7c4d0316","unresolved":false,"context_lines":[{"line_number":470,"context_line":"            except ValueError:"},{"line_number":471,"context_line":"                LOG.warning(\"Loadbalancer %s not associated with router\","},{"line_number":472,"context_line":"                            ovn_lr.name)"},{"line_number":473,"context_line":"            if lr_ref !\u003d []:"},{"line_number":474,"context_line":"                commands.append("},{"line_number":475,"context_line":"                    self.ovn_nbdb_api.db_set("},{"line_number":476,"context_line":"                        \u0027Load_Balancer\u0027, ovn_lb.uuid,"}],"source_content_type":"text/x-python","patch_set":66,"id":"bfb3d3c7_d36b4c1b","line":473,"range":{"start_line":473,"start_character":12,"end_line":473,"end_character":28},"in_reply_to":"bfb3d3c7_ac0c4bec","updated":"2019-05-25 12:31:53.000000000","message":"I wanted to be clear that lr_ref has to be an empty list, and not anything else. yes, this works, and lr_ref can never be None if the lines #468 and #469 work. And lr_ref cannot be set to False/None for other scenario.","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"42943b70771dc0ca6440e2ad52b6b9d81ea569ca","unresolved":false,"context_lines":[{"line_number":1726,"context_line":"                operator_fault_string\u003dmsg)"},{"line_number":1727,"context_line":""},{"line_number":1728,"context_line":"    def create_vip_port(self, lb_id, project_id, vip_dict):"},{"line_number":1729,"context_line":"        # This functionality can be removed once"},{"line_number":1730,"context_line":"        # https://review.opendev.org/#/c/648853 is merged"},{"line_number":1731,"context_line":"        try:"},{"line_number":1732,"context_line":"            port \u003d self._ovn_helper.create_vip_port("},{"line_number":1733,"context_line":"                project_id, lb_id, vip_dict)[\u0027port\u0027]"}],"source_content_type":"text/x-python","patch_set":66,"id":"bfb3d3c7_0cda374b","line":1730,"range":{"start_line":1729,"start_character":0,"end_line":1730,"end_character":57},"updated":"2019-05-24 10:29:05.000000000","message":"Unrelated to the patch itself","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"6f8e86ba9bd0094b9e21ef21a433d74a7c4d0316","unresolved":false,"context_lines":[{"line_number":1726,"context_line":"                operator_fault_string\u003dmsg)"},{"line_number":1727,"context_line":""},{"line_number":1728,"context_line":"    def create_vip_port(self, lb_id, project_id, vip_dict):"},{"line_number":1729,"context_line":"        # This functionality can be removed once"},{"line_number":1730,"context_line":"        # https://review.opendev.org/#/c/648853 is merged"},{"line_number":1731,"context_line":"        try:"},{"line_number":1732,"context_line":"            port \u003d self._ovn_helper.create_vip_port("},{"line_number":1733,"context_line":"                project_id, lb_id, vip_dict)[\u0027port\u0027]"}],"source_content_type":"text/x-python","patch_set":66,"id":"bfb3d3c7_5332fc60","line":1730,"range":{"start_line":1729,"start_character":0,"end_line":1730,"end_character":57},"in_reply_to":"bfb3d3c7_0cda374b","updated":"2019-05-25 12:31:53.000000000","message":"Removing but wanted to keep it as an information","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        # Reset the Backend OVSDB connection since"},{"line_number":150,"context_line":"        # idl_ovn.OvnNbApiIdlImpl.ovsdb_connection is a class variable."},{"line_number":151,"context_line":"        # See ovsdbapp.backend.ovs_idl.Backend class for more details."},{"line_number":152,"context_line":"        idl_ovn.OvnNbApiIdlImpl.ovsdb_connection \u003d None"},{"line_number":153,"context_line":"        return idl_ovn.OvnNbApiIdlImpl(self.conn)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def stop(self):"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_d13c8fc9","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":55},"updated":"2019-05-28 11:07:03.000000000","message":"Why do we need to reset the connection here? Isn\u0027t the idea behind having it a class attribute to create the connection just once in case of reusing the same backend?","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"469dd550dd62de951090badb4612151b2e2178de","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        # Reset the Backend OVSDB connection since"},{"line_number":150,"context_line":"        # idl_ovn.OvnNbApiIdlImpl.ovsdb_connection is a class variable."},{"line_number":151,"context_line":"        # See ovsdbapp.backend.ovs_idl.Backend class for more details."},{"line_number":152,"context_line":"        idl_ovn.OvnNbApiIdlImpl.ovsdb_connection \u003d None"},{"line_number":153,"context_line":"        return idl_ovn.OvnNbApiIdlImpl(self.conn)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def stop(self):"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_20a8338a","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":55},"in_reply_to":"bfb3d3c7_05f741d5","updated":"2019-05-28 14:36:18.000000000","message":"If the problem is in functional tests it should be deal with there, not in the production code. You can do a cleanup method that resets the connection in the test.","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ae05d02e098ee09a068acf13d7a3ce9c741ffc82","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        # Reset the Backend OVSDB connection since"},{"line_number":150,"context_line":"        # idl_ovn.OvnNbApiIdlImpl.ovsdb_connection is a class variable."},{"line_number":151,"context_line":"        # See ovsdbapp.backend.ovs_idl.Backend class for more details."},{"line_number":152,"context_line":"        idl_ovn.OvnNbApiIdlImpl.ovsdb_connection \u003d None"},{"line_number":153,"context_line":"        return idl_ovn.OvnNbApiIdlImpl(self.conn)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def stop(self):"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_463d2e8d","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":55},"in_reply_to":"bfb3d3c7_20a8338a","updated":"2019-05-29 11:36:27.000000000","message":"Will test and get back","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        # Reset the Backend OVSDB connection since"},{"line_number":150,"context_line":"        # idl_ovn.OvnNbApiIdlImpl.ovsdb_connection is a class variable."},{"line_number":151,"context_line":"        # See ovsdbapp.backend.ovs_idl.Backend class for more details."},{"line_number":152,"context_line":"        idl_ovn.OvnNbApiIdlImpl.ovsdb_connection \u003d None"},{"line_number":153,"context_line":"        return idl_ovn.OvnNbApiIdlImpl(self.conn)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def stop(self):"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_05f741d5","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":55},"in_reply_to":"bfb3d3c7_d13c8fc9","updated":"2019-05-28 14:27:12.000000000","message":"As you know during functional tests, there can be multiple tests running on the same thread. While the first test runs successfully, the Connection object for OVSDB is never reset for the new test ( If we do not have this line ).\nThe result is failure observed in all tests which are executed in a functional test\u0027s thread, after the first test executes.","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        }"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def _check_and_set_ssl_files(self):"},{"line_number":198,"context_line":"        # This is a copy of ovsdb_monitor._check_and_set_ssl_files"},{"line_number":199,"context_line":"        if OvnProviderHelper.ovn_nbdb_api:"},{"line_number":200,"context_line":"            return"},{"line_number":201,"context_line":"        priv_key_file \u003d ovn_cfg.get_ovn_nb_private_key()"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_31b40bd1","line":198,"range":{"start_line":198,"start_character":8,"end_line":198,"end_character":66},"updated":"2019-05-28 11:07:03.000000000","message":"why do we copy it instead of making the function public and calling it?","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"469dd550dd62de951090badb4612151b2e2178de","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        }"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def _check_and_set_ssl_files(self):"},{"line_number":198,"context_line":"        # This is a copy of ovsdb_monitor._check_and_set_ssl_files"},{"line_number":199,"context_line":"        if OvnProviderHelper.ovn_nbdb_api:"},{"line_number":200,"context_line":"            return"},{"line_number":201,"context_line":"        priv_key_file \u003d ovn_cfg.get_ovn_nb_private_key()"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_e0953b41","line":198,"range":{"start_line":198,"start_character":8,"end_line":198,"end_character":66},"in_reply_to":"bfb3d3c7_25da854a","updated":"2019-05-28 14:36:18.000000000","message":"Fair enough, you can put a TODO here","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        }"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def _check_and_set_ssl_files(self):"},{"line_number":198,"context_line":"        # This is a copy of ovsdb_monitor._check_and_set_ssl_files"},{"line_number":199,"context_line":"        if OvnProviderHelper.ovn_nbdb_api:"},{"line_number":200,"context_line":"            return"},{"line_number":201,"context_line":"        priv_key_file \u003d ovn_cfg.get_ovn_nb_private_key()"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_25da854a","line":198,"range":{"start_line":198,"start_character":8,"end_line":198,"end_character":66},"in_reply_to":"bfb3d3c7_31b40bd1","updated":"2019-05-28 14:27:12.000000000","message":"Possible, maybe put it in another patch? \nBecause this change may not be part of this patch and would be a separate change","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ae05d02e098ee09a068acf13d7a3ce9c741ffc82","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        }"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def _check_and_set_ssl_files(self):"},{"line_number":198,"context_line":"        # This is a copy of ovsdb_monitor._check_and_set_ssl_files"},{"line_number":199,"context_line":"        if OvnProviderHelper.ovn_nbdb_api:"},{"line_number":200,"context_line":"            return"},{"line_number":201,"context_line":"        priv_key_file \u003d ovn_cfg.get_ovn_nb_private_key()"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_86b9e615","line":198,"range":{"start_line":198,"start_character":8,"end_line":198,"end_character":66},"in_reply_to":"bfb3d3c7_e0953b41","updated":"2019-05-29 11:36:27.000000000","message":"Done","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":211,"context_line":"            Stream.ssl_set_ca_cert_file(ca_cert_file)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def start(self):"},{"line_number":214,"context_line":"        self.ovnnbidl \u003d OvnNbIdlForLb("},{"line_number":215,"context_line":"            [LogicalRouterPortEvent(self), LogicalSwitchPortEvent(self)])"},{"line_number":216,"context_line":"        OvnProviderHelper.ovn_nbdb_api \u003d self.ovnnbidl.start()"},{"line_number":217,"context_line":"        self.helper_thread.start()"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_f4f661d7","line":214,"range":{"start_line":214,"start_character":13,"end_line":214,"end_character":21},"updated":"2019-05-28 11:07:03.000000000","message":"perhaps a better nam like ovn_nb_idl_for_lb would be more descriptive. It\u0027s not clear from the naming what is difference between ovnnbidl and ovn_nbdb_api","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":211,"context_line":"            Stream.ssl_set_ca_cert_file(ca_cert_file)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def start(self):"},{"line_number":214,"context_line":"        self.ovnnbidl \u003d OvnNbIdlForLb("},{"line_number":215,"context_line":"            [LogicalRouterPortEvent(self), LogicalSwitchPortEvent(self)])"},{"line_number":216,"context_line":"        OvnProviderHelper.ovn_nbdb_api \u003d self.ovnnbidl.start()"},{"line_number":217,"context_line":"        self.helper_thread.start()"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_c5ea89d6","line":214,"range":{"start_line":214,"start_character":13,"end_line":214,"end_character":21},"in_reply_to":"bfb3d3c7_f4f661d7","updated":"2019-05-28 14:27:12.000000000","message":"Possible","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":288,"context_line":"            LOG.debug(\"Router or network information not found\")"},{"line_number":289,"context_line":"            return"},{"line_number":290,"context_line":"        # Find all loadbalancers which have a reference with the network"},{"line_number":291,"context_line":"        nw_lb \u003d set(self._find_lb_in_ls(network\u003dnetwork))"},{"line_number":292,"context_line":"        # Find all loadbalancers which have a reference with the router"},{"line_number":293,"context_line":"        r_lb \u003d set(router.load_balancer) - nw_lb"},{"line_number":294,"context_line":"        # Delete all LB on N/W from Router"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_113ea78a","line":291,"range":{"start_line":291,"start_character":16,"end_line":291,"end_character":20},"updated":"2019-05-28 11:07:03.000000000","message":"You don\u0027 t need this, _find_lb_in_ls already returns a set","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":288,"context_line":"            LOG.debug(\"Router or network information not found\")"},{"line_number":289,"context_line":"            return"},{"line_number":290,"context_line":"        # Find all loadbalancers which have a reference with the network"},{"line_number":291,"context_line":"        nw_lb \u003d set(self._find_lb_in_ls(network\u003dnetwork))"},{"line_number":292,"context_line":"        # Find all loadbalancers which have a reference with the router"},{"line_number":293,"context_line":"        r_lb \u003d set(router.load_balancer) - nw_lb"},{"line_number":294,"context_line":"        # Delete all LB on N/W from Router"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_a59bd570","line":291,"range":{"start_line":291,"start_character":16,"end_line":291,"end_character":20},"in_reply_to":"bfb3d3c7_113ea78a","updated":"2019-05-28 14:27:12.000000000","message":"Done","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":301,"context_line":"                network.uuid, rlb.uuid))"},{"line_number":302,"context_line":"        self._execute_commands(commands)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    def add_event_handler(self, row, old):"},{"line_number":305,"context_line":"        commands \u003d []"},{"line_number":306,"context_line":"        try:"},{"line_number":307,"context_line":"            router, network \u003d self._get_nw_router_info_on_interface_add(row)"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_11a227fd","line":304,"range":{"start_line":304,"start_character":35,"end_line":304,"end_character":40},"updated":"2019-05-28 11:07:03.000000000","message":"this is unused","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":301,"context_line":"                network.uuid, rlb.uuid))"},{"line_number":302,"context_line":"        self._execute_commands(commands)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    def add_event_handler(self, row, old):"},{"line_number":305,"context_line":"        commands \u003d []"},{"line_number":306,"context_line":"        try:"},{"line_number":307,"context_line":"            router, network \u003d self._get_nw_router_info_on_interface_add(row)"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_8590114c","line":304,"range":{"start_line":304,"start_character":35,"end_line":304,"end_character":40},"in_reply_to":"bfb3d3c7_11a227fd","updated":"2019-05-28 14:27:12.000000000","message":"Done","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":311,"context_line":"        router_lb \u003d set(router.load_balancer)"},{"line_number":312,"context_line":"        network_lb \u003d set(network.load_balancer)"},{"line_number":313,"context_line":"        # Add only those lb to routers which are unique to the network"},{"line_number":314,"context_line":"        for lb in (network_lb - router_lb):"},{"line_number":315,"context_line":"            commands.extend(self._update_lb_to_lr_association(lb, router))"},{"line_number":316,"context_line":"        # Add those lb to the network which are unique to the router"},{"line_number":317,"context_line":"        for lb in (router_lb - network_lb):"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_f1ce7358","line":314,"range":{"start_line":314,"start_character":18,"end_line":314,"end_character":19},"updated":"2019-05-28 11:07:03.000000000","message":"nit: parens not needed","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":311,"context_line":"        router_lb \u003d set(router.load_balancer)"},{"line_number":312,"context_line":"        network_lb \u003d set(network.load_balancer)"},{"line_number":313,"context_line":"        # Add only those lb to routers which are unique to the network"},{"line_number":314,"context_line":"        for lb in (network_lb - router_lb):"},{"line_number":315,"context_line":"            commands.extend(self._update_lb_to_lr_association(lb, router))"},{"line_number":316,"context_line":"        # Add those lb to the network which are unique to the router"},{"line_number":317,"context_line":"        for lb in (router_lb - network_lb):"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_057c211d","line":314,"range":{"start_line":314,"start_character":18,"end_line":314,"end_character":19},"in_reply_to":"bfb3d3c7_f1ce7358","updated":"2019-05-28 14:27:12.000000000","message":"Added for readability","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":314,"context_line":"        for lb in (network_lb - router_lb):"},{"line_number":315,"context_line":"            commands.extend(self._update_lb_to_lr_association(lb, router))"},{"line_number":316,"context_line":"        # Add those lb to the network which are unique to the router"},{"line_number":317,"context_line":"        for lb in (router_lb - network_lb):"},{"line_number":318,"context_line":"            commands.append(self.ovn_nbdb_api.ls_lb_add("},{"line_number":319,"context_line":"                            network.uuid, lb.uuid, may_exist\u003dTrue))"},{"line_number":320,"context_line":"        self._execute_commands(commands)"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_b1d47bea","line":317,"range":{"start_line":317,"start_character":18,"end_line":317,"end_character":19},"updated":"2019-05-28 11:07:03.000000000","message":"ditto","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":314,"context_line":"        for lb in (network_lb - router_lb):"},{"line_number":315,"context_line":"            commands.extend(self._update_lb_to_lr_association(lb, router))"},{"line_number":316,"context_line":"        # Add those lb to the network which are unique to the router"},{"line_number":317,"context_line":"        for lb in (router_lb - network_lb):"},{"line_number":318,"context_line":"            commands.append(self.ovn_nbdb_api.ls_lb_add("},{"line_number":319,"context_line":"                            network.uuid, lb.uuid, may_exist\u003dTrue))"},{"line_number":320,"context_line":"        self._execute_commands(commands)"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_a5743537","line":317,"range":{"start_line":317,"start_character":18,"end_line":317,"end_character":19},"in_reply_to":"bfb3d3c7_b1d47bea","updated":"2019-05-28 14:27:12.000000000","message":"ditto","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":330,"context_line":"        function tries to retrieve all those loadbalancers created on this"},{"line_number":331,"context_line":"        network."},{"line_number":332,"context_line":"        Input : row of type Logical_Switch"},{"line_number":333,"context_line":"        Output: rows of type Load_Balancer or {}"},{"line_number":334,"context_line":"        \"\"\""},{"line_number":335,"context_line":"        return {lb for lb in network.load_balancer"},{"line_number":336,"context_line":"                if network.name in lb.external_ids.get(LB_EXT_IDS_LS_REFS_KEY,"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_71d8437a","line":333,"range":{"start_line":333,"start_character":46,"end_line":333,"end_character":48},"updated":"2019-05-28 11:07:03.000000000","message":"it returns empty set, not empty dict ;)","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":330,"context_line":"        function tries to retrieve all those loadbalancers created on this"},{"line_number":331,"context_line":"        network."},{"line_number":332,"context_line":"        Input : row of type Logical_Switch"},{"line_number":333,"context_line":"        Output: rows of type Load_Balancer or {}"},{"line_number":334,"context_line":"        \"\"\""},{"line_number":335,"context_line":"        return {lb for lb in network.load_balancer"},{"line_number":336,"context_line":"                if network.name in lb.external_ids.get(LB_EXT_IDS_LS_REFS_KEY,"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_31ce4bb4","line":333,"range":{"start_line":333,"start_character":16,"end_line":333,"end_character":20},"updated":"2019-05-28 11:07:03.000000000","message":"set of rows","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"469dd550dd62de951090badb4612151b2e2178de","unresolved":false,"context_lines":[{"line_number":330,"context_line":"        function tries to retrieve all those loadbalancers created on this"},{"line_number":331,"context_line":"        network."},{"line_number":332,"context_line":"        Input : row of type Logical_Switch"},{"line_number":333,"context_line":"        Output: rows of type Load_Balancer or {}"},{"line_number":334,"context_line":"        \"\"\""},{"line_number":335,"context_line":"        return {lb for lb in network.load_balancer"},{"line_number":336,"context_line":"                if network.name in lb.external_ids.get(LB_EXT_IDS_LS_REFS_KEY,"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_007c0f1d","line":333,"range":{"start_line":333,"start_character":46,"end_line":333,"end_character":48},"in_reply_to":"bfb3d3c7_25960540","updated":"2019-05-28 14:36:18.000000000","message":"Thanks, it may be confusing if you read the doc only and not the code.","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":330,"context_line":"        function tries to retrieve all those loadbalancers created on this"},{"line_number":331,"context_line":"        network."},{"line_number":332,"context_line":"        Input : row of type Logical_Switch"},{"line_number":333,"context_line":"        Output: rows of type Load_Balancer or {}"},{"line_number":334,"context_line":"        \"\"\""},{"line_number":335,"context_line":"        return {lb for lb in network.load_balancer"},{"line_number":336,"context_line":"                if network.name in lb.external_ids.get(LB_EXT_IDS_LS_REFS_KEY,"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_25960540","line":333,"range":{"start_line":333,"start_character":46,"end_line":333,"end_character":48},"in_reply_to":"bfb3d3c7_71d8437a","updated":"2019-05-28 14:27:12.000000000","message":"Isnt a set represented as {1,2,3} :)\nHonestly I did it quickly and forgot the impact of {} on a reviewer which you so cleverly caught.\nI have changed it to a word to be more precise. Yes, {} is a dict, and representing an empty string is better to be like set()","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":460,"context_line":"                lr_ref \u003d lr_ref.split(\u0027,\u0027)"},{"line_number":461,"context_line":"                lr_ref.remove(ovn_lr.name)"},{"line_number":462,"context_line":"            except ValueError:"},{"line_number":463,"context_line":"                LOG.warning(\"Loadbalancer %s not associated with router\","},{"line_number":464,"context_line":"                            ovn_lr.name)"},{"line_number":465,"context_line":"            if lr_ref:"},{"line_number":466,"context_line":"                commands.append("}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_f1e4330f","line":463,"range":{"start_line":463,"start_character":68,"end_line":463,"end_character":71},"updated":"2019-05-28 11:07:03.000000000","message":"Maybe the router name would be handy to log too","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":460,"context_line":"                lr_ref \u003d lr_ref.split(\u0027,\u0027)"},{"line_number":461,"context_line":"                lr_ref.remove(ovn_lr.name)"},{"line_number":462,"context_line":"            except ValueError:"},{"line_number":463,"context_line":"                LOG.warning(\"Loadbalancer %s not associated with router\","},{"line_number":464,"context_line":"                            ovn_lr.name)"},{"line_number":465,"context_line":"            if lr_ref:"},{"line_number":466,"context_line":"                commands.append("}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_65de3d12","line":463,"range":{"start_line":463,"start_character":68,"end_line":463,"end_character":71},"in_reply_to":"bfb3d3c7_f1e4330f","updated":"2019-05-28 14:27:12.000000000","message":"Done","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":461,"context_line":"                lr_ref.remove(ovn_lr.name)"},{"line_number":462,"context_line":"            except ValueError:"},{"line_number":463,"context_line":"                LOG.warning(\"Loadbalancer %s not associated with router\","},{"line_number":464,"context_line":"                            ovn_lr.name)"},{"line_number":465,"context_line":"            if lr_ref:"},{"line_number":466,"context_line":"                commands.append("},{"line_number":467,"context_line":"                    self.ovn_nbdb_api.db_set("}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_31df2b3b","line":464,"range":{"start_line":464,"start_character":28,"end_line":464,"end_character":34},"updated":"2019-05-28 11:07:03.000000000","message":"ovn_lb ?","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":461,"context_line":"                lr_ref.remove(ovn_lr.name)"},{"line_number":462,"context_line":"            except ValueError:"},{"line_number":463,"context_line":"                LOG.warning(\"Loadbalancer %s not associated with router\","},{"line_number":464,"context_line":"                            ovn_lr.name)"},{"line_number":465,"context_line":"            if lr_ref:"},{"line_number":466,"context_line":"                commands.append("},{"line_number":467,"context_line":"                    self.ovn_nbdb_api.db_set("}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_c5bfe9a7","line":464,"range":{"start_line":464,"start_character":28,"end_line":464,"end_character":34},"in_reply_to":"bfb3d3c7_31df2b3b","updated":"2019-05-28 14:27:12.000000000","message":"Done","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":486,"context_line":"    def _add_lb_to_lr_association(self, ovn_lb, ovn_lr, lr_rf):"},{"line_number":487,"context_line":"        commands \u003d []"},{"line_number":488,"context_line":"        lr_rf \u003d {LB_EXT_IDS_LR_REF_KEY: ovn_lr.name} if not lr_rf else {"},{"line_number":489,"context_line":"            LB_EXT_IDS_LR_REF_KEY: lr_rf + \",\" + ovn_lr.name}"},{"line_number":490,"context_line":"        # Multiple routers in lr_rf are separated with \u0027,\u0027"},{"line_number":491,"context_line":"        commands.append("},{"line_number":492,"context_line":"            self.ovn_nbdb_api.lr_lb_add(ovn_lr.uuid, ovn_lb.uuid,"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_31116b05","line":489,"range":{"start_line":489,"start_character":35,"end_line":489,"end_character":60},"updated":"2019-05-28 11:07:03.000000000","message":"nit: It\u0027s better to use string formatting over concatenation","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":486,"context_line":"    def _add_lb_to_lr_association(self, ovn_lb, ovn_lr, lr_rf):"},{"line_number":487,"context_line":"        commands \u003d []"},{"line_number":488,"context_line":"        lr_rf \u003d {LB_EXT_IDS_LR_REF_KEY: ovn_lr.name} if not lr_rf else {"},{"line_number":489,"context_line":"            LB_EXT_IDS_LR_REF_KEY: lr_rf + \",\" + ovn_lr.name}"},{"line_number":490,"context_line":"        # Multiple routers in lr_rf are separated with \u0027,\u0027"},{"line_number":491,"context_line":"        commands.append("},{"line_number":492,"context_line":"            self.ovn_nbdb_api.lr_lb_add(ovn_lr.uuid, ovn_lb.uuid,"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_a0b50334","line":489,"range":{"start_line":489,"start_character":35,"end_line":489,"end_character":60},"in_reply_to":"bfb3d3c7_31116b05","updated":"2019-05-28 14:27:12.000000000","message":"Done","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":504,"context_line":""},{"line_number":505,"context_line":"    def _update_lb_to_lr_association(self, ovn_lb, ovn_lr, delete\u003dFalse):"},{"line_number":506,"context_line":"        lr_ref \u003d ovn_lb.external_ids.get(LB_EXT_IDS_LR_REF_KEY)"},{"line_number":507,"context_line":"        if not delete:"},{"line_number":508,"context_line":"            return self._add_lb_to_lr_association(ovn_lb, ovn_lr, lr_ref)"},{"line_number":509,"context_line":"        else:"},{"line_number":510,"context_line":"            return self._del_lb_to_lr_association(ovn_lb, ovn_lr, lr_ref)"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_d1748f6a","line":507,"range":{"start_line":507,"start_character":11,"end_line":507,"end_character":21},"updated":"2019-05-28 11:07:03.000000000","message":"nit: I find it better to not negate the bool when you have both if and else","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"469dd550dd62de951090badb4612151b2e2178de","unresolved":false,"context_lines":[{"line_number":504,"context_line":""},{"line_number":505,"context_line":"    def _update_lb_to_lr_association(self, ovn_lb, ovn_lr, delete\u003dFalse):"},{"line_number":506,"context_line":"        lr_ref \u003d ovn_lb.external_ids.get(LB_EXT_IDS_LR_REF_KEY)"},{"line_number":507,"context_line":"        if not delete:"},{"line_number":508,"context_line":"            return self._add_lb_to_lr_association(ovn_lb, ovn_lr, lr_ref)"},{"line_number":509,"context_line":"        else:"},{"line_number":510,"context_line":"            return self._del_lb_to_lr_association(ovn_lb, ovn_lr, lr_ref)"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_e0a3fb9c","line":507,"range":{"start_line":507,"start_character":11,"end_line":507,"end_character":21},"in_reply_to":"bfb3d3c7_a5d755ee","updated":"2019-05-28 14:36:18.000000000","message":"I meant you can just do\n\n if delete:\n     self._delete ....","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":504,"context_line":""},{"line_number":505,"context_line":"    def _update_lb_to_lr_association(self, ovn_lb, ovn_lr, delete\u003dFalse):"},{"line_number":506,"context_line":"        lr_ref \u003d ovn_lb.external_ids.get(LB_EXT_IDS_LR_REF_KEY)"},{"line_number":507,"context_line":"        if not delete:"},{"line_number":508,"context_line":"            return self._add_lb_to_lr_association(ovn_lb, ovn_lr, lr_ref)"},{"line_number":509,"context_line":"        else:"},{"line_number":510,"context_line":"            return self._del_lb_to_lr_association(ovn_lb, ovn_lr, lr_ref)"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_a5d755ee","line":507,"range":{"start_line":507,"start_character":11,"end_line":507,"end_character":21},"in_reply_to":"bfb3d3c7_d1748f6a","updated":"2019-05-28 14:27:12.000000000","message":"I find the word delete to be a bit more powerful, thats why kept it like this","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ae05d02e098ee09a068acf13d7a3ce9c741ffc82","unresolved":false,"context_lines":[{"line_number":504,"context_line":""},{"line_number":505,"context_line":"    def _update_lb_to_lr_association(self, ovn_lb, ovn_lr, delete\u003dFalse):"},{"line_number":506,"context_line":"        lr_ref \u003d ovn_lb.external_ids.get(LB_EXT_IDS_LR_REF_KEY)"},{"line_number":507,"context_line":"        if not delete:"},{"line_number":508,"context_line":"            return self._add_lb_to_lr_association(ovn_lb, ovn_lr, lr_ref)"},{"line_number":509,"context_line":"        else:"},{"line_number":510,"context_line":"            return self._del_lb_to_lr_association(ovn_lb, ovn_lr, lr_ref)"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_a1065bcd","line":507,"range":{"start_line":507,"start_character":11,"end_line":507,"end_character":21},"in_reply_to":"bfb3d3c7_e0a3fb9c","updated":"2019-05-29 11:36:27.000000000","message":"done","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":513,"context_line":"        net_ids \u003d []"},{"line_number":514,"context_line":"        network_driver \u003d get_network_driver()"},{"line_number":515,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lr_name)"},{"line_number":516,"context_line":"        try:"},{"line_number":517,"context_line":"            router \u003d self.ovn_nbdb_api.db_find("},{"line_number":518,"context_line":"                \u0027Logical_Router\u0027, find_cond,"},{"line_number":519,"context_line":"                columns\u003d[\u0027ports\u0027]).execute("}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_f4e4210f","line":516,"range":{"start_line":516,"start_character":8,"end_line":516,"end_character":12},"updated":"2019-05-28 11:07:03.000000000","message":"this shall start at L520, no?","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ae05d02e098ee09a068acf13d7a3ce9c741ffc82","unresolved":false,"context_lines":[{"line_number":513,"context_line":"        net_ids \u003d []"},{"line_number":514,"context_line":"        network_driver \u003d get_network_driver()"},{"line_number":515,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lr_name)"},{"line_number":516,"context_line":"        try:"},{"line_number":517,"context_line":"            router \u003d self.ovn_nbdb_api.db_find("},{"line_number":518,"context_line":"                \u0027Logical_Router\u0027, find_cond,"},{"line_number":519,"context_line":"                columns\u003d[\u0027ports\u0027]).execute("}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_01688784","line":516,"range":{"start_line":516,"start_character":8,"end_line":516,"end_character":12},"in_reply_to":"bfb3d3c7_800c7fa5","updated":"2019-05-29 11:36:27.000000000","message":"db_find may raise any other exception which I am catching in the generic exception handler","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"469dd550dd62de951090badb4612151b2e2178de","unresolved":false,"context_lines":[{"line_number":513,"context_line":"        net_ids \u003d []"},{"line_number":514,"context_line":"        network_driver \u003d get_network_driver()"},{"line_number":515,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lr_name)"},{"line_number":516,"context_line":"        try:"},{"line_number":517,"context_line":"            router \u003d self.ovn_nbdb_api.db_find("},{"line_number":518,"context_line":"                \u0027Logical_Router\u0027, find_cond,"},{"line_number":519,"context_line":"                columns\u003d[\u0027ports\u0027]).execute("}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_800c7fa5","line":516,"range":{"start_line":516,"start_character":8,"end_line":516,"end_character":12},"in_reply_to":"bfb3d3c7_85c491f6","updated":"2019-05-28 14:36:18.000000000","message":"Does db_find raise IndexError when router is not found? I thought L529 is because of L521","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":513,"context_line":"        net_ids \u003d []"},{"line_number":514,"context_line":"        network_driver \u003d get_network_driver()"},{"line_number":515,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lr_name)"},{"line_number":516,"context_line":"        try:"},{"line_number":517,"context_line":"            router \u003d self.ovn_nbdb_api.db_find("},{"line_number":518,"context_line":"                \u0027Logical_Router\u0027, find_cond,"},{"line_number":519,"context_line":"                columns\u003d[\u0027ports\u0027]).execute("}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_85c491f6","line":516,"range":{"start_line":516,"start_character":8,"end_line":516,"end_character":12},"in_reply_to":"bfb3d3c7_f4e4210f","updated":"2019-05-28 14:27:12.000000000","message":"Wanted to cover db_find as well in the exceptions","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":523,"context_line":"                    \u0027Logical_Router_Port\u0027, port, \u0027external_ids\u0027).execute("},{"line_number":524,"context_line":"                        check_error\u003dTrue)"},{"line_number":525,"context_line":"                for sid in ext_ids.get("},{"line_number":526,"context_line":"                    ovn_const.OVN_SUBNET_EXT_IDS_KEY, \u0027\u0027).split(\u0027 \u0027):"},{"line_number":527,"context_line":"                    net_ids.append(ovn_utils.ovn_name("},{"line_number":528,"context_line":"                        network_driver.get_subnet(sid).network_id))"},{"line_number":529,"context_line":"        except IndexError:"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_9418451e","line":526,"updated":"2019-05-28 11:07:03.000000000","message":"indentation","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":523,"context_line":"                    \u0027Logical_Router_Port\u0027, port, \u0027external_ids\u0027).execute("},{"line_number":524,"context_line":"                        check_error\u003dTrue)"},{"line_number":525,"context_line":"                for sid in ext_ids.get("},{"line_number":526,"context_line":"                    ovn_const.OVN_SUBNET_EXT_IDS_KEY, \u0027\u0027).split(\u0027 \u0027):"},{"line_number":527,"context_line":"                    net_ids.append(ovn_utils.ovn_name("},{"line_number":528,"context_line":"                        network_driver.get_subnet(sid).network_id))"},{"line_number":529,"context_line":"        except IndexError:"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_055e6143","line":526,"in_reply_to":"bfb3d3c7_9418451e","updated":"2019-05-28 14:27:12.000000000","message":"Done","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":528,"context_line":"                        network_driver.get_subnet(sid).network_id))"},{"line_number":529,"context_line":"        except IndexError:"},{"line_number":530,"context_line":"            LOG.warning(\u0027Router named %s not found\u0027, lr_name)"},{"line_number":531,"context_line":"        except Exception:"},{"line_number":532,"context_line":"            LOG.exception(\u0027Unknown exception occurred\u0027)"},{"line_number":533,"context_line":"        return net_ids"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"    def _find_lr_of_ls(self, ovn_ls):"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_34b879e3","line":532,"range":{"start_line":531,"start_character":0,"end_line":532,"end_character":55},"updated":"2019-05-28 11:07:03.000000000","message":"If we get an unknown exception and we ignore it, then the returned net_ids contains either nothing or partial data. It looks like it can lead to an inconsistent state because the command list from the caller will miss some data.","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":528,"context_line":"                        network_driver.get_subnet(sid).network_id))"},{"line_number":529,"context_line":"        except IndexError:"},{"line_number":530,"context_line":"            LOG.warning(\u0027Router named %s not found\u0027, lr_name)"},{"line_number":531,"context_line":"        except Exception:"},{"line_number":532,"context_line":"            LOG.exception(\u0027Unknown exception occurred\u0027)"},{"line_number":533,"context_line":"        return net_ids"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"    def _find_lr_of_ls(self, ovn_ls):"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_45ec598e","line":532,"range":{"start_line":531,"start_character":0,"end_line":532,"end_character":55},"in_reply_to":"bfb3d3c7_34b879e3","updated":"2019-05-28 14:27:12.000000000","message":"This means I should push the return net_ids upwards","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                    return lr"},{"line_number":550,"context_line":"            # Handles networks with only gateway port in the router"},{"line_number":551,"context_line":"            if ovn_utils.ovn_lrouter_port_name("},{"line_number":552,"context_line":"                lr.external_ids.get(\"neutron:gw_port_id\")) \u003d\u003d lrp_name:"},{"line_number":553,"context_line":"                return lr"},{"line_number":554,"context_line":""},{"line_number":555,"context_line":"    def _get_listener_key(self, listener_id, is_enabled\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_f4cd0185","line":552,"updated":"2019-05-28 11:07:03.000000000","message":"indentation","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                    return lr"},{"line_number":550,"context_line":"            # Handles networks with only gateway port in the router"},{"line_number":551,"context_line":"            if ovn_utils.ovn_lrouter_port_name("},{"line_number":552,"context_line":"                lr.external_ids.get(\"neutron:gw_port_id\")) \u003d\u003d lrp_name:"},{"line_number":553,"context_line":"                return lr"},{"line_number":554,"context_line":""},{"line_number":555,"context_line":"    def _get_listener_key(self, listener_id, is_enabled\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_253845ec","line":552,"in_reply_to":"bfb3d3c7_f4cd0185","updated":"2019-05-28 14:27:12.000000000","message":"Done","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":763,"context_line":"                    )"},{"line_number":764,"context_line":"            # Delete LB from all Networks the LB is indirectly associated"},{"line_number":765,"context_line":"            for ls in self._find_lb_in_table("},{"line_number":766,"context_line":"                ovn_lb, \u0027Logical_Switch\u0027):"},{"line_number":767,"context_line":"                commands.append("},{"line_number":768,"context_line":"                    self.ovn_nbdb_api.ls_lb_del(ls.uuid, ovn_lb.uuid,"},{"line_number":769,"context_line":"                                                if_exists\u003dTrue))"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_54a2cdaf","line":766,"updated":"2019-05-28 11:07:03.000000000","message":"indentation","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":763,"context_line":"                    )"},{"line_number":764,"context_line":"            # Delete LB from all Networks the LB is indirectly associated"},{"line_number":765,"context_line":"            for ls in self._find_lb_in_table("},{"line_number":766,"context_line":"                ovn_lb, \u0027Logical_Switch\u0027):"},{"line_number":767,"context_line":"                commands.append("},{"line_number":768,"context_line":"                    self.ovn_nbdb_api.ls_lb_del(ls.uuid, ovn_lb.uuid,"},{"line_number":769,"context_line":"                                                if_exists\u003dTrue))"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_c016f749","line":766,"in_reply_to":"bfb3d3c7_54a2cdaf","updated":"2019-05-28 14:27:12.000000000","message":"Done","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":767,"context_line":"                commands.append("},{"line_number":768,"context_line":"                    self.ovn_nbdb_api.ls_lb_del(ls.uuid, ovn_lb.uuid,"},{"line_number":769,"context_line":"                                                if_exists\u003dTrue))"},{"line_number":770,"context_line":"            lr_ref \u003d ovn_lb.external_ids.get(LB_EXT_IDS_LR_REF_KEY, {})"},{"line_number":771,"context_line":"            if lr_ref:"},{"line_number":772,"context_line":"                for lr in self.ovn_nbdb_api.tables["},{"line_number":773,"context_line":"                        \u0027Logical_Router\u0027].rows.values():"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_d4955d41","line":770,"range":{"start_line":770,"start_character":66,"end_line":770,"end_character":70},"updated":"2019-05-28 11:07:03.000000000","message":"do you need this?","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":767,"context_line":"                commands.append("},{"line_number":768,"context_line":"                    self.ovn_nbdb_api.ls_lb_del(ls.uuid, ovn_lb.uuid,"},{"line_number":769,"context_line":"                                                if_exists\u003dTrue))"},{"line_number":770,"context_line":"            lr_ref \u003d ovn_lb.external_ids.get(LB_EXT_IDS_LR_REF_KEY, {})"},{"line_number":771,"context_line":"            if lr_ref:"},{"line_number":772,"context_line":"                for lr in self.ovn_nbdb_api.tables["},{"line_number":773,"context_line":"                        \u0027Logical_Router\u0027].rows.values():"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_802ebf8f","line":770,"range":{"start_line":770,"start_character":66,"end_line":770,"end_character":70},"in_reply_to":"bfb3d3c7_d4955d41","updated":"2019-05-28 14:27:12.000000000","message":"I find it easier to understand","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":777,"context_line":"                        break"},{"line_number":778,"context_line":"            # Delete LB from all Routers the LB is indirectly associated"},{"line_number":779,"context_line":"            for lr in self._find_lb_in_table("},{"line_number":780,"context_line":"                ovn_lb, \u0027Logical_Router\u0027):"},{"line_number":781,"context_line":"                commands.append("},{"line_number":782,"context_line":"                    self.ovn_nbdb_api.lr_lb_del(lr.uuid, ovn_lb.uuid,"},{"line_number":783,"context_line":"                                                if_exists\u003dTrue))"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_f492e156","line":780,"updated":"2019-05-28 11:07:03.000000000","message":"indentation","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":777,"context_line":"                        break"},{"line_number":778,"context_line":"            # Delete LB from all Routers the LB is indirectly associated"},{"line_number":779,"context_line":"            for lr in self._find_lb_in_table("},{"line_number":780,"context_line":"                ovn_lb, \u0027Logical_Router\u0027):"},{"line_number":781,"context_line":"                commands.append("},{"line_number":782,"context_line":"                    self.ovn_nbdb_api.lr_lb_del(lr.uuid, ovn_lb.uuid,"},{"line_number":783,"context_line":"                                                if_exists\u003dTrue))"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_c02fd785","line":780,"in_reply_to":"bfb3d3c7_f492e156","updated":"2019-05-28 14:27:12.000000000","message":"Done","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":790,"context_line":"            network_driver \u003d get_network_driver()"},{"line_number":791,"context_line":"            network_driver.neutron_client.delete_port(port_id)"},{"line_number":792,"context_line":"        except n_exc.PortNotFoundClient:"},{"line_number":793,"context_line":"            LOG.warning(\"Port %s could not be found. Please\""},{"line_number":794,"context_line":"                        \"check Neutron logs\", port_id)"},{"line_number":795,"context_line":"        except Exception:"},{"line_number":796,"context_line":"            LOG.exception(EXCEPTION_MSG, \"deletion of loadbalancer\")"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_d4a31d9d","line":793,"range":{"start_line":793,"start_character":16,"end_line":793,"end_character":23},"updated":"2019-05-28 11:07:03.000000000","message":"Is it the right logging level? What systematic issue can it cause?","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":790,"context_line":"            network_driver \u003d get_network_driver()"},{"line_number":791,"context_line":"            network_driver.neutron_client.delete_port(port_id)"},{"line_number":792,"context_line":"        except n_exc.PortNotFoundClient:"},{"line_number":793,"context_line":"            LOG.warning(\"Port %s could not be found. Please\""},{"line_number":794,"context_line":"                        \"check Neutron logs\", port_id)"},{"line_number":795,"context_line":"        except Exception:"},{"line_number":796,"context_line":"            LOG.exception(EXCEPTION_MSG, \"deletion of loadbalancer\")"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_80055f13","line":793,"range":{"start_line":793,"start_character":16,"end_line":793,"end_character":23},"in_reply_to":"bfb3d3c7_d4a31d9d","updated":"2019-05-28 14:27:12.000000000","message":"This would occur if user deletes the port directly, but then proceeds to delete the LB ( As per what a Security personnel told me, always remember there would be some users who would be evil )\n\nThats why I kept it in Warning.","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"41220672d3ee007a95bef10d364c6cbb9052b376","unresolved":false,"context_lines":[{"line_number":1441,"context_line":"                         \u0027fixed_ips\u0027: [{\u0027subnet_id\u0027: vip_d[\u0027vip_subnet_id\u0027]}],"},{"line_number":1442,"context_line":"                         \u0027admin_state_up\u0027: True,"},{"line_number":1443,"context_line":"                         \u0027project_id\u0027: project_id}}"},{"line_number":1444,"context_line":"        if vip_d.get(\u0027vip_address\u0027, None):"},{"line_number":1445,"context_line":"            port[\u0027port\u0027][\u0027fixed_ips\u0027][0][\u0027ip_address\u0027] \u003d vip_d[\u0027vip_address\u0027]"},{"line_number":1446,"context_line":"        network_driver \u003d get_network_driver()"},{"line_number":1447,"context_line":"        return network_driver.neutron_client.create_port(port)"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_94a9257d","line":1444,"range":{"start_line":1444,"start_character":34,"end_line":1444,"end_character":40},"updated":"2019-05-28 11:07:03.000000000","message":"this is implicit","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ba8b6f4c15cf7ab4b3cab1497cf03dc455bf9fbd","unresolved":false,"context_lines":[{"line_number":1441,"context_line":"                         \u0027fixed_ips\u0027: [{\u0027subnet_id\u0027: vip_d[\u0027vip_subnet_id\u0027]}],"},{"line_number":1442,"context_line":"                         \u0027admin_state_up\u0027: True,"},{"line_number":1443,"context_line":"                         \u0027project_id\u0027: project_id}}"},{"line_number":1444,"context_line":"        if vip_d.get(\u0027vip_address\u0027, None):"},{"line_number":1445,"context_line":"            port[\u0027port\u0027][\u0027fixed_ips\u0027][0][\u0027ip_address\u0027] \u003d vip_d[\u0027vip_address\u0027]"},{"line_number":1446,"context_line":"        network_driver \u003d get_network_driver()"},{"line_number":1447,"context_line":"        return network_driver.neutron_client.create_port(port)"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_003f2fb4","line":1444,"range":{"start_line":1444,"start_character":34,"end_line":1444,"end_character":40},"in_reply_to":"bfb3d3c7_94a9257d","updated":"2019-05-28 14:27:12.000000000","message":"removed, makes sense here","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"4158da122fdabc1fc2bd01dff78ce5aa7b55e0cf","unresolved":false,"context_lines":[{"line_number":334,"context_line":"            network_driver \u003d get_network_driver()"},{"line_number":335,"context_line":"            subnet \u003d network_driver.get_subnet(subnet_id)"},{"line_number":336,"context_line":"            ls_name \u003d ovn_utils.ovn_name(subnet.network_id)"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"        ovn_ls \u003d self.ovn_nbdb_api.ls_get(ls_name).execute("},{"line_number":339,"context_line":"            check_error\u003dTrue)"},{"line_number":340,"context_line":"        if not ovn_ls:"}],"source_content_type":"text/x-python","patch_set":72,"id":"bfb3d3c7_8c01f53a","side":"PARENT","line":337,"updated":"2019-05-30 08:46:13.000000000","message":"this is not necessary and makes backports harder","commit_id":"620a8385818eb0eff53609ec31ea8f271c550894"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"4158da122fdabc1fc2bd01dff78ce5aa7b55e0cf","unresolved":false,"context_lines":[{"line_number":348,"context_line":"                ls_refs \u003d {}"},{"line_number":349,"context_line":"        else:"},{"line_number":350,"context_line":"            ls_refs \u003d {}"},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"        if associate:"},{"line_number":353,"context_line":"            if ls_name in ls_refs:"},{"line_number":354,"context_line":"                ref_ct \u003d ls_refs[ls_name]"}],"source_content_type":"text/x-python","patch_set":72,"id":"bfb3d3c7_2cfc893c","side":"PARENT","line":351,"updated":"2019-05-30 08:46:13.000000000","message":"ditto","commit_id":"620a8385818eb0eff53609ec31ea8f271c550894"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"4158da122fdabc1fc2bd01dff78ce5aa7b55e0cf","unresolved":false,"context_lines":[{"line_number":398,"context_line":"                break"},{"line_number":399,"context_line":"        else:"},{"line_number":400,"context_line":"            return"},{"line_number":401,"context_line":""},{"line_number":402,"context_line":"        lrp_name \u003d lsp_router_port.options.get(\u0027router-port\u0027)"},{"line_number":403,"context_line":"        if not lrp_name:"},{"line_number":404,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":72,"id":"bfb3d3c7_2c91e9f1","side":"PARENT","line":401,"updated":"2019-05-30 08:46:13.000000000","message":"ditto","commit_id":"620a8385818eb0eff53609ec31ea8f271c550894"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"4158da122fdabc1fc2bd01dff78ce5aa7b55e0cf","unresolved":false,"context_lines":[{"line_number":402,"context_line":"        lrp_name \u003d lsp_router_port.options.get(\u0027router-port\u0027)"},{"line_number":403,"context_line":"        if not lrp_name:"},{"line_number":404,"context_line":"            return"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"        for lr in self.ovn_nbdb_api.tables[\u0027Logical_Router\u0027].rows.values():"},{"line_number":407,"context_line":"            for lrp in lr.ports:"},{"line_number":408,"context_line":"                if lrp.name \u003d\u003d lrp_name:"}],"source_content_type":"text/x-python","patch_set":72,"id":"bfb3d3c7_ecc0b1e3","side":"PARENT","line":405,"updated":"2019-05-30 08:46:13.000000000","message":"ditto","commit_id":"620a8385818eb0eff53609ec31ea8f271c550894"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e708aae158a9a461b9bbe37498e04d594790fbd9","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        super(OvnNbIdlForLb, self).__init__("},{"line_number":135,"context_line":"            driver\u003dNone, remote\u003dself.conn_string, schema\u003dhelper)"},{"line_number":136,"context_line":"        self.event_lock_name \u003d \"neutron_ovn_octavia_event_lock\""},{"line_number":137,"context_line":"        if events:"},{"line_number":138,"context_line":"            self.notify_handler.watch_events(events)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    @tenacity.retry("}],"source_content_type":"text/x-python","patch_set":72,"id":"9fb8cfa7_edc16182","line":137,"updated":"2019-05-31 19:16:22.000000000","message":"Since the event handler code actually uses the self.ovn_nbdb_api which this returns, listening for the events before that is set causes the errors dalvarez was seeing. The event watching needs to happen outside of this/start()\u0027s code.","commit_id":"6f0c5b6ccf4c36f6b9d4f704651b4bfc622ab0f5"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"e4f71aacfac6b2ed1bbf7cc732ec5cc240f32be1","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        self.ovn_nb_idl_for_lb \u003d OvnNbIdlForLb()"},{"line_number":210,"context_line":"        OvnProviderHelper.ovn_nbdb_api \u003d self.ovn_nb_idl_for_lb.start()"},{"line_number":211,"context_line":"        events \u003d [LogicalRouterPortEvent(self), LogicalSwitchPortEvent(self)]"},{"line_number":212,"context_line":"        self.ovn_nb_idl_for_lb.notify_handler.watch_events(events)"},{"line_number":213,"context_line":"        self.helper_thread.start()"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def shutdown(self):"}],"source_content_type":"text/x-python","patch_set":74,"id":"9fb8cfa7_d350b7d7","line":212,"range":{"start_line":212,"start_character":13,"end_line":212,"end_character":30},"updated":"2019-06-01 05:36:44.000000000","message":"cool ! :)","commit_id":"2c23baa7027d7132da65a7dc8d04eb41dc92f3f1"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"702b35355d59a2336e26bf0b664f8c2277bf3e06","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        try:"},{"line_number":225,"context_line":"            return getattr(row, col)[key]"},{"line_number":226,"context_line":"        except KeyError:"},{"line_number":227,"context_line":"            raise idlutils.RowNotFound(table\u003drow.__table.name,"},{"line_number":228,"context_line":"                                       col\u003dcol, match\u003dkey)"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    def _get_nw_router_info_on_interface_add(self, row):"}],"source_content_type":"text/x-python","patch_set":74,"id":"9fb8cfa7_563823d2","line":227,"range":{"start_line":227,"start_character":49,"end_line":227,"end_character":56},"updated":"2019-06-04 02:09:40.000000000","message":"this should only have a single \u0027_\u0027: https://github.com/openvswitch/ovs/blob/0b0a84783cd6048ca3d35af0f5b4652cecd34358/python/ovs/db/idl.py#L938","commit_id":"2c23baa7027d7132da65a7dc8d04eb41dc92f3f1"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"702b35355d59a2336e26bf0b664f8c2277bf3e06","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                row, \u0027external_ids\u0027, ovn_const.NEUTRON_ROUTER_NAME)))"},{"line_number":245,"context_line":"        lsp \u003d self.ovn_nbdb_api.lookup("},{"line_number":246,"context_line":"            \u0027Logical_Switch_Port\u0027, row.name["},{"line_number":247,"context_line":"                len(ovn_const.LRP_NAME):], default\u003dNone)"},{"line_number":248,"context_line":"        network \u003d self.ovn_nbdb_api.lookup("},{"line_number":249,"context_line":"            \u0027Logical_Switch\u0027, self._map_val(lsp, \u0027external_ids\u0027,"},{"line_number":250,"context_line":"                                            ovn_const.NEUTRON_NET_NAME))"}],"source_content_type":"text/x-python","patch_set":74,"id":"9fb8cfa7_f6b7d739","line":247,"range":{"start_line":247,"start_character":41,"end_line":247,"end_character":55},"updated":"2019-06-04 02:09:40.000000000","message":"no need for default\u003dNone, not finding would raise RowNotFound which is handled. But _map_val doing getattr(None, \u0027external_ids\u0027) below would raise an unhandled AttributeError.","commit_id":"2c23baa7027d7132da65a7dc8d04eb41dc92f3f1"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"702b35355d59a2336e26bf0b664f8c2277bf3e06","unresolved":false,"context_lines":[{"line_number":486,"context_line":"    def _add_lb_to_lr_association(self, ovn_lb, ovn_lr, lr_rf):"},{"line_number":487,"context_line":"        commands \u003d []"},{"line_number":488,"context_line":"        lr_rf \u003d {LB_EXT_IDS_LR_REF_KEY: ovn_lr.name} if not lr_rf else {"},{"line_number":489,"context_line":"            LB_EXT_IDS_LR_REF_KEY: (\"%s, %s\") % (lr_rf, ovn_lr.name)}"},{"line_number":490,"context_line":"        # Multiple routers in lr_rf are separated with \u0027,\u0027"},{"line_number":491,"context_line":"        commands.append("},{"line_number":492,"context_line":"            self.ovn_nbdb_api.lr_lb_add(ovn_lr.uuid, ovn_lb.uuid,"}],"source_content_type":"text/x-python","patch_set":74,"id":"9fb8cfa7_d1a5fdb6","line":489,"range":{"start_line":489,"start_character":35,"end_line":489,"end_character":45},"updated":"2019-06-04 02:09:40.000000000","message":"parens are unnecessary","commit_id":"2c23baa7027d7132da65a7dc8d04eb41dc92f3f1"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"702b35355d59a2336e26bf0b664f8c2277bf3e06","unresolved":false,"context_lines":[{"line_number":512,"context_line":"    def _find_ls_for_lr(self, lr_name):"},{"line_number":513,"context_line":"        net_ids \u003d []"},{"line_number":514,"context_line":"        network_driver \u003d get_network_driver()"},{"line_number":515,"context_line":"        find_cond \u003d (\u0027name\u0027, \u0027\u003d\u0027, lr_name)"},{"line_number":516,"context_line":"        try:"},{"line_number":517,"context_line":"            router \u003d self.ovn_nbdb_api.db_find("},{"line_number":518,"context_line":"                \u0027Logical_Router\u0027, find_cond,"}],"source_content_type":"text/x-python","patch_set":74,"id":"9fb8cfa7_2c6d1b98","line":515,"updated":"2019-06-04 02:09:40.000000000","message":"Both uses of this method already have the logical router, so there is no need to pull it from the db again.","commit_id":"2c23baa7027d7132da65a7dc8d04eb41dc92f3f1"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"702b35355d59a2336e26bf0b664f8c2277bf3e06","unresolved":false,"context_lines":[{"line_number":519,"context_line":"                columns\u003d[\u0027ports\u0027]).execute("},{"line_number":520,"context_line":"                    check_error\u003dTrue)"},{"line_number":521,"context_line":"            for port in router[0][\u0027ports\u0027]:"},{"line_number":522,"context_line":"                ext_ids \u003d self.ovn_nbdb_api.db_get("},{"line_number":523,"context_line":"                    \u0027Logical_Router_Port\u0027, port, \u0027external_ids\u0027).execute("},{"line_number":524,"context_line":"                        check_error\u003dTrue)"},{"line_number":525,"context_line":"                for sid in ext_ids.get("}],"source_content_type":"text/x-python","patch_set":74,"id":"9fb8cfa7_2c02fbb5","line":522,"updated":"2019-06-04 02:09:40.000000000","message":"when using the passed router, we can just return a list comprehension [... for port in router.ports for sid in ...]","commit_id":"2c23baa7027d7132da65a7dc8d04eb41dc92f3f1"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"abfce489daddc281422d65147f41f49357d8d399","unresolved":false,"context_lines":[{"line_number":516,"context_line":"                    for port in router.ports"},{"line_number":517,"context_line":"                    for sid in port.external_ids.get("},{"line_number":518,"context_line":"                        ovn_const.OVN_SUBNET_EXT_IDS_KEY, \u0027\u0027).split(\u0027 \u0027)]"},{"line_number":519,"context_line":"        except Exception:"},{"line_number":520,"context_line":"            LOG.exception(\u0027Unknown exception occurred\u0027)"},{"line_number":521,"context_line":""},{"line_number":522,"context_line":"    def _find_lr_of_ls(self, ovn_ls):"}],"source_content_type":"text/x-python","patch_set":76,"id":"9fb8cfa7_1b35e2da","line":519,"updated":"2019-06-04 12:05:34.000000000","message":"This feels like it should at least return [] on Exception if we are not letting the Exception bubble up.","commit_id":"cadcd1c61f6922716681d43a7c0ccaa515193ccb"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"b6972bbbca4040f43360c87356a93dda03ba79f1","unresolved":false,"context_lines":[{"line_number":516,"context_line":"                    for port in router.ports"},{"line_number":517,"context_line":"                    for sid in port.external_ids.get("},{"line_number":518,"context_line":"                        ovn_const.OVN_SUBNET_EXT_IDS_KEY, \u0027\u0027).split(\u0027 \u0027)]"},{"line_number":519,"context_line":"        except Exception:"},{"line_number":520,"context_line":"            LOG.exception(\u0027Unknown exception occurred\u0027)"},{"line_number":521,"context_line":""},{"line_number":522,"context_line":"    def _find_lr_of_ls(self, ovn_ls):"}],"source_content_type":"text/x-python","patch_set":76,"id":"9fb8cfa7_9b7d5270","line":519,"in_reply_to":"9fb8cfa7_1b35e2da","updated":"2019-06-04 12:11:41.000000000","message":"makes sense here, it can return []","commit_id":"cadcd1c61f6922716681d43a7c0ccaa515193ccb"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"9576b0faef8a4e418fa675b11f202b0b2eed881a","unresolved":false,"context_lines":[{"line_number":272,"context_line":"                row, \u0027external_ids\u0027, ovn_const.NEUTRON_NET_NAME))"},{"line_number":273,"context_line":"        return router, network"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"    def delete_event_handler(self, row):"},{"line_number":276,"context_line":"        # TODO(reedip): When OVS\u003e\u003d2.12, LB can be deleted without removing"},{"line_number":277,"context_line":"        # Network and Router references as pushed in the patch"},{"line_number":278,"context_line":"        # https://github.com/openvswitch/ovs/commit"}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_e6ad929b","line":275,"updated":"2019-06-24 07:06:26.000000000","message":"I think the functions - delete_event_handler and add_event_handler should not do any DB updates at all. As these functions are called from the IDL thread context.\n\nThe better option is for these functions to add a request into the request queue using \"self.add_request()\" and we handle these requests in the  OvnProviderHelper helper thread, the way we handle all the API requests.","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"826074579e84b19879e2ed6787e38c2cb07db688","unresolved":false,"context_lines":[{"line_number":363,"context_line":"            self._octavia_driver_lib.update_loadbalancer_status(status)"},{"line_number":364,"context_line":"        except driver_exceptions.UpdateStatusError as e:"},{"line_number":365,"context_line":"            msg \u003d _(\"Error while updating the load balancer \""},{"line_number":366,"context_line":"                    \"status: %s\") % e.fault_string"},{"line_number":367,"context_line":"            LOG.error(msg)"},{"line_number":368,"context_line":"            raise driver_exceptions.UpdateStatusError(msg)"},{"line_number":369,"context_line":""}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_2b6065a5","line":366,"updated":"2019-06-21 09:24:33.000000000","message":"I see this over and over in the driver so it\u0027s not particular to this patch but, we shouldn\u0027t be translating LOG messages in OpenStack anymore [0]\n\n[0] https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html#log-translation","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"dc83732477e6eab94de775dcc7922f7fb1d40b92","unresolved":false,"context_lines":[{"line_number":459,"context_line":"                lr_ref.remove(ovn_lr.name)"},{"line_number":460,"context_line":"            except ValueError:"},{"line_number":461,"context_line":"                msg \u003d (_(\u0027The loadbalancer %(lb)s is not associated with \u0027"},{"line_number":462,"context_line":"                         \u0027the router %(router)s \u0027) % {"},{"line_number":463,"context_line":"                       \u0027lb\u0027: ovn_lb.name, \u0027router\u0027: ovn_lr.name})"},{"line_number":464,"context_line":"                LOG.warning(msg)"},{"line_number":465,"context_line":"            if lr_ref:"}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_340522c3","line":462,"range":{"start_line":462,"start_character":47,"end_line":462,"end_character":48},"updated":"2019-06-21 13:32:50.000000000","message":"super nit: trailing space","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"774a6ae131605f4b66853ba91b80651e98887e83","unresolved":false,"context_lines":[{"line_number":459,"context_line":"                lr_ref.remove(ovn_lr.name)"},{"line_number":460,"context_line":"            except ValueError:"},{"line_number":461,"context_line":"                msg \u003d (_(\u0027The loadbalancer %(lb)s is not associated with \u0027"},{"line_number":462,"context_line":"                         \u0027the router %(router)s \u0027) % {"},{"line_number":463,"context_line":"                       \u0027lb\u0027: ovn_lb.name, \u0027router\u0027: ovn_lr.name})"},{"line_number":464,"context_line":"                LOG.warning(msg)"},{"line_number":465,"context_line":"            if lr_ref:"}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_4c711d0c","line":462,"range":{"start_line":462,"start_character":47,"end_line":462,"end_character":48},"in_reply_to":"9fb8cfa7_340522c3","updated":"2019-06-24 06:57:37.000000000","message":"Done","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"537295d58b407cc630b5f869e7ff425d2455316e","unresolved":false,"context_lines":[{"line_number":712,"context_line":"            ovn_lb \u003d None"},{"line_number":713,"context_line":"            try:"},{"line_number":714,"context_line":"                ovn_lb \u003d self._find_ovn_lb(loadbalancer[\u0027id\u0027])"},{"line_number":715,"context_line":"            except idlutils.RowNotFound:"},{"line_number":716,"context_line":"                LOG.warning(\"Loadbalancer %s not found in OVN Northbound DB.\""},{"line_number":717,"context_line":"                            \"Setting the Loadbalancer status to DELETED \""},{"line_number":718,"context_line":"                            \"in Octavia\", str(loadbalancer[\u0027id\u0027]))"}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_41a2b64d","line":715,"updated":"2019-06-17 09:32:21.000000000","message":"Implementation of _find_ovn_lb() has been changed in meantime in master so needed to do this.","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"774a6ae131605f4b66853ba91b80651e98887e83","unresolved":false,"context_lines":[{"line_number":712,"context_line":"            ovn_lb \u003d None"},{"line_number":713,"context_line":"            try:"},{"line_number":714,"context_line":"                ovn_lb \u003d self._find_ovn_lb(loadbalancer[\u0027id\u0027])"},{"line_number":715,"context_line":"            except idlutils.RowNotFound:"},{"line_number":716,"context_line":"                LOG.warning(\"Loadbalancer %s not found in OVN Northbound DB.\""},{"line_number":717,"context_line":"                            \"Setting the Loadbalancer status to DELETED \""},{"line_number":718,"context_line":"                            \"in Octavia\", str(loadbalancer[\u0027id\u0027]))"}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_ec61f13a","line":715,"in_reply_to":"9fb8cfa7_41a2b64d","updated":"2019-06-24 06:57:37.000000000","message":"Thanks","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"dc83732477e6eab94de775dcc7922f7fb1d40b92","unresolved":false,"context_lines":[{"line_number":762,"context_line":"                    check_error\u003dTrue)"},{"line_number":763,"context_line":"                if ovn_ls:"},{"line_number":764,"context_line":"                    commands.append("},{"line_number":765,"context_line":"                        self.ovn_nbdb_api.ls_lb_del(ovn_ls.uuid, ovn_lb.uuid)"},{"line_number":766,"context_line":"                    )"},{"line_number":767,"context_line":"            # Delete LB from all Networks the LB is indirectly associated"},{"line_number":768,"context_line":"            for ls in self._find_lb_in_table("}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_14cfbeb0","line":765,"updated":"2019-06-21 13:32:50.000000000","message":"Just wondering why the if_exists\u003dTrue was removed as all the other calls to ls_lb_del() in this method have it.","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"774a6ae131605f4b66853ba91b80651e98887e83","unresolved":false,"context_lines":[{"line_number":762,"context_line":"                    check_error\u003dTrue)"},{"line_number":763,"context_line":"                if ovn_ls:"},{"line_number":764,"context_line":"                    commands.append("},{"line_number":765,"context_line":"                        self.ovn_nbdb_api.ls_lb_del(ovn_ls.uuid, ovn_lb.uuid)"},{"line_number":766,"context_line":"                    )"},{"line_number":767,"context_line":"            # Delete LB from all Networks the LB is indirectly associated"},{"line_number":768,"context_line":"            for ls in self._find_lb_in_table("}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_2ce4e9ab","line":765,"in_reply_to":"9fb8cfa7_14cfbeb0","updated":"2019-06-24 06:57:37.000000000","message":"I cannot completely recall but there seemed to be an issue. \n\nIf the loadbalancer doesnt exist with the logical switch, it wont return an error here with if_exists\u003dTrue.But it ideally should raise an error if the Logical Switch doesnt have the associated LB.\n\nBut now I am just thinking if this is a re-entrant command or not( i.e. if there is a failure and the user re-executes the lb_delete )","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"dc83732477e6eab94de775dcc7922f7fb1d40b92","unresolved":false,"context_lines":[{"line_number":793,"context_line":"            network_driver \u003d get_network_driver()"},{"line_number":794,"context_line":"            network_driver.neutron_client.delete_port(port_id)"},{"line_number":795,"context_line":"        except n_exc.PortNotFoundClient:"},{"line_number":796,"context_line":"            LOG.warning(\"Port %s could not be found. Please\""},{"line_number":797,"context_line":"                        \"check Neutron logs\", port_id)"},{"line_number":798,"context_line":"        except Exception:"},{"line_number":799,"context_line":"            LOG.exception(EXCEPTION_MSG, \"deletion of loadbalancer\")"}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_74915a99","line":796,"range":{"start_line":796,"start_character":53,"end_line":796,"end_character":59},"updated":"2019-06-21 13:32:50.000000000","message":"nit: missing trailing space","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"774a6ae131605f4b66853ba91b80651e98887e83","unresolved":false,"context_lines":[{"line_number":793,"context_line":"            network_driver \u003d get_network_driver()"},{"line_number":794,"context_line":"            network_driver.neutron_client.delete_port(port_id)"},{"line_number":795,"context_line":"        except n_exc.PortNotFoundClient:"},{"line_number":796,"context_line":"            LOG.warning(\"Port %s could not be found. Please\""},{"line_number":797,"context_line":"                        \"check Neutron logs\", port_id)"},{"line_number":798,"context_line":"        except Exception:"},{"line_number":799,"context_line":"            LOG.exception(EXCEPTION_MSG, \"deletion of loadbalancer\")"}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_ecefb184","line":796,"range":{"start_line":796,"start_character":53,"end_line":796,"end_character":59},"in_reply_to":"9fb8cfa7_74915a99","updated":"2019-06-24 06:57:37.000000000","message":"Done","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"cc6fc01199477fd3ab6e19878bb5c65da0b957f8","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def __init__(self, driver):"},{"line_number":92,"context_line":"        table \u003d \u0027Logical_Router_Port\u0027"},{"line_number":93,"context_line":"        events \u003d (self.ROW_CREATE, self.ROW_UPDATE)"},{"line_number":94,"context_line":"        super(LogicalRouterPortEvent, self).__init__("},{"line_number":95,"context_line":"            events, table, None)"},{"line_number":96,"context_line":"        self.event_name \u003d \u0027LogicalRouterPortEvent\u0027"}],"source_content_type":"text/x-python","patch_set":81,"id":"9fb8cfa7_3c5dc478","line":93,"range":{"start_line":93,"start_character":40,"end_line":93,"end_character":50},"updated":"2019-06-26 15:06:35.000000000","message":"IMO we don\u0027t need to have an eye on updates.","commit_id":"359f154930c5602537d9bef6e4f86a9a21fbac1e"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"cc6fc01199477fd3ab6e19878bb5c65da0b957f8","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            self.driver.add_event_handler(row)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"class LogicalSwitchPortEvent(row_event.RowEvent):"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    driver \u003d None"},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":81,"id":"9fb8cfa7_fcd72cbe","line":105,"updated":"2019-06-26 15:06:35.000000000","message":"Please see related patchset.\nAfter adding neutron network to LRP external_ids there is no need to watch for those events anymore and it makes the whole process simpler.","commit_id":"359f154930c5602537d9bef6e4f86a9a21fbac1e"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"044815fafa0adaac053c29b0418f8ee2cd2b4d6f","unresolved":false,"context_lines":[{"line_number":125,"context_line":"    SCHEMA \u003d \"OVN_Northbound\""},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def __init__(self):"},{"line_number":128,"context_line":"        self.tables \u003d (\u0027Logical_Switch\u0027, \u0027Load_Balancer\u0027, \u0027Logical_Router\u0027,"},{"line_number":129,"context_line":"                       \u0027Logical_Switch_Port\u0027, \u0027Logical_Router_Port\u0027)"},{"line_number":130,"context_line":"        self.conn_string \u003d ovn_cfg.get_ovn_nb_connection()"},{"line_number":131,"context_line":"        helper \u003d self._get_ovsdb_helper(self.conn_string)"}],"source_content_type":"text/x-python","patch_set":81,"id":"9fb8cfa7_25c2a55a","line":128,"updated":"2019-06-25 12:10:17.000000000","message":"It fails because OvnNbIdlForLb doesn\u0027t watch for `Gateway_Chassis` table. Because of that LRP attr gateway_chassis which is in fact relation to Gateway_Chassis fails during loading.\n\nAdding this table here solves issues.","commit_id":"359f154930c5602537d9bef6e4f86a9a21fbac1e"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"cc6fc01199477fd3ab6e19878bb5c65da0b957f8","unresolved":false,"context_lines":[{"line_number":227,"context_line":"            raise idlutils.RowNotFound(table\u003drow._table.name,"},{"line_number":228,"context_line":"                                       col\u003dcol, match\u003dkey)"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    def _get_nw_router_info_on_interface_add(self, row):"},{"line_number":231,"context_line":"        \"\"\"Get the Router and Network information on a new interface add"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        This function is called when a new interface between a router and"}],"source_content_type":"text/x-python","patch_set":81,"id":"9fb8cfa7_bc48d4b2","line":230,"range":{"start_line":230,"start_character":5,"end_line":230,"end_character":45},"updated":"2019-06-26 15:06:35.000000000","message":"We don\u0027t need to have 2 functions now, so making it to be simpler.","commit_id":"359f154930c5602537d9bef6e4f86a9a21fbac1e"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"401cf64ec3f6868f350018fcb094db3ab3c24c9b","unresolved":false,"context_lines":[{"line_number":295,"context_line":"        for rlb in r_lb:"},{"line_number":296,"context_line":"            commands.append(self.ovn_nbdb_api.ls_lb_del("},{"line_number":297,"context_line":"                network.uuid, rlb.uuid))"},{"line_number":298,"context_line":"        self._execute_commands(commands)"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    def add_event_handler(self, row):"},{"line_number":301,"context_line":"        commands \u003d []"}],"source_content_type":"text/x-python","patch_set":81,"id":"9fb8cfa7_97f4fe88","line":298,"updated":"2019-06-24 07:15:03.000000000","message":"Please see this patch -https://review.opendev.org/#/c/667028/1/networking_ovn/octavia/ovn_driver.py Line 358.\n\nI suggest to handle the same way.\nLet the functions delete_event_handler and add_event_handler add the requests in the request queue instead of executing IDL commands.\n\nI think this may cause race conditions.","commit_id":"359f154930c5602537d9bef6e4f86a9a21fbac1e"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"cc6fc01199477fd3ab6e19878bb5c65da0b957f8","unresolved":false,"context_lines":[{"line_number":295,"context_line":"        for rlb in r_lb:"},{"line_number":296,"context_line":"            commands.append(self.ovn_nbdb_api.ls_lb_del("},{"line_number":297,"context_line":"                network.uuid, rlb.uuid))"},{"line_number":298,"context_line":"        self._execute_commands(commands)"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    def add_event_handler(self, row):"},{"line_number":301,"context_line":"        commands \u003d []"}],"source_content_type":"text/x-python","patch_set":81,"id":"9fb8cfa7_dc8828c7","line":298,"in_reply_to":"9fb8cfa7_97f4fe88","updated":"2019-06-26 15:06:35.000000000","message":"Done","commit_id":"359f154930c5602537d9bef6e4f86a9a21fbac1e"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"cc6fc01199477fd3ab6e19878bb5c65da0b957f8","unresolved":false,"context_lines":[{"line_number":466,"context_line":"                commands.append("},{"line_number":467,"context_line":"                    self.ovn_nbdb_api.db_set("},{"line_number":468,"context_line":"                        \u0027Load_Balancer\u0027, ovn_lb.uuid,"},{"line_number":469,"context_line":"                        (\u0027external_ids\u0027, \",\".join(lr_ref)))"},{"line_number":470,"context_line":"                )"},{"line_number":471,"context_line":"            else:"},{"line_number":472,"context_line":"                commands.append("}],"source_content_type":"text/x-python","patch_set":81,"id":"9fb8cfa7_dc76e8d8","line":469,"updated":"2019-06-26 15:06:35.000000000","message":"It breaks things. It tries to update every external_ids instead only \u0027lr_ref\u0027.","commit_id":"359f154930c5602537d9bef6e4f86a9a21fbac1e"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"cc6fc01199477fd3ab6e19878bb5c65da0b957f8","unresolved":false,"context_lines":[{"line_number":250,"context_line":"            return"},{"line_number":251,"context_line":"        request_info \u003d {\u0027network\u0027: network,"},{"line_number":252,"context_line":"                        \u0027router\u0027: router}"},{"line_number":253,"context_line":"        self.add_request({\u0027type\u0027: REQ_TYPE_LB_DELETE_LRP_ASSOC,"},{"line_number":254,"context_line":"                          \u0027info\u0027: request_info})"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def lb_delete_lrp_assoc(self, info):"},{"line_number":257,"context_line":"        # TODO(reedip): When OVS\u003e\u003d2.12, LB can be deleted without removing"}],"source_content_type":"text/x-python","patch_set":82,"id":"9fb8cfa7_1c9b2017","line":254,"range":{"start_line":253,"start_character":8,"end_line":254,"end_character":48},"updated":"2019-06-26 15:06:35.000000000","message":"Its to use other IDL thread.","commit_id":"3f4f7c74a978b40b0524af21b2223d015d104e61"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"cc6fc01199477fd3ab6e19878bb5c65da0b957f8","unresolved":false,"context_lines":[{"line_number":443,"context_line":"        commands \u003d []"},{"line_number":444,"context_line":"        if lr_ref:"},{"line_number":445,"context_line":"            try:"},{"line_number":446,"context_line":"                lr_ref \u003d [r.strip()"},{"line_number":447,"context_line":"                          for r in lr_ref.split(\u0027,\u0027)"},{"line_number":448,"context_line":"                          if r.strip() !\u003d ovn_lr.name]"},{"line_number":449,"context_line":"            except ValueError:"}],"source_content_type":"text/x-python","patch_set":82,"id":"9fb8cfa7_dcb10891","line":446,"updated":"2019-06-26 15:06:35.000000000","message":"The splitted list has whitespaces, needs to be rstripped.","commit_id":"3f4f7c74a978b40b0524af21b2223d015d104e61"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"602bfe90d984a3f24b29e008ecb37006b5e560a2","unresolved":false,"context_lines":[{"line_number":58,"context_line":"REQ_TYPE_MEMBER_DELETE \u003d \u0027member_delete\u0027"},{"line_number":59,"context_line":"REQ_TYPE_MEMBER_UPDATE \u003d \u0027member_update\u0027"},{"line_number":60,"context_line":"REQ_TYPE_LB_CREATE_LRP_ASSOC \u003d \u0027lb_create_lrp_assoc\u0027"},{"line_number":61,"context_line":"REQ_TYPE_LB_DELETE_LRP_ASSOC \u003d \u0027lb_delete_lrp_assoc\u0027"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"REQ_TYPE_EXIT \u003d \u0027exit\u0027"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":83,"id":"9fb8cfa7_04d419e8","line":61,"range":{"start_line":61,"start_character":22,"end_line":61,"end_character":28},"updated":"2019-06-27 10:45:48.000000000","message":"this should be DISASSOC?","commit_id":"e23030d19d0954e16edb971a821a2b228cb8ca55"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"99fcab722acb2fe4bdfd7e88d104f7938621dde9","unresolved":false,"context_lines":[{"line_number":58,"context_line":"REQ_TYPE_MEMBER_DELETE \u003d \u0027member_delete\u0027"},{"line_number":59,"context_line":"REQ_TYPE_MEMBER_UPDATE \u003d \u0027member_update\u0027"},{"line_number":60,"context_line":"REQ_TYPE_LB_CREATE_LRP_ASSOC \u003d \u0027lb_create_lrp_assoc\u0027"},{"line_number":61,"context_line":"REQ_TYPE_LB_DELETE_LRP_ASSOC \u003d \u0027lb_delete_lrp_assoc\u0027"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"REQ_TYPE_EXIT \u003d \u0027exit\u0027"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":83,"id":"9fb8cfa7_422201bb","line":61,"range":{"start_line":61,"start_character":22,"end_line":61,"end_character":28},"in_reply_to":"9fb8cfa7_04d419e8","updated":"2019-06-27 12:28:36.000000000","message":"REQ_TYPE_LB_DELETE_LRP_ASSOC is shortcut of REQ_TYPE_LB_DELETE_LRP_ASSOCATION, so for me I would stay with REQ_TYPE_LB_DELETE_LRP_ASSOC","commit_id":"e23030d19d0954e16edb971a821a2b228cb8ca55"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"602bfe90d984a3f24b29e008ecb37006b5e560a2","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        if ((event \u003d\u003d self.ROW_CREATE and"},{"line_number":108,"context_line":"             self.driver and not row.gateway_chassis)):"},{"line_number":109,"context_line":"            self.driver.lb_create_lrp_assoc_handler(row)"},{"line_number":110,"context_line":"        if ((event \u003d\u003d self.ROW_DELETE and"},{"line_number":111,"context_line":"             self.driver and not row.gateway_chassis)):"},{"line_number":112,"context_line":"            self.driver.lb_delete_lrp_assoc_handler(row)"},{"line_number":113,"context_line":""}],"source_content_type":"text/x-python","patch_set":83,"id":"9fb8cfa7_6495d531","line":110,"range":{"start_line":110,"start_character":8,"end_line":110,"end_character":10},"updated":"2019-06-27 10:45:48.000000000","message":"better use elif here?","commit_id":"e23030d19d0954e16edb971a821a2b228cb8ca55"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"99fcab722acb2fe4bdfd7e88d104f7938621dde9","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        if ((event \u003d\u003d self.ROW_CREATE and"},{"line_number":108,"context_line":"             self.driver and not row.gateway_chassis)):"},{"line_number":109,"context_line":"            self.driver.lb_create_lrp_assoc_handler(row)"},{"line_number":110,"context_line":"        if ((event \u003d\u003d self.ROW_DELETE and"},{"line_number":111,"context_line":"             self.driver and not row.gateway_chassis)):"},{"line_number":112,"context_line":"            self.driver.lb_delete_lrp_assoc_handler(row)"},{"line_number":113,"context_line":""}],"source_content_type":"text/x-python","patch_set":83,"id":"9fb8cfa7_a21add79","line":110,"range":{"start_line":110,"start_character":8,"end_line":110,"end_character":10},"in_reply_to":"9fb8cfa7_6495d531","updated":"2019-06-27 12:28:36.000000000","message":"Thanks! Would be better event to something like:\n\nif self.driver and not row.gateway_chassis:\n   if event \u003d\u003d self.ROW_CREATE:\n      self.driver.lb_create_lrp_assoc_handler(row)\n   elif event \u003d\u003d self.ROW_DELETE:\n      self.driver.lb_delete_lrp_assoc_handler(row)\n\nI\u0027ll change it.","commit_id":"e23030d19d0954e16edb971a821a2b228cb8ca55"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"602bfe90d984a3f24b29e008ecb37006b5e560a2","unresolved":false,"context_lines":[{"line_number":453,"context_line":"                        \u0027router\u0027: ovn_lr.name})"},{"line_number":454,"context_line":"                LOG.warning(msg)"},{"line_number":455,"context_line":"            if lr_ref:"},{"line_number":456,"context_line":"                new_external_ids \u003d copy.deepcopy(ovn_lb.external_ids)"},{"line_number":457,"context_line":"                new_external_ids.update({"},{"line_number":458,"context_line":"                    LB_EXT_IDS_LS_REFS_KEY: \", \".join(lr_ref)})"},{"line_number":459,"context_line":"                commands.append("},{"line_number":460,"context_line":"                    self.ovn_nbdb_api.db_set("},{"line_number":461,"context_line":"                        \u0027Load_Balancer\u0027, ovn_lb.uuid,"}],"source_content_type":"text/x-python","patch_set":83,"id":"9fb8cfa7_640ab579","line":458,"range":{"start_line":456,"start_character":16,"end_line":458,"end_character":63},"updated":"2019-06-27 10:45:48.000000000","message":"why? was the previous implementation wrong? I do understand you have added \" \" after the \",\" but I dont think deepcopy is necessary","commit_id":"e23030d19d0954e16edb971a821a2b228cb8ca55"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"99fcab722acb2fe4bdfd7e88d104f7938621dde9","unresolved":false,"context_lines":[{"line_number":453,"context_line":"                        \u0027router\u0027: ovn_lr.name})"},{"line_number":454,"context_line":"                LOG.warning(msg)"},{"line_number":455,"context_line":"            if lr_ref:"},{"line_number":456,"context_line":"                new_external_ids \u003d copy.deepcopy(ovn_lb.external_ids)"},{"line_number":457,"context_line":"                new_external_ids.update({"},{"line_number":458,"context_line":"                    LB_EXT_IDS_LS_REFS_KEY: \", \".join(lr_ref)})"},{"line_number":459,"context_line":"                commands.append("},{"line_number":460,"context_line":"                    self.ovn_nbdb_api.db_set("},{"line_number":461,"context_line":"                        \u0027Load_Balancer\u0027, ovn_lb.uuid,"}],"source_content_type":"text/x-python","patch_set":83,"id":"9fb8cfa7_9d4db873","line":458,"range":{"start_line":456,"start_character":16,"end_line":458,"end_character":63},"in_reply_to":"9fb8cfa7_640ab579","updated":"2019-06-27 12:28:36.000000000","message":"I checked the logs that @numans provided and it was failing all the time on:\n\nself.ovn_nbdb_api.db_set(                        \n \u0027Load_Balancer\u0027, ovn_lb.uuid,\n (\u0027external_ids\u0027, \",\".join(lr_ref)))\n\nI checked it and it looked like it modifies the whole external_ids, not the key LB_EXT_IDS_LS_REFS_KEY. So it ends with string for external_ids instead of dict.","commit_id":"e23030d19d0954e16edb971a821a2b228cb8ca55"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"602bfe90d984a3f24b29e008ecb37006b5e560a2","unresolved":false,"context_lines":[{"line_number":503,"context_line":"            return self._add_lb_to_lr_association(ovn_lb, ovn_lr, lr_ref)"},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"    def _find_ls_for_lr(self, router):"},{"line_number":506,"context_line":"        # NOTE(mjozefcz): This function could return list of"},{"line_number":507,"context_line":"        # LS ids instead names"},{"line_number":508,"context_line":"        netdriver \u003d get_network_driver()"},{"line_number":509,"context_line":"        try:"},{"line_number":510,"context_line":"            return [ovn_utils.ovn_name(netdriver.get_subnet(sid).network_id)"}],"source_content_type":"text/x-python","patch_set":83,"id":"9fb8cfa7_44253108","line":507,"range":{"start_line":506,"start_character":0,"end_line":507,"end_character":30},"updated":"2019-06-27 10:45:48.000000000","message":"It can, need to change the implementation of its users then","commit_id":"e23030d19d0954e16edb971a821a2b228cb8ca55"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"99fcab722acb2fe4bdfd7e88d104f7938621dde9","unresolved":false,"context_lines":[{"line_number":503,"context_line":"            return self._add_lb_to_lr_association(ovn_lb, ovn_lr, lr_ref)"},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"    def _find_ls_for_lr(self, router):"},{"line_number":506,"context_line":"        # NOTE(mjozefcz): This function could return list of"},{"line_number":507,"context_line":"        # LS ids instead names"},{"line_number":508,"context_line":"        netdriver \u003d get_network_driver()"},{"line_number":509,"context_line":"        try:"},{"line_number":510,"context_line":"            return [ovn_utils.ovn_name(netdriver.get_subnet(sid).network_id)"}],"source_content_type":"text/x-python","patch_set":83,"id":"9fb8cfa7_9d7618a4","line":507,"range":{"start_line":506,"start_character":0,"end_line":507,"end_character":30},"in_reply_to":"9fb8cfa7_44253108","updated":"2019-06-27 12:28:36.000000000","message":"For now I\u0027ll leave it as it is. I only added this note while debugging, sorry! I\u0027ll drop it in next patch.","commit_id":"e23030d19d0954e16edb971a821a2b228cb8ca55"}],"networking_ovn/tests/functional/octavia/test_ovn_driver.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"941bae8100c8556c4e131aed21e2d5c82fd63b03","unresolved":false,"context_lines":[{"line_number":901,"context_line":"                                       lb_data[\u0027listeners\u0027][0].listener_id)"},{"line_number":902,"context_line":"        self._delete_listener_and_validate(lb_data)"},{"line_number":903,"context_line":"        self._delete_load_balancer_and_validate(lb_data)"},{"line_number":904,"context_line":"\u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_a5052848","line":904,"updated":"2019-01-28 16:33:06.000000000","message":"Why we r commenting it all ?\n\nWe can\u0027t really do it","commit_id":"5c2c72cd52545365703422760710de937d691ced"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"3c311417cf84ef8b88d476ff8c72b67c9bb47e1a","unresolved":false,"context_lines":[{"line_number":794,"context_line":"                          self._update_listener_and_validate,"},{"line_number":795,"context_line":"                          lb_data, protocol_port\u003d80, protocol\u003d\u0027UDP\u0027)"},{"line_number":796,"context_line":"        self._delete_load_balancer_and_validate(lb_data)"},{"line_number":797,"context_line":"\u0027\u0027\u0027"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"    def test_cascade_delete(self):"},{"line_number":800,"context_line":"        self._test_cascade_delete()"},{"line_number":801,"context_line":"    def test_event_handler(self):"},{"line_number":802,"context_line":"        # Tests following scenario"},{"line_number":803,"context_line":"        # - Create Network N1 on router R1 and LBA on N1"},{"line_number":804,"context_line":"        # - Create Network N2, connect it to R1"},{"line_number":805,"context_line":"        # - Check if LBA exists on N2"},{"line_number":806,"context_line":"        # - Create Network N3"},{"line_number":807,"context_line":"        # - Create Load Balancer LBB on N3"},{"line_number":808,"context_line":"        # - Attach N3 to R1"},{"line_number":809,"context_line":"        # - Check if LBB exists on N1 and N2, LBA on N3 -\u003e YES"},{"line_number":810,"context_line":"        # - Check now if LBB exists on R1 -\u003e YES"},{"line_number":811,"context_line":"        # - Remove N3 from R1"},{"line_number":812,"context_line":"        # - Check if LBB exists on N1 and N2, LBA on N3 -\u003e NO"},{"line_number":813,"context_line":"        # - Delete LBA and check if it exists on N1 and N2"},{"line_number":814,"context_line":"        lba_data \u003d self._create_load_balancer_and_validate("},{"line_number":815,"context_line":"            {\u0027vip_network\u0027: \u0027N1\u0027,"},{"line_number":816,"context_line":"             \u0027cidr\u0027: \u002710.0.0.0/24\u0027})"},{"line_number":817,"context_line":"        self._create_net("},{"line_number":818,"context_line":"            \"N2\", \"10.0.1.0/24\", lba_data[ovn_driver.LB_EXT_IDS_LR_REF_KEY])"},{"line_number":819,"context_line":"        for nw in self.nb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":820,"context_line":"            if nw.name \u003d\u003d \u0027N2\u0027:"},{"line_number":821,"context_line":"                self.assertEqual(lba_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":822,"context_line":"                                 nw.load_balancer)"},{"line_number":823,"context_line":"                break"},{"line_number":824,"context_line":"        for router in self.nb_api.tables[\u0027Logical_Router\u0027].rows.values():"},{"line_number":825,"context_line":"            if router.uuid \u003d\u003d lba_data[ovn_driver.LB_EXT_IDS_LR_REF_KEY]:"},{"line_number":826,"context_line":"                self.assertEqual(lba_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":827,"context_line":"                                 router.load_balancer)"},{"line_number":828,"context_line":"                break"},{"line_number":829,"context_line":"        lbb_data \u003d self._create_load_balancer_and_validate("},{"line_number":830,"context_line":"            {\u0027vip_network\u0027: \u0027N3\u0027,"},{"line_number":831,"context_line":"             \u0027cidr\u0027: \u002710.0.2.0/24\u0027}, create_router\u003dFalse)"},{"line_number":832,"context_line":"        self.l3_plugin.add_router_interface("},{"line_number":833,"context_line":"            self.context, lba_data[ovn_driver.LB_EXT_IDS_LR_REF_KEY],"},{"line_number":834,"context_line":"            {\u0027subnet_id\u0027: lbb_data[\u0027vip_net_info\u0027][1]})"},{"line_number":835,"context_line":"        # N3 added to R1"},{"line_number":836,"context_line":"        for nw in self.nb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":837,"context_line":"            if nw.name \u003d\u003d \u0027N3\u0027:"},{"line_number":838,"context_line":"                self.assertEqual(lba_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":839,"context_line":"                                 nw.load_balancer)"},{"line_number":840,"context_line":"                break"},{"line_number":841,"context_line":"        for nw in self.nb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":842,"context_line":"            if nw.name \u003d\u003d \u0027N1\u0027:"},{"line_number":843,"context_line":"                self.assertEqual(lbb_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":844,"context_line":"                                 nw.load_balancer)"},{"line_number":845,"context_line":"                break"},{"line_number":846,"context_line":"        for nw in self.nb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":847,"context_line":"            if nw.name \u003d\u003d \u0027N2\u0027:"},{"line_number":848,"context_line":"                self.assertEqual(lbb_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":849,"context_line":"                                 nw.load_balancer)"},{"line_number":850,"context_line":"                break"},{"line_number":851,"context_line":"        for router in self.nb_api.tables[\u0027Logical_Router\u0027].rows.values():"},{"line_number":852,"context_line":"            if router.uuid \u003d\u003d lba_data[ovn_driver.LB_EXT_IDS_LR_REF_KEY]:"},{"line_number":853,"context_line":"                self.assertEqual(lbb_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":854,"context_line":"                                 router.load_balancer)"},{"line_number":855,"context_line":"                break"},{"line_number":856,"context_line":"        # N3 removed from R1"},{"line_number":857,"context_line":"        self.l3_plugin.remove_router_interface("},{"line_number":858,"context_line":"            self.context, lba_data[ovn_driver.LB_EXT_IDS_LR_REF_KEY],"},{"line_number":859,"context_line":"            {\u0027subnet_id\u0027: lbb_data[\u0027vip_net_info\u0027][1]})"},{"line_number":860,"context_line":"        self._delete_load_balancer_and_validate(lbb_data)"},{"line_number":861,"context_line":"        self._delete_load_balancer_and_validate(lba_data)"},{"line_number":862,"context_line":""},{"line_number":863,"context_line":"    def test_lb_pool_cascade(self):"},{"line_number":864,"context_line":"        self._test_cascade_delete(member\u003dFalse, listener\u003dFalse)"},{"line_number":865,"context_line":""},{"line_number":866,"context_line":"    def test_lb_listener_pools_cascade(self):"},{"line_number":867,"context_line":"        self._test_cascade_delete(member\u003dFalse)"},{"line_number":868,"context_line":""},{"line_number":869,"context_line":"    def test_listener(self):"},{"line_number":870,"context_line":"        lb_data \u003d self._create_load_balancer_and_validate("},{"line_number":871,"context_line":"            {\u0027vip_network\u0027: \u0027vip_network\u0027,"},{"line_number":872,"context_line":"             \u0027cidr\u0027: \u002710.0.0.0/24\u0027})"},{"line_number":873,"context_line":"        self._create_pool_and_validate(lb_data, \"p1\")"},{"line_number":874,"context_line":"        pool_id \u003d lb_data[\u0027pools\u0027][0].pool_id"},{"line_number":875,"context_line":"        self._create_member_and_validate("},{"line_number":876,"context_line":"            lb_data, pool_id, lb_data[\u0027vip_net_info\u0027][1],"},{"line_number":877,"context_line":"            lb_data[\u0027vip_net_info\u0027][0], \u002710.0.0.10\u0027)"},{"line_number":878,"context_line":""},{"line_number":879,"context_line":"        net_info \u003d self._create_net(\u0027net1\u0027, \u002720.0.0.0/24\u0027)"},{"line_number":880,"context_line":"        self._create_member_and_validate(lb_data, pool_id,"},{"line_number":881,"context_line":"                                         net_info[1], net_info[0], \u002720.0.0.4\u0027)"},{"line_number":882,"context_line":"        self._create_listener_and_validate(lb_data, pool_id, 80)"},{"line_number":883,"context_line":"        self._update_listener_and_validate(lb_data, 80)"},{"line_number":884,"context_line":"        self._update_listener_and_validate(lb_data, 80, admin_state_up\u003dTrue)"},{"line_number":885,"context_line":"        self._update_listener_and_validate(lb_data, 80, admin_state_up\u003dFalse)"},{"line_number":886,"context_line":"        self._update_listener_and_validate(lb_data, 80, admin_state_up\u003dTrue)"},{"line_number":887,"context_line":"        self._create_listener_and_validate(lb_data, pool_id, 82)"},{"line_number":888,"context_line":""},{"line_number":889,"context_line":"        self._delete_listener_and_validate(lb_data, 82)"},{"line_number":890,"context_line":"        self._delete_listener_and_validate(lb_data, 80)"},{"line_number":891,"context_line":"        self._delete_load_balancer_and_validate(lb_data)"},{"line_number":892,"context_line":""},{"line_number":893,"context_line":"    def test_lb_listener_pool_workflow(self):"},{"line_number":894,"context_line":"        lb_data \u003d self._create_load_balancer_and_validate("},{"line_number":895,"context_line":"            {\u0027vip_network\u0027: \u0027vip_network\u0027,"},{"line_number":896,"context_line":"             \u0027cidr\u0027: \u002710.0.0.0/24\u0027})"},{"line_number":897,"context_line":"        self._create_listener_and_validate(lb_data)"},{"line_number":898,"context_line":"        self._create_pool_and_validate(lb_data, \"p1\","},{"line_number":899,"context_line":"                                       lb_data[\u0027listeners\u0027][0].listener_id)"},{"line_number":900,"context_line":"        self._delete_pool_and_validate(lb_data, \"p1\","},{"line_number":901,"context_line":"                                       lb_data[\u0027listeners\u0027][0].listener_id)"},{"line_number":902,"context_line":"        self._delete_listener_and_validate(lb_data)"},{"line_number":903,"context_line":"        self._delete_load_balancer_and_validate(lb_data)"},{"line_number":904,"context_line":"\u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":34,"id":"9fdfeff1_4cd469e9","line":904,"range":{"start_line":797,"start_character":0,"end_line":904,"end_character":3},"updated":"2019-01-31 12:37:15.000000000","message":"This here is my biggest concern with this patch, we can not comment the tests like that. We need to update them.","commit_id":"3b2c6f45814ab0825f187a4086020732c4b06728"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"556173b5292e2c87152b0d782a708b93f7fffbfb","unresolved":false,"context_lines":[{"line_number":794,"context_line":"                          self._update_listener_and_validate,"},{"line_number":795,"context_line":"                          lb_data, protocol_port\u003d80, protocol\u003d\u0027UDP\u0027)"},{"line_number":796,"context_line":"        self._delete_load_balancer_and_validate(lb_data)"},{"line_number":797,"context_line":"\u0027\u0027\u0027"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"    def test_cascade_delete(self):"},{"line_number":800,"context_line":"        self._test_cascade_delete()"}],"source_content_type":"text/x-python","patch_set":35,"id":"9fdfeff1_9b4a4181","line":797,"range":{"start_line":797,"start_character":0,"end_line":797,"end_character":3},"updated":"2019-02-05 11:55:52.000000000","message":"Why is this? I think that other reviewers commented in earlier patchsets. If these tests are needed, let\u0027s make them pass. If not, let\u0027s remove this whole block","commit_id":"ac3896b020ca0220b6565169918e42ce408388ff"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"f7abaa39d4da1736db31534132d43c00f013580f","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        self._create_listener_and_validate(lb_data, pool_id, 82)"},{"line_number":768,"context_line":""},{"line_number":769,"context_line":"        self._delete_listener_and_validate(lb_data, 82)"},{"line_number":770,"context_line":"        self._delete_listener_and_validate(lb_data, 80)"},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"    def _test_cascade_delete(self, pool\u003dTrue, listener\u003dTrue, member\u003dTrue):"},{"line_number":773,"context_line":"        lb_data \u003d self._create_load_balancer_and_validate("}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_ac546355","side":"PARENT","line":770,"updated":"2019-02-22 14:31:09.000000000","message":"We do not need to move these methods right ? Just make things more complicated when looking at the diff","commit_id":"f0843c198890fdc811a5bd8eee716769609b4b9f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a8be5e7def08ed793561905ddf85a14080356b0c","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        self._create_listener_and_validate(lb_data, pool_id, 82)"},{"line_number":768,"context_line":""},{"line_number":769,"context_line":"        self._delete_listener_and_validate(lb_data, 82)"},{"line_number":770,"context_line":"        self._delete_listener_and_validate(lb_data, 80)"},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"    def _test_cascade_delete(self, pool\u003dTrue, listener\u003dTrue, member\u003dTrue):"},{"line_number":773,"context_line":"        lb_data \u003d self._create_load_balancer_and_validate("}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_c8c5f80b","side":"PARENT","line":770,"in_reply_to":"9fdfeff1_ac546355","updated":"2019-02-25 08:06:06.000000000","message":"No, they didnt need to be moved, but I was experimenting with why some tests passed and some failed, so I block commented the tests which were failing, and therefore moved the tests to a single section :)\n\nIf it is required, I can move them back up","commit_id":"f0843c198890fdc811a5bd8eee716769609b4b9f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"f7abaa39d4da1736db31534132d43c00f013580f","unresolved":false,"context_lines":[{"line_number":792,"context_line":"        self._test_cascade_delete(member\u003dFalse, listener\u003dFalse)"},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"    def test_cascade_delete(self):"},{"line_number":795,"context_line":"        self._test_cascade_delete()"},{"line_number":796,"context_line":""},{"line_number":797,"context_line":"    def test_for_unsupported_options(self):"},{"line_number":798,"context_line":"        lb_data \u003d self._create_load_balancer_and_validate("}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_2cc63318","side":"PARENT","line":795,"updated":"2019-02-22 14:31:09.000000000","message":"ditto: Moving these methods just make things more complicated when looking at the diff","commit_id":"f0843c198890fdc811a5bd8eee716769609b4b9f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a8be5e7def08ed793561905ddf85a14080356b0c","unresolved":false,"context_lines":[{"line_number":792,"context_line":"        self._test_cascade_delete(member\u003dFalse, listener\u003dFalse)"},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"    def test_cascade_delete(self):"},{"line_number":795,"context_line":"        self._test_cascade_delete()"},{"line_number":796,"context_line":""},{"line_number":797,"context_line":"    def test_for_unsupported_options(self):"},{"line_number":798,"context_line":"        lb_data \u003d self._create_load_balancer_and_validate("}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_c893b8ff","side":"PARENT","line":795,"in_reply_to":"9fdfeff1_2cc63318","updated":"2019-02-25 08:06:06.000000000","message":"Done","commit_id":"f0843c198890fdc811a5bd8eee716769609b4b9f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"f7abaa39d4da1736db31534132d43c00f013580f","unresolved":false,"context_lines":[{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def _validate_loadbalancers(self, expected_lbs):"},{"line_number":148,"context_line":"        observed_lbs \u003d self._get_loadbalancers()"},{"line_number":149,"context_line":"        try:"},{"line_number":150,"context_line":"            self.assertItemsEqual(expected_lbs, observed_lbs)"},{"line_number":151,"context_line":"        except AssertionError:"},{"line_number":152,"context_line":"            if expected_lbs:"},{"line_number":153,"context_line":"                for lb in observed_lbs:"},{"line_number":154,"context_line":"                    if lb[\u0027name\u0027] \u003d\u003d expected_lbs[0][\u0027name\u0027]:"},{"line_number":155,"context_line":"                        self.assertItemsEqual(expected_lbs[0], lb)"},{"line_number":156,"context_line":"            elif not expected_lbs:"},{"line_number":157,"context_line":"                self.assertEqual(len(observed_lbs),"},{"line_number":158,"context_line":"                                 int(self.lb_count) - 1)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def _is_lb_associated_to_ls(self, lb_name, ls_name):"},{"line_number":161,"context_line":"        lb_uuid \u003d self._get_loadbalancer_id(lb_name)"}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_4c64d749","line":158,"range":{"start_line":149,"start_character":0,"end_line":158,"end_character":56},"updated":"2019-02-22 14:31:09.000000000","message":"We should have different instances of OVSDB for each test therefore we can be assertive about what to expect from the results here.\n\nIf we have more load balancers than expected in the DB we have a problem. We shouldn\u0027t try to work around that IMHO.","commit_id":"a5ec93511196e6d826251339d5a6141e9389a541"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a8be5e7def08ed793561905ddf85a14080356b0c","unresolved":false,"context_lines":[{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def _validate_loadbalancers(self, expected_lbs):"},{"line_number":148,"context_line":"        observed_lbs \u003d self._get_loadbalancers()"},{"line_number":149,"context_line":"        try:"},{"line_number":150,"context_line":"            self.assertItemsEqual(expected_lbs, observed_lbs)"},{"line_number":151,"context_line":"        except AssertionError:"},{"line_number":152,"context_line":"            if expected_lbs:"},{"line_number":153,"context_line":"                for lb in observed_lbs:"},{"line_number":154,"context_line":"                    if lb[\u0027name\u0027] \u003d\u003d expected_lbs[0][\u0027name\u0027]:"},{"line_number":155,"context_line":"                        self.assertItemsEqual(expected_lbs[0], lb)"},{"line_number":156,"context_line":"            elif not expected_lbs:"},{"line_number":157,"context_line":"                self.assertEqual(len(observed_lbs),"},{"line_number":158,"context_line":"                                 int(self.lb_count) - 1)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def _is_lb_associated_to_ls(self, lb_name, ls_name):"},{"line_number":161,"context_line":"        lb_uuid \u003d self._get_loadbalancer_id(lb_name)"}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_e82c7c02","line":158,"range":{"start_line":149,"start_character":0,"end_line":158,"end_character":56},"in_reply_to":"9fdfeff1_4c64d749","updated":"2019-02-25 08:06:06.000000000","message":"There are tests where multiple LoadBalancers are created. In that case, when we get the output from the OVN nbctl, we would get multiple LoadBalancers. This just ensures that in case there are more than one LB due to multiple LB created in a test, the AssertItemsEqual in Line#155 matches","commit_id":"a5ec93511196e6d826251339d5a6141e9389a541"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"17557fa6ebf496392ab8ebbe75831bbf43b84392","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        expected_calls \u003d [mock.call(status) for status in expected_status]"},{"line_number":216,"context_line":"        update_loadbalancer_status \u003d ("},{"line_number":217,"context_line":"            self._o_driver_lib.update_loadbalancer_status)"},{"line_number":218,"context_line":"        try:"},{"line_number":219,"context_line":"            n_utils.wait_until_true("},{"line_number":220,"context_line":"                lambda: update_loadbalancer_status.call_count \u003d\u003d call_count,"},{"line_number":221,"context_line":"                timeout\u003d10)"}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_8644e048","line":218,"range":{"start_line":218,"start_character":0,"end_line":218,"end_character":12},"updated":"2019-02-22 11:57:07.000000000","message":"Why moving this here? do you want to check if it was a Timeout? then maybe capture the right timeout exception? https://github.com/eventlet/eventlet/blob/master/eventlet/timeout.py#L41","commit_id":"a5ec93511196e6d826251339d5a6141e9389a541"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a8be5e7def08ed793561905ddf85a14080356b0c","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        expected_calls \u003d [mock.call(status) for status in expected_status]"},{"line_number":216,"context_line":"        update_loadbalancer_status \u003d ("},{"line_number":217,"context_line":"            self._o_driver_lib.update_loadbalancer_status)"},{"line_number":218,"context_line":"        try:"},{"line_number":219,"context_line":"            n_utils.wait_until_true("},{"line_number":220,"context_line":"                lambda: update_loadbalancer_status.call_count \u003d\u003d call_count,"},{"line_number":221,"context_line":"                timeout\u003d10)"}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_a85d147a","line":218,"range":{"start_line":218,"start_character":0,"end_line":218,"end_character":12},"in_reply_to":"9fdfeff1_8644e048","updated":"2019-02-25 08:06:06.000000000","message":"The movement of the Try part is for capturing the timeout. However, the blanket catch ( except Exception ) still gives me the required information, that there was no call made to update_loadbalancer_status ( as we saw, we got Exception [] )\nI think this would continue to work as the exception is helping me understand what is the actual call of events which should occur here. I am adding a comment here though, since that sounds logical to me","commit_id":"a5ec93511196e6d826251339d5a6141e9389a541"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"f41c577df06c4c5c9abb9b0110e397d5f9d00acb","unresolved":false,"context_lines":[{"line_number":223,"context_line":"                expected_calls, any_order\u003dTrue)"},{"line_number":224,"context_line":"        except Exception:"},{"line_number":225,"context_line":"            raise Exception("},{"line_number":226,"context_line":"                self._o_driver_lib.update_loadbalancer_status.mock_calls)"},{"line_number":227,"context_line":"        expected_lbs \u003d self._make_expected_lbs(lb_data)"},{"line_number":228,"context_line":"        # if \u0027lr_ref\u0027 not in expected_lbs[0][\u0027external_ids\u0027]:"},{"line_number":229,"context_line":"        #    self.assertEqual(str(expected_lbs[0][\u0027external_ids\u0027]), None)"}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_ecf10b03","line":226,"updated":"2019-02-22 14:00:33.000000000","message":"We can remove this try..exception no ? Let it bubble up with the normal message from the assertion method","commit_id":"a5ec93511196e6d826251339d5a6141e9389a541"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a8be5e7def08ed793561905ddf85a14080356b0c","unresolved":false,"context_lines":[{"line_number":223,"context_line":"                expected_calls, any_order\u003dTrue)"},{"line_number":224,"context_line":"        except Exception:"},{"line_number":225,"context_line":"            raise Exception("},{"line_number":226,"context_line":"                self._o_driver_lib.update_loadbalancer_status.mock_calls)"},{"line_number":227,"context_line":"        expected_lbs \u003d self._make_expected_lbs(lb_data)"},{"line_number":228,"context_line":"        # if \u0027lr_ref\u0027 not in expected_lbs[0][\u0027external_ids\u0027]:"},{"line_number":229,"context_line":"        #    self.assertEqual(str(expected_lbs[0][\u0027external_ids\u0027]), None)"}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_4826e818","line":226,"in_reply_to":"9fdfeff1_ecf10b03","updated":"2019-02-25 08:06:06.000000000","message":"The exception here is giving me the message as to what calls are actually being made. I can remove the try/expect but this gives me a detailed information for my functional test and would be useful for anyone else who starts working on it after I am done with it :D\n\nThe normal assertion method wont return me the extra information of the call which is happening actually","commit_id":"a5ec93511196e6d826251339d5a6141e9389a541"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"badc04a535455fe42e00ed26d080c82f7bdc9c19","unresolved":false,"context_lines":[{"line_number":225,"context_line":"            raise Exception("},{"line_number":226,"context_line":"                self._o_driver_lib.update_loadbalancer_status.mock_calls)"},{"line_number":227,"context_line":"        expected_lbs \u003d self._make_expected_lbs(lb_data)"},{"line_number":228,"context_line":"        # if \u0027lr_ref\u0027 not in expected_lbs[0][\u0027external_ids\u0027]:"},{"line_number":229,"context_line":"        #    self.assertEqual(str(expected_lbs[0][\u0027external_ids\u0027]), None)"},{"line_number":230,"context_line":"        self._validate_loadbalancers(expected_lbs)"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def _create_load_balancer_and_validate(self, lb_info,"}],"source_content_type":"text/x-python","patch_set":42,"id":"9fdfeff1_67b69bdf","line":229,"range":{"start_line":228,"start_character":0,"end_line":229,"end_character":73},"updated":"2019-02-22 10:19:19.000000000","message":":)","commit_id":"a5ec93511196e6d826251339d5a6141e9389a541"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"21491dad4be0f83624086e37904b5baa84baddde","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        call_count \u003d len(expected_status)"},{"line_number":216,"context_line":"        expected_calls \u003d [mock.call(status) for status in expected_status]"},{"line_number":217,"context_line":"        # Remove this if it doesnt work"},{"line_number":218,"context_line":"        self._o_driver_lib.update_loadbalancer_status \u003d mock.Mock()"},{"line_number":219,"context_line":"        update_loadbalancer_status \u003d ("},{"line_number":220,"context_line":"            self._o_driver_lib.update_loadbalancer_status)"},{"line_number":221,"context_line":"        if not check_call:"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fdfeff1_43108601","line":218,"updated":"2019-03-02 05:19:43.000000000","message":"I don\u0027t think this is useful.","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"cc3def34e6f59d6f44807ad7ed0c17596919ea95","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        call_count \u003d len(expected_status)"},{"line_number":216,"context_line":"        expected_calls \u003d [mock.call(status) for status in expected_status]"},{"line_number":217,"context_line":"        # Remove this if it doesnt work"},{"line_number":218,"context_line":"        self._o_driver_lib.update_loadbalancer_status \u003d mock.Mock()"},{"line_number":219,"context_line":"        update_loadbalancer_status \u003d ("},{"line_number":220,"context_line":"            self._o_driver_lib.update_loadbalancer_status)"},{"line_number":221,"context_line":"        if not check_call:"}],"source_content_type":"text/x-python","patch_set":46,"id":"5fc1f717_84171352","line":218,"in_reply_to":"9fdfeff1_43108601","updated":"2019-03-08 12:40:36.000000000","message":"removed","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"21491dad4be0f83624086e37904b5baa84baddde","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        self._o_driver_lib.update_loadbalancer_status \u003d mock.Mock()"},{"line_number":219,"context_line":"        update_loadbalancer_status \u003d ("},{"line_number":220,"context_line":"            self._o_driver_lib.update_loadbalancer_status)"},{"line_number":221,"context_line":"        if not check_call:"},{"line_number":222,"context_line":"            expected_lbs \u003d self._make_expected_lbs(lb_data)"},{"line_number":223,"context_line":"            self._validate_loadbalancers(expected_lbs)"},{"line_number":224,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fdfeff1_c366b6bc","line":221,"updated":"2019-03-02 05:19:43.000000000","message":"Since the updates happen in another thread, not waiting for them here can cause breakage in test_lb_member_batch_update() since the update calls happen witch check_call\u003dFalse, which means that the updates can be picked up when we are doing the _wait_for_status_and_validate from the _delete_load_balancer_and_validate().\n\nReverting all changes to this test method make that test pass again, but some of the others still time out. I\u0027m still looking into those.","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"cc3def34e6f59d6f44807ad7ed0c17596919ea95","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        self._o_driver_lib.update_loadbalancer_status \u003d mock.Mock()"},{"line_number":219,"context_line":"        update_loadbalancer_status \u003d ("},{"line_number":220,"context_line":"            self._o_driver_lib.update_loadbalancer_status)"},{"line_number":221,"context_line":"        if not check_call:"},{"line_number":222,"context_line":"            expected_lbs \u003d self._make_expected_lbs(lb_data)"},{"line_number":223,"context_line":"            self._validate_loadbalancers(expected_lbs)"},{"line_number":224,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":46,"id":"5fc1f717_6446a77f","line":221,"in_reply_to":"9fdfeff1_c366b6bc","updated":"2019-03-08 12:40:36.000000000","message":"Yeah, sounds correct.I also tried it and facing the same issue. I added check_call because batch updates actually trigger multiple requests. One way, which I think is possible is to somehow clear the updates before _delete_loadbalanceR_and_validate comes into picture. What do you think?","commit_id":"af599f6bc11d4255ed9c98044862f04b1c2ebbd7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d11b7018692e9d6f00ea31b531711b0c637d3693","unresolved":false,"context_lines":[{"line_number":852,"context_line":"             \u0027cidr\u0027: \u002710.0.0.0/24\u0027})"},{"line_number":853,"context_line":"        self._create_net("},{"line_number":854,"context_line":"            \"N2\", \"10.0.1.0/24\", lba_data[ovn_driver.LB_EXT_IDS_LR_REF_KEY])"},{"line_number":855,"context_line":"        for nw in self.nb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":856,"context_line":"            if nw.name \u003d\u003d \u0027N2\u0027:"},{"line_number":857,"context_line":"                self.assertEqual(lba_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":858,"context_line":"                                 nw.load_balancer)"},{"line_number":859,"context_line":"                break"},{"line_number":860,"context_line":"        for router in self.nb_api.tables[\u0027Logical_Router\u0027].rows.values():"},{"line_number":861,"context_line":"            if router.uuid \u003d\u003d lba_data[ovn_driver.LB_EXT_IDS_LR_REF_KEY]:"},{"line_number":862,"context_line":"                self.assertEqual(lba_data[\u0027model\u0027].loadbalancer_id,"}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_9fe1ec9d","line":859,"range":{"start_line":855,"start_character":0,"end_line":859,"end_character":21},"updated":"2019-03-29 10:22:51.000000000","message":"n2 \u003d self.nb_api.ls_get(\u0027N2\u0027).execute()\nself.assertEqual(lba_data[...], n2.load_balancer)\n\nLess lines and we make sure that the assert will always run.","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d11b7018692e9d6f00ea31b531711b0c637d3693","unresolved":false,"context_lines":[{"line_number":857,"context_line":"                self.assertEqual(lba_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":858,"context_line":"                                 nw.load_balancer)"},{"line_number":859,"context_line":"                break"},{"line_number":860,"context_line":"        for router in self.nb_api.tables[\u0027Logical_Router\u0027].rows.values():"},{"line_number":861,"context_line":"            if router.uuid \u003d\u003d lba_data[ovn_driver.LB_EXT_IDS_LR_REF_KEY]:"},{"line_number":862,"context_line":"                self.assertEqual(lba_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":863,"context_line":"                                 router.load_balancer)"},{"line_number":864,"context_line":"                break"},{"line_number":865,"context_line":"        lbb_data \u003d self._create_load_balancer_and_validate("},{"line_number":866,"context_line":"            {\u0027vip_network\u0027: \u0027N3\u0027,"},{"line_number":867,"context_line":"             \u0027cidr\u0027: \u002710.0.2.0/24\u0027}, create_router\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_9ffa4c40","line":864,"range":{"start_line":860,"start_character":0,"end_line":864,"end_character":21},"updated":"2019-03-29 10:22:51.000000000","message":"ditto:\n\nr1 \u003d self.nb_api.lr_get(lba_data[ovn_driver.LB_EXT_IDS_LR_REF_KEY]).execute()\nself.assertEqual(lba_data[...], r1.load_balancer)\n\nLess lines and we make sure that the assert will always run.","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d11b7018692e9d6f00ea31b531711b0c637d3693","unresolved":false,"context_lines":[{"line_number":869,"context_line":"            self.context, lba_data[ovn_driver.LB_EXT_IDS_LR_REF_KEY],"},{"line_number":870,"context_line":"            {\u0027subnet_id\u0027: lbb_data[\u0027vip_net_info\u0027][1]})"},{"line_number":871,"context_line":"        # N3 added to R1"},{"line_number":872,"context_line":"        for nw in self.nb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":873,"context_line":"            if nw.name \u003d\u003d \u0027N3\u0027:"},{"line_number":874,"context_line":"                self.assertEqual(lba_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":875,"context_line":"                                 nw.load_balancer)"},{"line_number":876,"context_line":"                break"},{"line_number":877,"context_line":"        for nw in self.nb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":878,"context_line":"            if nw.name \u003d\u003d \u0027N1\u0027:"},{"line_number":879,"context_line":"                self.assertEqual(lbb_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":880,"context_line":"                                 nw.load_balancer)"},{"line_number":881,"context_line":"                break"},{"line_number":882,"context_line":"        for nw in self.nb_api.tables[\u0027Logical_Switch\u0027].rows.values():"},{"line_number":883,"context_line":"            if nw.name \u003d\u003d \u0027N2\u0027:"},{"line_number":884,"context_line":"                self.assertEqual(lbb_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":885,"context_line":"                                 nw.load_balancer)"},{"line_number":886,"context_line":"                break"},{"line_number":887,"context_line":"        for router in self.nb_api.tables[\u0027Logical_Router\u0027].rows.values():"},{"line_number":888,"context_line":"            if router.uuid \u003d\u003d lba_data[ovn_driver.LB_EXT_IDS_LR_REF_KEY]:"},{"line_number":889,"context_line":"                self.assertEqual(lbb_data[\u0027model\u0027].loadbalancer_id,"}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_7f99a01c","line":886,"range":{"start_line":872,"start_character":0,"end_line":886,"end_character":21},"updated":"2019-03-29 10:22:51.000000000","message":"ditto ls_get()","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d11b7018692e9d6f00ea31b531711b0c637d3693","unresolved":false,"context_lines":[{"line_number":884,"context_line":"                self.assertEqual(lbb_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":885,"context_line":"                                 nw.load_balancer)"},{"line_number":886,"context_line":"                break"},{"line_number":887,"context_line":"        for router in self.nb_api.tables[\u0027Logical_Router\u0027].rows.values():"},{"line_number":888,"context_line":"            if router.uuid \u003d\u003d lba_data[ovn_driver.LB_EXT_IDS_LR_REF_KEY]:"},{"line_number":889,"context_line":"                self.assertEqual(lbb_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":890,"context_line":"                                 router.load_balancer)"},{"line_number":891,"context_line":"                break"},{"line_number":892,"context_line":"        # N3 removed from R1"},{"line_number":893,"context_line":"        self.l3_plugin.remove_router_interface("},{"line_number":894,"context_line":"            self.context, lba_data[ovn_driver.LB_EXT_IDS_LR_REF_KEY],"}],"source_content_type":"text/x-python","patch_set":54,"id":"5fc1f717_7fc200eb","line":891,"range":{"start_line":887,"start_character":0,"end_line":891,"end_character":21},"updated":"2019-03-29 10:22:51.000000000","message":"ditto lr_get()","commit_id":"e232124570fb335dd2dab5c4a0299eecec866d38"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"673c0f642b684cba2092318b80c8a97b64b0fd39","unresolved":false,"context_lines":[{"line_number":211,"context_line":"            if check_call:"},{"line_number":212,"context_line":"                self._o_driver_lib.update_loadbalancer_status.assert_has_calls("},{"line_number":213,"context_line":"                    expected_calls, any_order\u003dTrue)"},{"line_number":214,"context_line":"        except Exception:"},{"line_number":215,"context_line":"            raise Exception("},{"line_number":216,"context_line":"                self._o_driver_lib.update_loadbalancer_status.mock_calls)"},{"line_number":217,"context_line":"        expected_lbs \u003d self._make_expected_lbs(lb_data)"}],"source_content_type":"text/x-python","patch_set":58,"id":"5fc1f717_3d3ea4b9","line":214,"updated":"2019-04-01 12:53:26.000000000","message":"Can be removed !","commit_id":"c5734ce39bd8e20b994067e55438435a5dd0705d"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"39a04256f0e3876d2146c7e4bac1c711b24a9b6d","unresolved":false,"context_lines":[{"line_number":211,"context_line":"            if check_call:"},{"line_number":212,"context_line":"                self._o_driver_lib.update_loadbalancer_status.assert_has_calls("},{"line_number":213,"context_line":"                    expected_calls, any_order\u003dTrue)"},{"line_number":214,"context_line":"        except Exception:"},{"line_number":215,"context_line":"            raise Exception("},{"line_number":216,"context_line":"                self._o_driver_lib.update_loadbalancer_status.mock_calls)"},{"line_number":217,"context_line":"        expected_lbs \u003d self._make_expected_lbs(lb_data)"},{"line_number":218,"context_line":"        self._validate_loadbalancers(expected_lbs)"},{"line_number":219,"context_line":""}],"source_content_type":"text/x-python","patch_set":58,"id":"5fc1f717_7ddaec4b","line":216,"range":{"start_line":214,"start_character":0,"end_line":216,"end_character":73},"updated":"2019-04-01 12:48:55.000000000","message":"This is for you to debug in the gate?","commit_id":"c5734ce39bd8e20b994067e55438435a5dd0705d"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"673c0f642b684cba2092318b80c8a97b64b0fd39","unresolved":false,"context_lines":[{"line_number":211,"context_line":"            if check_call:"},{"line_number":212,"context_line":"                self._o_driver_lib.update_loadbalancer_status.assert_has_calls("},{"line_number":213,"context_line":"                    expected_calls, any_order\u003dTrue)"},{"line_number":214,"context_line":"        except Exception:"},{"line_number":215,"context_line":"            raise Exception("},{"line_number":216,"context_line":"                self._o_driver_lib.update_loadbalancer_status.mock_calls)"},{"line_number":217,"context_line":"        expected_lbs \u003d self._make_expected_lbs(lb_data)"},{"line_number":218,"context_line":"        self._validate_loadbalancers(expected_lbs)"},{"line_number":219,"context_line":""}],"source_content_type":"text/x-python","patch_set":58,"id":"5fc1f717_9db478d3","line":216,"range":{"start_line":214,"start_character":0,"end_line":216,"end_character":73},"in_reply_to":"5fc1f717_7ddaec4b","updated":"2019-04-01 12:53:26.000000000","message":"Yeah, this can be removed","commit_id":"c5734ce39bd8e20b994067e55438435a5dd0705d"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"bd0e38d1f35374ecf81d46f5ba6490556082c516","unresolved":false,"context_lines":[{"line_number":231,"context_line":"            if check_call:"},{"line_number":232,"context_line":"                self._o_driver_lib.update_loadbalancer_status.assert_has_calls("},{"line_number":233,"context_line":"                    expected_calls, any_order\u003dTrue)"},{"line_number":234,"context_line":"        except Exception:"},{"line_number":235,"context_line":"            raise Exception("},{"line_number":236,"context_line":"                self._o_driver_lib.update_loadbalancer_status.mock_calls)"},{"line_number":237,"context_line":"        expected_lbs \u003d self._make_expected_lbs(lb_data)"},{"line_number":238,"context_line":"        self._validate_loadbalancers(expected_lbs)"},{"line_number":239,"context_line":""}],"source_content_type":"text/x-python","patch_set":59,"id":"3fce034c_90e422ae","line":236,"range":{"start_line":234,"start_character":4,"end_line":236,"end_character":73},"updated":"2019-04-16 06:21:54.000000000","message":"This is still pending in the code. I missed out on this. Will fix it in the next patchset, once I get reviews from everyone","commit_id":"104421ad61b9abc3288533c995655f4812b70a5d"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"c01aea68358d95b6ad1a17c219f2a6e33b923d67","unresolved":false,"context_lines":[{"line_number":231,"context_line":"            if check_call:"},{"line_number":232,"context_line":"                self._o_driver_lib.update_loadbalancer_status.assert_has_calls("},{"line_number":233,"context_line":"                    expected_calls, any_order\u003dTrue)"},{"line_number":234,"context_line":"        except Exception:"},{"line_number":235,"context_line":"            raise Exception("},{"line_number":236,"context_line":"                self._o_driver_lib.update_loadbalancer_status.mock_calls)"},{"line_number":237,"context_line":"        expected_lbs \u003d self._make_expected_lbs(lb_data)"},{"line_number":238,"context_line":"        self._validate_loadbalancers(expected_lbs)"},{"line_number":239,"context_line":""}],"source_content_type":"text/x-python","patch_set":59,"id":"3fce034c_9df421d1","line":236,"range":{"start_line":234,"start_character":4,"end_line":236,"end_character":73},"in_reply_to":"3fce034c_90e422ae","updated":"2019-04-17 06:24:36.000000000","message":"Done","commit_id":"104421ad61b9abc3288533c995655f4812b70a5d"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"9db6ba3931bc76c214309ed3002eecb719c2e0ac","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            delete_port.return_value \u003d True"},{"line_number":51,"context_line":"        self._local_net_cache \u003d {}"},{"line_number":52,"context_line":"        self._local_port_cache \u003d {\u0027ports\u0027: []}"},{"line_number":53,"context_line":"        self.lb_count \u003d None   # useful for Multiple LB scenarios"},{"line_number":54,"context_line":"        self.addCleanup(self.ovn_driver._ovn_helper.shutdown)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def _mock_get_subnet(self, subnet_id):"}],"source_content_type":"text/x-python","patch_set":61,"id":"ffb9cba7_fee25b2f","line":53,"range":{"start_line":53,"start_character":8,"end_line":53,"end_character":30},"updated":"2019-04-23 02:55:05.000000000","message":"not used anywhere","commit_id":"134f79b217c12053a51af9a2564b73d0b14cfe71"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"42943b70771dc0ca6440e2ad52b6b9d81ea569ca","unresolved":false,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _validate_loadbalancers(self, expected_lbs):"},{"line_number":151,"context_line":"        observed_lbs \u003d self._get_loadbalancers()"},{"line_number":152,"context_line":"        if len(observed_lbs) \u003e 1:"},{"line_number":153,"context_line":"            for lb in observed_lbs:"},{"line_number":154,"context_line":"                if lb[\u0027name\u0027] \u003d\u003d expected_lbs[0][\u0027name\u0027]:"},{"line_number":155,"context_line":"                    self.assertItemsEqual(expected_lbs[0], lb)"},{"line_number":156,"context_line":"        else:"},{"line_number":157,"context_line":"            self.assertItemsEqual(expected_lbs, observed_lbs)"}],"source_content_type":"text/x-python","patch_set":66,"id":"bfb3d3c7_4c4a6fac","line":154,"range":{"start_line":152,"start_character":0,"end_line":154,"end_character":57},"updated":"2019-05-24 10:29:05.000000000","message":"I think it\u0027s a bit strange to pass a list of expected load balancers but create conditionals that *may* only test a subset of it ?\n\nSince all tests run in a controlled environment I expect assert\u0027s to be assertive.\n\nIs this change really needed ?","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"53f90b6c42ed09a91280ac55fdbecab1a948c705","unresolved":false,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _validate_loadbalancers(self, expected_lbs):"},{"line_number":151,"context_line":"        observed_lbs \u003d self._get_loadbalancers()"},{"line_number":152,"context_line":"        if len(observed_lbs) \u003e 1:"},{"line_number":153,"context_line":"            for lb in observed_lbs:"},{"line_number":154,"context_line":"                if lb[\u0027name\u0027] \u003d\u003d expected_lbs[0][\u0027name\u0027]:"},{"line_number":155,"context_line":"                    self.assertItemsEqual(expected_lbs[0], lb)"},{"line_number":156,"context_line":"        else:"},{"line_number":157,"context_line":"            self.assertItemsEqual(expected_lbs, observed_lbs)"}],"source_content_type":"text/x-python","patch_set":66,"id":"bfb3d3c7_51389f9e","line":154,"range":{"start_line":152,"start_character":0,"end_line":154,"end_character":57},"in_reply_to":"bfb3d3c7_3364284a","updated":"2019-05-28 09:56:17.000000000","message":"Hmm...\n\nBut wouldn\u0027t be better to assert the before and after ? For example:\n\n expected_lbs \u003d [LB1, LB2]\n self._validate_loadbalancers(expected_lbs)\n \u003c... code to delete LB2 ...\u003e\n expected_lbs \u003d [LB1]\n self._validate_loadbalancers(expected_lbs)\n\nWouldn\u0027t that work ?\n\nSorry to be picky on this but it\u0027s just that I really don\u0027t like the idea of tests having conditionals like that for a couple of reasons:\n\n1. The test environment is controller therefore we can be very assertive when validating things. We know exactly what to expect.\n\n2. When exploring a feature/code I don\u0027t know, I usually look at tests to see how it works\n\n3. These conditionals may allow for bugs to sneak in the code without us noticing it. For example, what if _get_loadbalancers() returned an extra LB that wasn\u0027t expected ? The validation would still pass because the name wouldn\u0027t match with the one in \"expected_lbs\".","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"6f8e86ba9bd0094b9e21ef21a433d74a7c4d0316","unresolved":false,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _validate_loadbalancers(self, expected_lbs):"},{"line_number":151,"context_line":"        observed_lbs \u003d self._get_loadbalancers()"},{"line_number":152,"context_line":"        if len(observed_lbs) \u003e 1:"},{"line_number":153,"context_line":"            for lb in observed_lbs:"},{"line_number":154,"context_line":"                if lb[\u0027name\u0027] \u003d\u003d expected_lbs[0][\u0027name\u0027]:"},{"line_number":155,"context_line":"                    self.assertItemsEqual(expected_lbs[0], lb)"},{"line_number":156,"context_line":"        else:"},{"line_number":157,"context_line":"            self.assertItemsEqual(expected_lbs, observed_lbs)"}],"source_content_type":"text/x-python","patch_set":66,"id":"bfb3d3c7_3364284a","line":154,"range":{"start_line":152,"start_character":0,"end_line":154,"end_character":57},"in_reply_to":"bfb3d3c7_4c4a6fac","updated":"2019-05-25 12:31:53.000000000","message":"For scenarios where only one LB exists,  we would have [] as the output when an LB is deleted. But I had to add this change to handle multiple loadbalancers.\nSee, if the systems have 2 Loadbalancers , [LB1, LB2], and we delete LB2, then system will always have [LB1]. \nNow I needed to check if LB2 is removed or not, thats why I had to add the minimum change without modifying the function completely, trying not to repeat myself.\n\nWe can discuss more on it on the IRC on Monday","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"27d12af92ac3f912022d07d0af3ef540045f970f","unresolved":false,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _validate_loadbalancers(self, expected_lbs):"},{"line_number":151,"context_line":"        observed_lbs \u003d self._get_loadbalancers()"},{"line_number":152,"context_line":"        if len(observed_lbs) \u003e 1:"},{"line_number":153,"context_line":"            for lb in observed_lbs:"},{"line_number":154,"context_line":"                if lb[\u0027name\u0027] \u003d\u003d expected_lbs[0][\u0027name\u0027]:"},{"line_number":155,"context_line":"                    self.assertItemsEqual(expected_lbs[0], lb)"},{"line_number":156,"context_line":"        else:"},{"line_number":157,"context_line":"            self.assertItemsEqual(expected_lbs, observed_lbs)"}],"source_content_type":"text/x-python","patch_set":66,"id":"bfb3d3c7_51965ff2","line":154,"range":{"start_line":152,"start_character":0,"end_line":154,"end_character":57},"in_reply_to":"bfb3d3c7_51389f9e","updated":"2019-05-28 10:50:13.000000000","message":"I was thinking about it, and this can be done only for the multiple LB scenarios","commit_id":"5a6bb109dfe3b18f0b9c861f526d7a7a1485b477"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"f215ccd9f857112834bcb6e41ad9e3681cd5f355","unresolved":false,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _validate_loadbalancers(self, expected_lbs):"},{"line_number":151,"context_line":"        observed_lbs \u003d self._get_loadbalancers()"},{"line_number":152,"context_line":"        if len(observed_lbs) \u003e 1:"},{"line_number":153,"context_line":"            for lb in observed_lbs:"},{"line_number":154,"context_line":"                if lb[\u0027name\u0027] \u003d\u003d expected_lbs[0][\u0027name\u0027]:"},{"line_number":155,"context_line":"                    self.assertItemsEqual(expected_lbs[0], lb)"},{"line_number":156,"context_line":"        else:"},{"line_number":157,"context_line":"            self.assertItemsEqual(expected_lbs, observed_lbs)"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_312acb2b","line":155,"range":{"start_line":152,"start_character":0,"end_line":155,"end_character":62},"updated":"2019-05-28 10:04:26.000000000","message":"See reply on the previous patch set","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"f215ccd9f857112834bcb6e41ad9e3681cd5f355","unresolved":false,"context_lines":[{"line_number":327,"context_line":"        del lb_data[\u0027model\u0027]"},{"line_number":328,"context_line":"        try:"},{"line_number":329,"context_line":"            self._wait_for_status_and_validate(lb_data, [expected_status])"},{"line_number":330,"context_line":"        except AssertionError as exc:"},{"line_number":331,"context_line":"            if not multiple_lb:"},{"line_number":332,"context_line":"                # In multiple loadbalancers, the expected_lb \u003d []"},{"line_number":333,"context_line":"                # but in actual OVN NB DB, another LB can exist"},{"line_number":334,"context_line":"                raise AssertionError(exc.message)"},{"line_number":335,"context_line":"            else:"},{"line_number":336,"context_line":"                lb_name \u003d [lbs[\u0027name\u0027] for lbs in self._get_loadbalancers()]"},{"line_number":337,"context_line":"                self.assertNotIn(name, lb_name)"},{"line_number":338,"context_line":"        vip_net_id \u003d lb_data[\u0027vip_net_info\u0027][0]"},{"line_number":339,"context_line":"        self.assertFalse("},{"line_number":340,"context_line":"            self._is_lb_associated_to_ls(lb.loadbalancer_id,"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_31adeb9a","line":337,"range":{"start_line":330,"start_character":0,"end_line":337,"end_character":47},"updated":"2019-05-28 10:04:26.000000000","message":"This is related to the same problem in _validate_loadbalancers(). I don\u0027t think we should do this.\n\nI understand the fact that we want to reuse code, but the cost of making it less assertive on tests is too high. I would rather have explicit assert\u0027s for each case than a confusing validating method. Why not:\n\n if not multiple_lb:\n     self._wait_for_status_and_validate(lb_data, [expected_status])\n else:\n    lb_names \u003d [lbs[\u0027name\u0027] for lbs in  self._get_loadbalancers()]\n    self.assertNotIn(lb_data[\u0027model\u0027].loadbalancer_id, lb_names)","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"27d12af92ac3f912022d07d0af3ef540045f970f","unresolved":false,"context_lines":[{"line_number":327,"context_line":"        del lb_data[\u0027model\u0027]"},{"line_number":328,"context_line":"        try:"},{"line_number":329,"context_line":"            self._wait_for_status_and_validate(lb_data, [expected_status])"},{"line_number":330,"context_line":"        except AssertionError as exc:"},{"line_number":331,"context_line":"            if not multiple_lb:"},{"line_number":332,"context_line":"                # In multiple loadbalancers, the expected_lb \u003d []"},{"line_number":333,"context_line":"                # but in actual OVN NB DB, another LB can exist"},{"line_number":334,"context_line":"                raise AssertionError(exc.message)"},{"line_number":335,"context_line":"            else:"},{"line_number":336,"context_line":"                lb_name \u003d [lbs[\u0027name\u0027] for lbs in self._get_loadbalancers()]"},{"line_number":337,"context_line":"                self.assertNotIn(name, lb_name)"},{"line_number":338,"context_line":"        vip_net_id \u003d lb_data[\u0027vip_net_info\u0027][0]"},{"line_number":339,"context_line":"        self.assertFalse("},{"line_number":340,"context_line":"            self._is_lb_associated_to_ls(lb.loadbalancer_id,"}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_b17a3bb7","line":337,"range":{"start_line":330,"start_character":0,"end_line":337,"end_character":47},"in_reply_to":"bfb3d3c7_31adeb9a","updated":"2019-05-28 10:50:13.000000000","message":"The problem is , without waiting for status and validation, the AssertionError wont be raised.\nI have broken up wait_for_status_and_validate since its not exactly atomic in nature ( doing 2 things one after the other, waiting for status and then validation ).\nSince it makes more sense to break it , since we have a scenario where it would be used ( multiple LB deletion ) , therefore I have done it.","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"f215ccd9f857112834bcb6e41ad9e3681cd5f355","unresolved":false,"context_lines":[{"line_number":853,"context_line":"        self._test_cascade_delete(member\u003dFalse, listener\u003dFalse)"},{"line_number":854,"context_line":""},{"line_number":855,"context_line":"    def test_lb_listener_pools_cascade(self):"},{"line_number":856,"context_line":"        self._test_cascade_delete(member\u003dFalse)"},{"line_number":857,"context_line":""},{"line_number":858,"context_line":"    def test_for_unsupported_options(self):"},{"line_number":859,"context_line":"        lb_data \u003d self._create_load_balancer_and_validate("}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_9174d737","line":856,"updated":"2019-05-28 10:04:26.000000000","message":"nit: no reason to invert the order of these methods ?","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"27d12af92ac3f912022d07d0af3ef540045f970f","unresolved":false,"context_lines":[{"line_number":853,"context_line":"        self._test_cascade_delete(member\u003dFalse, listener\u003dFalse)"},{"line_number":854,"context_line":""},{"line_number":855,"context_line":"    def test_lb_listener_pools_cascade(self):"},{"line_number":856,"context_line":"        self._test_cascade_delete(member\u003dFalse)"},{"line_number":857,"context_line":""},{"line_number":858,"context_line":"    def test_for_unsupported_options(self):"},{"line_number":859,"context_line":"        lb_data \u003d self._create_load_balancer_and_validate("}],"source_content_type":"text/x-python","patch_set":67,"id":"bfb3d3c7_91e1379e","line":856,"in_reply_to":"bfb3d3c7_9174d737","updated":"2019-05-28 10:50:13.000000000","message":"Nope!","commit_id":"7cb89d5b234ff00d940255a4fda487a114009fb6"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"dc83732477e6eab94de775dcc7922f7fb1d40b92","unresolved":false,"context_lines":[{"line_number":923,"context_line":"        nw_info \u003d self._create_net(\"N2\", \"10.0.1.0/24\", router_id)"},{"line_number":924,"context_line":"        self.assertTrue("},{"line_number":925,"context_line":"            self._is_lb_associated_to_ls(lba_data[\u0027model\u0027].loadbalancer_id,"},{"line_number":926,"context_line":"                                         \u0027neutron-\u0027 + nw_info[0]))"},{"line_number":927,"context_line":"        lbb_data \u003d self._create_load_balancer_and_validate("},{"line_number":928,"context_line":"            {\u0027vip_network\u0027: \u0027N3\u0027,"},{"line_number":929,"context_line":"             \u0027cidr\u0027: \u002710.0.2.0/24\u0027}, create_router\u003dFalse, multiple_lb\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_f4830a03","line":926,"range":{"start_line":926,"start_character":41,"end_line":926,"end_character":51},"updated":"2019-06-21 13:32:50.000000000","message":"nit: you added LR_REF_KEY_HEADER above","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"cc6fc01199477fd3ab6e19878bb5c65da0b957f8","unresolved":false,"context_lines":[{"line_number":986,"context_line":"    def test_event_handler_with_loadbalancer_cascade_delete(self):"},{"line_number":987,"context_line":"        self._test_event_handler(cascade\u003dTrue)"},{"line_number":988,"context_line":""},{"line_number":989,"context_line":"    def test_event_handler_lrp_with_external_gateway(self):"},{"line_number":990,"context_line":"        # TODO(mjozefcz): Write this test."},{"line_number":991,"context_line":"        pass"},{"line_number":992,"context_line":""}],"source_content_type":"text/x-python","patch_set":82,"id":"9fb8cfa7_5c4c389d","line":989,"updated":"2019-06-26 15:06:35.000000000","message":"This is missing scenario that we need to add. @numans found it","commit_id":"3f4f7c74a978b40b0524af21b2223d015d104e61"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"602bfe90d984a3f24b29e008ecb37006b5e560a2","unresolved":false,"context_lines":[{"line_number":963,"context_line":"            # Delete LBB Cascade"},{"line_number":964,"context_line":"            self._delete_load_balancer_and_validate(lbb_data, cascade\u003dTrue,"},{"line_number":965,"context_line":"                                                    multiple_lb\u003dTrue)"},{"line_number":966,"context_line":"        # TODO(mjozefcz): Fix this.."},{"line_number":967,"context_line":"        time.sleep(1)"},{"line_number":968,"context_line":""},{"line_number":969,"context_line":"        # Check LBB exists on R1"},{"line_number":970,"context_line":"        self.assertFalse("}],"source_content_type":"text/x-python","patch_set":83,"id":"9fb8cfa7_2456fd5d","line":967,"range":{"start_line":966,"start_character":0,"end_line":967,"end_character":21},"updated":"2019-06-27 10:45:48.000000000","message":"why?\nIs there anything wrong with the cascade delete code?","commit_id":"e23030d19d0954e16edb971a821a2b228cb8ca55"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"99fcab722acb2fe4bdfd7e88d104f7938621dde9","unresolved":false,"context_lines":[{"line_number":963,"context_line":"            # Delete LBB Cascade"},{"line_number":964,"context_line":"            self._delete_load_balancer_and_validate(lbb_data, cascade\u003dTrue,"},{"line_number":965,"context_line":"                                                    multiple_lb\u003dTrue)"},{"line_number":966,"context_line":"        # TODO(mjozefcz): Fix this.."},{"line_number":967,"context_line":"        time.sleep(1)"},{"line_number":968,"context_line":""},{"line_number":969,"context_line":"        # Check LBB exists on R1"},{"line_number":970,"context_line":"        self.assertFalse("}],"source_content_type":"text/x-python","patch_set":83,"id":"9fb8cfa7_5d6c20cf","line":967,"range":{"start_line":966,"start_character":0,"end_line":967,"end_character":21},"in_reply_to":"9fb8cfa7_2456fd5d","updated":"2019-06-27 12:28:36.000000000","message":"Nope, code itself is ok :) I noticed that when I moved the event handling functions to other thread it ends with some random failures. I\u0027ve added this sleep here to not forget about checking why and fixing this.","commit_id":"e23030d19d0954e16edb971a821a2b228cb8ca55"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"602bfe90d984a3f24b29e008ecb37006b5e560a2","unresolved":false,"context_lines":[{"line_number":979,"context_line":"                lbb_id, LR_REF_KEY_HEADER + nw_info[0]))"},{"line_number":980,"context_line":""},{"line_number":981,"context_line":"    def test_event_handler_with_interface_delete(self):"},{"line_number":982,"context_line":"        # NOTE(mjozefcz): It sometime fails, with sleep works well."},{"line_number":983,"context_line":"        # Check why..."},{"line_number":984,"context_line":"        self._test_event_handler()"},{"line_number":985,"context_line":""},{"line_number":986,"context_line":"    def test_event_handler_with_loadbalancer_cascade_delete(self):"}],"source_content_type":"text/x-python","patch_set":83,"id":"9fb8cfa7_e4f9c54d","line":983,"range":{"start_line":982,"start_character":0,"end_line":983,"end_character":22},"updated":"2019-06-27 10:45:48.000000000","message":"It might be because of the request being sent to the octavia db. 1 sec sleep is large enough for the CPU to undertake multiple operations. There might be some change required on the eventhandler code for this","commit_id":"e23030d19d0954e16edb971a821a2b228cb8ca55"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"99fcab722acb2fe4bdfd7e88d104f7938621dde9","unresolved":false,"context_lines":[{"line_number":979,"context_line":"                lbb_id, LR_REF_KEY_HEADER + nw_info[0]))"},{"line_number":980,"context_line":""},{"line_number":981,"context_line":"    def test_event_handler_with_interface_delete(self):"},{"line_number":982,"context_line":"        # NOTE(mjozefcz): It sometime fails, with sleep works well."},{"line_number":983,"context_line":"        # Check why..."},{"line_number":984,"context_line":"        self._test_event_handler()"},{"line_number":985,"context_line":""},{"line_number":986,"context_line":"    def test_event_handler_with_loadbalancer_cascade_delete(self):"}],"source_content_type":"text/x-python","patch_set":83,"id":"9fb8cfa7_9d9b78c7","line":983,"range":{"start_line":982,"start_character":0,"end_line":983,"end_character":22},"in_reply_to":"9fb8cfa7_e4f9c54d","updated":"2019-06-27 12:28:36.000000000","message":"Yes, I added this sleep to make test pass. We need to check why it fails. Looks like test is little bit faster.","commit_id":"e23030d19d0954e16edb971a821a2b228cb8ca55"}],"networking_ovn/tests/unit/octavia/test_ovn_driver.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"dc83732477e6eab94de775dcc7922f7fb1d40b92","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            member_id\u003dself.member_id,"},{"line_number":81,"context_line":"            monitor_address\u003d\"100.200.200.100\","},{"line_number":82,"context_line":"            monitor_port\u003d66,"},{"line_number":83,"context_line":"            name\u003d\u0027Amazin\u0027,"},{"line_number":84,"context_line":"            pool_id\u003dself.pool_id,"},{"line_number":85,"context_line":"            protocol_port\u003d99,"},{"line_number":86,"context_line":"            subnet_id\u003dself.member_subnet_id,"}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_d49da657","line":83,"range":{"start_line":83,"start_character":18,"end_line":83,"end_character":24},"updated":"2019-06-21 13:32:50.000000000","message":"I can\u0027t tell if this and L105 were supposed to be \u0027Amazing\u0027 too, probably doesn\u0027t matter...","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"774a6ae131605f4b66853ba91b80651e98887e83","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            member_id\u003dself.member_id,"},{"line_number":81,"context_line":"            monitor_address\u003d\"100.200.200.100\","},{"line_number":82,"context_line":"            monitor_port\u003d66,"},{"line_number":83,"context_line":"            name\u003d\u0027Amazin\u0027,"},{"line_number":84,"context_line":"            pool_id\u003dself.pool_id,"},{"line_number":85,"context_line":"            protocol_port\u003d99,"},{"line_number":86,"context_line":"            subnet_id\u003dself.member_subnet_id,"}],"source_content_type":"text/x-python","patch_set":79,"id":"9fb8cfa7_bef48488","line":83,"range":{"start_line":83,"start_character":18,"end_line":83,"end_character":24},"in_reply_to":"9fb8cfa7_d49da657","updated":"2019-06-24 06:57:37.000000000","message":"intentional :)","commit_id":"c28f43d419e4495a4b22d90afefab088f044fb20"}]}
