)]}'
{"networking_ovn/ovn_db_sync.py":[{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"98b786e0978419326816d702824d6607556ebb3a","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                  len(add_pgs), len(remove_pgs))"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        if self.mode \u003d\u003d SYNC_MODE_REPAIR:"},{"line_number":200,"context_line":"            LOG.debug(\u0027Port-Group-SYNC: transaction started @ %s\u0027 %"},{"line_number":201,"context_line":"                      str(datetime.now()))"},{"line_number":202,"context_line":"            if add_pgs:"},{"line_number":203,"context_line":"                db_ports \u003d self.core_plugin.get_ports(ctx)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_cc65cce2","line":200,"range":{"start_line":200,"start_character":66,"end_line":200,"end_character":67},"updated":"2018-09-06 17:00:19.000000000","message":"comma","commit_id":"7327b9fe028532c0305567f62f447331f5996a08"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"98b786e0978419326816d702824d6607556ebb3a","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                                pg, n_port[\u0027id\u0027]))"},{"line_number":226,"context_line":"                for pg in remove_pgs:"},{"line_number":227,"context_line":"                    txn.add(self.ovn_api.pg_del(pg))"},{"line_number":228,"context_line":"                # Add the corresponding ports to the newly created"},{"line_number":229,"context_line":"            LOG.debug(\u0027Port-Group-SYNC: transaction finished @ %s\u0027 %"},{"line_number":230,"context_line":"                      str(datetime.now()))"},{"line_number":231,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_4c7a1c88","line":228,"range":{"start_line":228,"start_character":16,"end_line":228,"end_character":66},"updated":"2018-09-06 17:00:19.000000000","message":"leftover","commit_id":"7327b9fe028532c0305567f62f447331f5996a08"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"98b786e0978419326816d702824d6607556ebb3a","unresolved":false,"context_lines":[{"line_number":226,"context_line":"                for pg in remove_pgs:"},{"line_number":227,"context_line":"                    txn.add(self.ovn_api.pg_del(pg))"},{"line_number":228,"context_line":"                # Add the corresponding ports to the newly created"},{"line_number":229,"context_line":"            LOG.debug(\u0027Port-Group-SYNC: transaction finished @ %s\u0027 %"},{"line_number":230,"context_line":"                      str(datetime.now()))"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def sync_address_sets(self, ctx):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_ac6ad0af","line":229,"range":{"start_line":229,"start_character":66,"end_line":229,"end_character":68},"updated":"2018-09-06 17:00:19.000000000","message":"this should be a comma. Note for other occurrences in this module :)","commit_id":"7327b9fe028532c0305567f62f447331f5996a08"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"945966b5250c19d6d01e3aa9204fd03e9a7f01d6","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        self.sync_address_sets(ctx)"},{"line_number":91,"context_line":"        self.sync_port_groups(ctx)"},{"line_number":92,"context_line":"        self.sync_networks_ports_and_dhcp_opts(ctx)"},{"line_number":93,"context_line":"        self.sync_port_dns_records(ctx)"},{"line_number":94,"context_line":"        self.sync_acls(ctx)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_5297359d","line":91,"updated":"2018-10-12 10:55:54.000000000","message":"This method should run after  self.sync_networks_ports_and_dhcp_opts(ctx)\n\nBecause otherwise it could try to add a port that does not yet exist in OVN NB DB to a port group and it will fail.","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"c12fb26966ab0e1f085bcbaf517ce6f572a8fea0","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        self.sync_address_sets(ctx)"},{"line_number":91,"context_line":"        self.sync_port_groups(ctx)"},{"line_number":92,"context_line":"        self.sync_networks_ports_and_dhcp_opts(ctx)"},{"line_number":93,"context_line":"        self.sync_port_dns_records(ctx)"},{"line_number":94,"context_line":"        self.sync_acls(ctx)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_e9075a6f","line":91,"in_reply_to":"3f79a3b5_5297359d","updated":"2018-10-15 07:46:49.000000000","message":"Yeah you\u0027re right that it will fail. However if we sync ports first, creating port in OVN assumes that the PG of its neutron SG already exists so adding the port to a non existent PG fails. Chicken-egg here :) \nI think that the right approach is leaving the sync_port_groups here but just adding those ports that exist both in Neutron and OVN. Later in the sync_networks_ports_and_dhcp_opts() method, the ports that will get created will be automatically added to the relevant PGs and the ports. Does this sound amazing?","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"07e8ce2c0d34b404681cc2f91a8ac041b77c004f","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        self.sync_address_sets(ctx)"},{"line_number":91,"context_line":"        self.sync_port_groups(ctx)"},{"line_number":92,"context_line":"        self.sync_networks_ports_and_dhcp_opts(ctx)"},{"line_number":93,"context_line":"        self.sync_port_dns_records(ctx)"},{"line_number":94,"context_line":"        self.sync_acls(ctx)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_e93afa94","line":91,"in_reply_to":"3f79a3b5_5297359d","updated":"2018-10-15 08:39:05.000000000","message":"right right :)","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"75a76e16c22a4fe54332758f7517a56f4f6315c9","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        self.sync_address_sets(ctx)"},{"line_number":91,"context_line":"        self.sync_port_groups(ctx)"},{"line_number":92,"context_line":"        self.sync_networks_ports_and_dhcp_opts(ctx)"},{"line_number":93,"context_line":"        self.sync_port_dns_records(ctx)"},{"line_number":94,"context_line":"        self.sync_acls(ctx)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_e97c3aeb","line":91,"in_reply_to":"3f79a3b5_e9075a6f","updated":"2018-10-15 07:48:28.000000000","message":"s/relevant PGs and the ports/relevant PGs  :))","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e301292c9ffbfb9da1d327eadf19713acef5c7ab","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        self.sync_address_sets(ctx)"},{"line_number":91,"context_line":"        self.sync_port_groups(ctx)"},{"line_number":92,"context_line":"        self.sync_networks_ports_and_dhcp_opts(ctx)"},{"line_number":93,"context_line":"        self.sync_port_dns_records(ctx)"},{"line_number":94,"context_line":"        self.sync_acls(ctx)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_6ca59847","line":91,"in_reply_to":"3f79a3b5_e93afa94","updated":"2018-10-15 08:54:30.000000000","message":"Sounds good to me!","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"07e8ce2c0d34b404681cc2f91a8ac041b77c004f","unresolved":false,"context_lines":[{"line_number":177,"context_line":"            return"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        neutron_sgs \u003d {}"},{"line_number":180,"context_line":"        neutron_pgs \u003d []"},{"line_number":181,"context_line":"        with ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":182,"context_line":"            for sg in self.core_plugin.get_security_groups(ctx):"},{"line_number":183,"context_line":"                pg_name \u003d utils.ovn_port_group_name(sg[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_8c6cb46b","line":180,"range":{"start_line":180,"start_character":6,"end_line":180,"end_character":24},"updated":"2018-10-15 08:39:05.000000000","message":"megnit: Isn\u0027t it better if you use a set right away \n   neutron_pgs \u003d set()","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"e341ebf5d485269288aec51a3961bacd59267037","unresolved":false,"context_lines":[{"line_number":177,"context_line":"            return"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        neutron_sgs \u003d {}"},{"line_number":180,"context_line":"        neutron_pgs \u003d []"},{"line_number":181,"context_line":"        with ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":182,"context_line":"            for sg in self.core_plugin.get_security_groups(ctx):"},{"line_number":183,"context_line":"                pg_name \u003d utils.ovn_port_group_name(sg[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_a7a18994","line":180,"range":{"start_line":180,"start_character":6,"end_line":180,"end_character":24},"in_reply_to":"3f79a3b5_8c6cb46b","updated":"2018-10-15 09:22:16.000000000","message":"Done","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"07e8ce2c0d34b404681cc2f91a8ac041b77c004f","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        with ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":182,"context_line":"            for sg in self.core_plugin.get_security_groups(ctx):"},{"line_number":183,"context_line":"                pg_name \u003d utils.ovn_port_group_name(sg[\u0027id\u0027])"},{"line_number":184,"context_line":"                neutron_pgs.append(pg_name)"},{"line_number":185,"context_line":"                neutron_sgs[pg_name] \u003d sg[\u0027id\u0027]"},{"line_number":186,"context_line":"            neutron_pgs.append(const.OVN_DROP_PORT_GROUP_NAME)"},{"line_number":187,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_ec92084a","line":184,"updated":"2018-10-15 08:39:05.000000000","message":"neutron_pgs.add(pg_name)","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"07e8ce2c0d34b404681cc2f91a8ac041b77c004f","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                neutron_sgs[pg_name] \u003d sg[\u0027id\u0027]"},{"line_number":186,"context_line":"            neutron_pgs.append(const.OVN_DROP_PORT_GROUP_NAME)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        ovn_pgs \u003d []"},{"line_number":189,"context_line":"        port_groups \u003d self.ovn_api.db_list_rows(\u0027Port_Group\u0027).execute()"},{"line_number":190,"context_line":"        for pg in port_groups:"},{"line_number":191,"context_line":"            ovn_pgs.append(pg.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_6ca6f8ae","line":188,"updated":"2018-10-15 08:39:05.000000000","message":"ovn_pgs \u003d set()","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"607aeac7bdf5e7af998d5d245ac247b0c7bb0001","unresolved":false,"context_lines":[{"line_number":186,"context_line":"            neutron_pgs.append(const.OVN_DROP_PORT_GROUP_NAME)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        ovn_pgs \u003d []"},{"line_number":189,"context_line":"        port_groups \u003d self.ovn_api.db_list_rows(\u0027Port_Group\u0027).execute()"},{"line_number":190,"context_line":"        for pg in port_groups:"},{"line_number":191,"context_line":"            ovn_pgs.append(pg.name)"},{"line_number":192,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_1965601c","line":189,"range":{"start_line":189,"start_character":8,"end_line":189,"end_character":71},"updated":"2018-10-12 14:51:44.000000000","message":"This can return None if there\u0027s no Port_Groups created\n\n\n    Traceback (most recent call last):\n      File \"/opt/stack/networking-ovn/.tox/dsvm-functional/lib/python2.7/site-packages/mock/mock.py\", line 1305, in patched\n        return func(*args, **keywargs)\n      File \"/opt/stack/networking-ovn/.tox/dsvm-functional/lib/python2.7/site-packages/neutron/tests/base.py\", line 140, in func\n        return f(self, *args, **kwargs)\n      File \"networking_ovn/tests/functional/test_ovn_db_sync.py\", line 1400, in test_ovn_nb_sync_repair_delete_ovn_nb_db\n        restart_ovsdb_processes\u003dTrue)\n      File \"networking_ovn/tests/functional/test_ovn_db_sync.py\", line 1390, in _test_ovn_nb_sync_helper\n        self._sync_resources(mode)\n      File \"networking_ovn/tests/functional/test_ovn_db_sync.py\", line 1370, in _sync_resources\n        nb_synchronizer.do_sync()\n      File \"networking_ovn/ovn_db_sync.py\", line 91, in do_sync\n        self.sync_port_groups(ctx)\n      File \"networking_ovn/ovn_db_sync.py\", line 190, in sync_port_groups\n        for pg in port_groups:\n    TypeError: \u0027NoneType\u0027 object is not iterable","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"c12fb26966ab0e1f085bcbaf517ce6f572a8fea0","unresolved":false,"context_lines":[{"line_number":186,"context_line":"            neutron_pgs.append(const.OVN_DROP_PORT_GROUP_NAME)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        ovn_pgs \u003d []"},{"line_number":189,"context_line":"        port_groups \u003d self.ovn_api.db_list_rows(\u0027Port_Group\u0027).execute()"},{"line_number":190,"context_line":"        for pg in port_groups:"},{"line_number":191,"context_line":"            ovn_pgs.append(pg.name)"},{"line_number":192,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_098176fa","line":189,"range":{"start_line":189,"start_character":8,"end_line":189,"end_character":71},"in_reply_to":"3f79a3b5_1965601c","updated":"2018-10-15 07:46:49.000000000","message":"Good catch!","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"07e8ce2c0d34b404681cc2f91a8ac041b77c004f","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        ovn_pgs \u003d []"},{"line_number":189,"context_line":"        port_groups \u003d self.ovn_api.db_list_rows(\u0027Port_Group\u0027).execute()"},{"line_number":190,"context_line":"        for pg in port_groups:"},{"line_number":191,"context_line":"            ovn_pgs.append(pg.name)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        add_pgs \u003d list(set(neutron_pgs).difference(ovn_pgs))"},{"line_number":194,"context_line":"        remove_pgs \u003d list(set(ovn_pgs).difference(neutron_pgs))"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_2cb6c0dd","line":191,"range":{"start_line":191,"start_character":12,"end_line":191,"end_character":23},"updated":"2018-10-15 08:39:05.000000000","message":"ovn_pgs.add(","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"07e8ce2c0d34b404681cc2f91a8ac041b77c004f","unresolved":false,"context_lines":[{"line_number":190,"context_line":"        for pg in port_groups:"},{"line_number":191,"context_line":"            ovn_pgs.append(pg.name)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        add_pgs \u003d list(set(neutron_pgs).difference(ovn_pgs))"},{"line_number":194,"context_line":"        remove_pgs \u003d list(set(ovn_pgs).difference(neutron_pgs))"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        LOG.debug(\u0027Port Groups added %d, removed %d\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_0caf447c","line":193,"range":{"start_line":193,"start_character":23,"end_line":193,"end_character":27},"updated":"2018-10-15 08:39:05.000000000","message":"you can then avoid the list-\u003eset conversion.","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"07e8ce2c0d34b404681cc2f91a8ac041b77c004f","unresolved":false,"context_lines":[{"line_number":191,"context_line":"            ovn_pgs.append(pg.name)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        add_pgs \u003d list(set(neutron_pgs).difference(ovn_pgs))"},{"line_number":194,"context_line":"        remove_pgs \u003d list(set(ovn_pgs).difference(neutron_pgs))"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        LOG.debug(\u0027Port Groups added %d, removed %d\u0027,"},{"line_number":197,"context_line":"                  len(add_pgs), len(remove_pgs))"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_ccc4ec43","line":194,"range":{"start_line":194,"start_character":26,"end_line":194,"end_character":29},"updated":"2018-10-15 08:39:05.000000000","message":"and here.","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"ff208e86f1fd539af04944e67023579187f464f4","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                                pg, n_port[\u0027id\u0027]))"},{"line_number":233,"context_line":"                for pg in remove_pgs:"},{"line_number":234,"context_line":"                    txn.add(self.ovn_api.pg_del(pg))"},{"line_number":235,"context_line":"            LOG.debug(\u0027Port-Group-SYNC: transaction finished @ %s\u0027,"},{"line_number":236,"context_line":"                      str(datetime.now()))"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    def sync_address_sets(self, ctx):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_224ea4c1","line":235,"range":{"start_line":235,"start_character":61,"end_line":235,"end_character":62},"updated":"2018-10-16 15:45:50.000000000","message":"nit: at\n\nI know it\u0027s a debug log but we could be a bit more formal","commit_id":"b37f0f5ebefd6153c1bdce61152ccfe63a36cc47"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"ff208e86f1fd539af04944e67023579187f464f4","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                for pg in remove_pgs:"},{"line_number":234,"context_line":"                    txn.add(self.ovn_api.pg_del(pg))"},{"line_number":235,"context_line":"            LOG.debug(\u0027Port-Group-SYNC: transaction finished @ %s\u0027,"},{"line_number":236,"context_line":"                      str(datetime.now()))"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    def sync_address_sets(self, ctx):"},{"line_number":239,"context_line":"        \"\"\"Sync Address Sets between neutron and NB."}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_a2c71411","line":236,"range":{"start_line":236,"start_character":22,"end_line":236,"end_character":41},"updated":"2018-10-16 15:45:50.000000000","message":"nit: timeutils.utcnow()\n\nFor consistency with other logs","commit_id":"b37f0f5ebefd6153c1bdce61152ccfe63a36cc47"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9a6b3e124a7ded90bf78b4dfeb5a65ba8bee59a4","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                for pg in remove_pgs:"},{"line_number":234,"context_line":"                    txn.add(self.ovn_api.pg_del(pg))"},{"line_number":235,"context_line":"            LOG.debug(\u0027Port-Group-SYNC: transaction finished @ %s\u0027,"},{"line_number":236,"context_line":"                      str(datetime.now()))"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    def sync_address_sets(self, ctx):"},{"line_number":239,"context_line":"        \"\"\"Sync Address Sets between neutron and NB."}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_b77662d5","line":236,"range":{"start_line":236,"start_character":22,"end_line":236,"end_character":41},"in_reply_to":"3f79a3b5_a2c71411","updated":"2018-10-17 06:18:13.000000000","message":"see my comments in PS11 (all the logs in this module use datetime.now())","commit_id":"b37f0f5ebefd6153c1bdce61152ccfe63a36cc47"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"ff208e86f1fd539af04944e67023579187f464f4","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                  len(add_pgs), len(remove_pgs))"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        if self.mode \u003d\u003d SYNC_MODE_REPAIR:"},{"line_number":200,"context_line":"            LOG.debug(\u0027Port-Group-SYNC: transaction started @ %s\u0027,"},{"line_number":201,"context_line":"                      str(datetime.now()))"},{"line_number":202,"context_line":"            if add_pgs:"},{"line_number":203,"context_line":"                db_ports \u003d self.core_plugin.get_ports(ctx)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_0274c8ce","line":200,"range":{"start_line":200,"start_character":59,"end_line":200,"end_character":61},"updated":"2018-10-16 15:45:50.000000000","message":"nit: at\n\nI know it\u0027s only a debug log but we can be a bit more formal about it.","commit_id":"35deb30d412d5ae0ab751b57e138e261ac98ccb9"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9a6b3e124a7ded90bf78b4dfeb5a65ba8bee59a4","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                  len(add_pgs), len(remove_pgs))"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        if self.mode \u003d\u003d SYNC_MODE_REPAIR:"},{"line_number":200,"context_line":"            LOG.debug(\u0027Port-Group-SYNC: transaction started @ %s\u0027,"},{"line_number":201,"context_line":"                      str(datetime.now()))"},{"line_number":202,"context_line":"            if add_pgs:"},{"line_number":203,"context_line":"                db_ports \u003d self.core_plugin.get_ports(ctx)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_57b7ce89","line":200,"range":{"start_line":200,"start_character":59,"end_line":200,"end_character":61},"in_reply_to":"3f79a3b5_0274c8ce","updated":"2018-10-17 06:18:13.000000000","message":"Yes, the reason I didn\u0027t write it like this is that if you take a look at all sync tasks in this module, they\u0027re written with \u0027@\u0027. While working on migration and port groups sometimes I write scripts that parse logs so I thought it was nice to be consistent with other debug traces in this module for this purpose.\nI can however send a follow up patch to make it more formal. Let me know how it sounds :)","commit_id":"35deb30d412d5ae0ab751b57e138e261ac98ccb9"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"ff208e86f1fd539af04944e67023579187f464f4","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        if self.mode \u003d\u003d SYNC_MODE_REPAIR:"},{"line_number":200,"context_line":"            LOG.debug(\u0027Port-Group-SYNC: transaction started @ %s\u0027,"},{"line_number":201,"context_line":"                      str(datetime.now()))"},{"line_number":202,"context_line":"            if add_pgs:"},{"line_number":203,"context_line":"                db_ports \u003d self.core_plugin.get_ports(ctx)"},{"line_number":204,"context_line":"                ovn_ports \u003d set(p.name for p in"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_e222ecb6","line":201,"range":{"start_line":201,"start_character":22,"end_line":201,"end_character":41},"updated":"2018-10-16 15:45:50.000000000","message":"As a suggestion, you can a stopWatcher here (we do that in the maintenance thread), for example:\n\n_sync_timer \u003d timeutils.StopWatch()\n_sync_timer.start()\n\n\u003ccode here\u003e\n\n_sync_timer.stop()                                                 \nLOG.debug(\u0027Port Groups synchronization finished (took %.2f seconds)\u0027, _sync_timer.elapsed())","commit_id":"35deb30d412d5ae0ab751b57e138e261ac98ccb9"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9a6b3e124a7ded90bf78b4dfeb5a65ba8bee59a4","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        if self.mode \u003d\u003d SYNC_MODE_REPAIR:"},{"line_number":200,"context_line":"            LOG.debug(\u0027Port-Group-SYNC: transaction started @ %s\u0027,"},{"line_number":201,"context_line":"                      str(datetime.now()))"},{"line_number":202,"context_line":"            if add_pgs:"},{"line_number":203,"context_line":"                db_ports \u003d self.core_plugin.get_ports(ctx)"},{"line_number":204,"context_line":"                ovn_ports \u003d set(p.name for p in"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_b7a1823d","line":201,"range":{"start_line":201,"start_character":22,"end_line":201,"end_character":41},"in_reply_to":"3f79a3b5_e222ecb6","updated":"2018-10-17 06:18:13.000000000","message":"Same reason as my comment on L200. Perhaps a follow up patch to address both comments in the whole module. This follow up patch won\u0027t be backported but we need this one in stable/rocky :)","commit_id":"35deb30d412d5ae0ab751b57e138e261ac98ccb9"}],"networking_ovn/ovsdb/impl_idl_ovn.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d018ea327aeef5e0784443eb2589afd19aa88849","unresolved":false,"context_lines":[{"line_number":683,"context_line":"            if not (ovn_const.OVN_SG_EXT_ID_KEY in row.external_ids or"},{"line_number":684,"context_line":"               row.name \u003d\u003d ovn_const.OVN_DROP_PORT_GROUP_NAME):"},{"line_number":685,"context_line":"                continue"},{"line_number":686,"context_line":"            name \u003d getattr(row, \u0027name\u0027)"},{"line_number":687,"context_line":"            data \u003d {}"},{"line_number":688,"context_line":"            for row_key in getattr(row, \"_data\", {}):"},{"line_number":689,"context_line":"                data[row_key] \u003d getattr(row, row_key)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3f79a3b5_4a539cdf","line":686,"range":{"start_line":686,"start_character":12,"end_line":686,"end_character":39},"updated":"2018-10-17 15:08:00.000000000","message":"nit: Is that needed ? We are comparing row.name at L684 to check if it does not match the OVN_DROP_PORT_GROUP_NAME.\n\nI can see this code was based on the get_address_sets() method, but just wondering if we actually need that getattr call there. Doesn\u0027t do any harm tho.","commit_id":"cc83ee9e1f4f4035bb2798f7b3a086c27dd5747a"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"07ed787f003deb4ee4faae7c77764cb6f9586bb9","unresolved":false,"context_lines":[{"line_number":683,"context_line":"            if not (ovn_const.OVN_SG_EXT_ID_KEY in row.external_ids or"},{"line_number":684,"context_line":"               row.name \u003d\u003d ovn_const.OVN_DROP_PORT_GROUP_NAME):"},{"line_number":685,"context_line":"                continue"},{"line_number":686,"context_line":"            name \u003d getattr(row, \u0027name\u0027)"},{"line_number":687,"context_line":"            data \u003d {}"},{"line_number":688,"context_line":"            for row_key in getattr(row, \"_data\", {}):"},{"line_number":689,"context_line":"                data[row_key] \u003d getattr(row, row_key)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3f79a3b5_9ca33000","line":686,"range":{"start_line":686,"start_character":12,"end_line":686,"end_character":39},"in_reply_to":"3f79a3b5_4a539cdf","updated":"2018-10-18 06:35:30.000000000","message":"Right, we don\u0027t need it :) Fixing it now","commit_id":"cc83ee9e1f4f4035bb2798f7b3a086c27dd5747a"}],"networking_ovn/ovsdb/ovn_api.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d018ea327aeef5e0784443eb2589afd19aa88849","unresolved":false,"context_lines":[{"line_number":429,"context_line":""},{"line_number":430,"context_line":"    @abc.abstractmethod"},{"line_number":431,"context_line":"    def get_port_groups(self):"},{"line_number":432,"context_line":"        \"\"\"Gets all port groups in the OVN_Northbound DB"},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"        :returns: dictionary indexed by name, DB columns as values"},{"line_number":435,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":13,"id":"3f79a3b5_aa827050","line":432,"range":{"start_line":432,"start_character":16,"end_line":432,"end_character":19},"updated":"2018-10-17 15:08:00.000000000","message":"nit: It does excludes the pg_drop PG (maybe worth mentioning ?)","commit_id":"cc83ee9e1f4f4035bb2798f7b3a086c27dd5747a"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"07ed787f003deb4ee4faae7c77764cb6f9586bb9","unresolved":false,"context_lines":[{"line_number":429,"context_line":""},{"line_number":430,"context_line":"    @abc.abstractmethod"},{"line_number":431,"context_line":"    def get_port_groups(self):"},{"line_number":432,"context_line":"        \"\"\"Gets all port groups in the OVN_Northbound DB"},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"        :returns: dictionary indexed by name, DB columns as values"},{"line_number":435,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":13,"id":"3f79a3b5_fc8a6463","line":432,"range":{"start_line":432,"start_character":16,"end_line":432,"end_character":19},"in_reply_to":"3f79a3b5_aa827050","updated":"2018-10-18 06:35:30.000000000","message":"It actually doesn\u0027t exclude it no? My goal was to return all port groups \"managed\" by networking ovn, ie. those with the external id set to a Neutron SG or the \u0027special\u0027 drop PG.","commit_id":"cc83ee9e1f4f4035bb2798f7b3a086c27dd5747a"}],"networking_ovn/tests/functional/test_ovn_db_sync.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"ff208e86f1fd539af04944e67023579187f464f4","unresolved":false,"context_lines":[{"line_number":37,"context_line":"# TODO(lucasagomes): Write functional tests for the ovn_db_sync.py script"},{"line_number":38,"context_line":"#                    using Port Groups"},{"line_number":39,"context_line":"@mock.patch(\u0027networking_ovn.ovsdb.impl_idl_ovn.OvsdbNbOvnIdl.\u0027"},{"line_number":40,"context_line":"            \u0027is_port_groups_supported\u0027, lambda *args: False)"},{"line_number":41,"context_line":"class TestOvnNbSync(base.TestOVNFunctionalBase):"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    _extension_drivers \u003d [\u0027port_security\u0027, \u0027dns\u0027]"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_c2dd70de","side":"PARENT","line":40,"updated":"2018-10-16 15:45:50.000000000","message":"w00t!","commit_id":"993ef63b667174575a5ca4dbf5f8a631eab981c9"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9a6b3e124a7ded90bf78b4dfeb5a65ba8bee59a4","unresolved":false,"context_lines":[{"line_number":37,"context_line":"# TODO(lucasagomes): Write functional tests for the ovn_db_sync.py script"},{"line_number":38,"context_line":"#                    using Port Groups"},{"line_number":39,"context_line":"@mock.patch(\u0027networking_ovn.ovsdb.impl_idl_ovn.OvsdbNbOvnIdl.\u0027"},{"line_number":40,"context_line":"            \u0027is_port_groups_supported\u0027, lambda *args: False)"},{"line_number":41,"context_line":"class TestOvnNbSync(base.TestOVNFunctionalBase):"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    _extension_drivers \u003d [\u0027port_security\u0027, \u0027dns\u0027]"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_173f16e0","side":"PARENT","line":40,"in_reply_to":"3f79a3b5_c2dd70de","updated":"2018-10-17 06:18:13.000000000","message":"finally! :)","commit_id":"993ef63b667174575a5ca4dbf5f8a631eab981c9"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"ff208e86f1fd539af04944e67023579187f464f4","unresolved":false,"context_lines":[{"line_number":1564,"context_line":"@mock.patch(\u0027networking_ovn.ovsdb.impl_idl_ovn.OvsdbNbOvnIdl.\u0027"},{"line_number":1565,"context_line":"            \u0027is_port_groups_supported\u0027, lambda *args: False)"},{"line_number":1566,"context_line":"class TestOvnNbSyncNoPgs(TestOvnNbSync):"},{"line_number":1567,"context_line":"    pass"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_82bbf872","line":1567,"updated":"2018-10-16 15:45:50.000000000","message":"Nice, that\u0027s very useful to test the backward compatibility","commit_id":"35deb30d412d5ae0ab751b57e138e261ac98ccb9"}],"networking_ovn/tests/unit/test_ovn_db_sync.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"b4d7f37121c8ed010726e8b7412c9f8154aace70","unresolved":false,"context_lines":[{"line_number":398,"context_line":"        ovn_nb_synchronizer.get_address_sets \u003d mock.Mock()"},{"line_number":399,"context_line":"        ovn_nb_synchronizer.get_address_sets.return_value \u003d\\"},{"line_number":400,"context_line":"            self.address_sets_ovn"},{"line_number":401,"context_line":"        import pdb; pdb.set_trace()"},{"line_number":402,"context_line":"        get_port_groups \u003d mock.MagicMock()"},{"line_number":403,"context_line":"        get_port_groups.execute.return_value \u003d self.port_groups_ovn"},{"line_number":404,"context_line":"        ovn_api.db_list_rows.return_value \u003d get_port_groups"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_acf7308c","line":401,"range":{"start_line":401,"start_character":8,"end_line":401,"end_character":35},"updated":"2018-10-15 08:44:18.000000000","message":"I see this is WIP :D gate won\u0027t like it %)","commit_id":"c967d75ae4b03360e0bf06dc8747266e540e64b2"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"ff208e86f1fd539af04944e67023579187f464f4","unresolved":false,"context_lines":[{"line_number":126,"context_line":"            ports\u003d[],"},{"line_number":127,"context_line":"            acls\u003d[])"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"#        self.acl_pgs_ovn \u003d {"},{"line_number":130,"context_line":"#            \u0027p2n2\u0027:"},{"line_number":131,"context_line":"#            [{\u0027port_group\u0027: \u0027pg_sg1\u0027, \u0027direction\u0027: \u0027to-lport\u0027,"},{"line_number":132,"context_line":"#              \u0027log\u0027: False, \u0027priority\u0027: 1001, \u0027action\u0027: \u0027drop\u0027,"},{"line_number":133,"context_line":"#              \u0027external_ids\u0027: {ovn_const.OVN_SG_RULE_EXT_ID_KEY: \u0027ruleid1\u0027},"},{"line_number":134,"context_line":"#              \u0027match\u0027: \u0027outport \u003d\u003d @pg_sg1 \u0026\u0026 ip\u0027},"},{"line_number":135,"context_line":"#"},{"line_number":136,"context_line":"#    acl \u003d {\"port_group\": port_group,"},{"line_number":137,"context_line":"#          \"priority\": ovn_const.ACL_PRIORITY_ALLOW,"},{"line_number":138,"context_line":"#          \"action\": ovn_const.ACL_ACTION_ALLOW_RELATED,"},{"line_number":139,"context_line":"#          \"log\": False,"},{"line_number":140,"context_line":"#          \"name\": [],"},{"line_number":141,"context_line":"#          \"severity\": [],"},{"line_number":142,"context_line":"#          \"direction\": dir_map[r[\u0027direction\u0027]],"},{"line_number":143,"context_line":"#          \"match\": match,"},{"line_number":144,"context_line":"#          ovn_const.OVN_SG_RULE_EXT_ID_KEY: r[\u0027id\u0027]}"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        self.ports \u003d ["},{"line_number":147,"context_line":"            {\u0027id\u0027: \u0027p1n1\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_829218fb","line":144,"range":{"start_line":129,"start_character":0,"end_line":144,"end_character":53},"updated":"2018-10-16 15:45:50.000000000","message":"To be removed ?","commit_id":"b37f0f5ebefd6153c1bdce61152ccfe63a36cc47"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"9a6b3e124a7ded90bf78b4dfeb5a65ba8bee59a4","unresolved":false,"context_lines":[{"line_number":126,"context_line":"            ports\u003d[],"},{"line_number":127,"context_line":"            acls\u003d[])"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"#        self.acl_pgs_ovn \u003d {"},{"line_number":130,"context_line":"#            \u0027p2n2\u0027:"},{"line_number":131,"context_line":"#            [{\u0027port_group\u0027: \u0027pg_sg1\u0027, \u0027direction\u0027: \u0027to-lport\u0027,"},{"line_number":132,"context_line":"#              \u0027log\u0027: False, \u0027priority\u0027: 1001, \u0027action\u0027: \u0027drop\u0027,"},{"line_number":133,"context_line":"#              \u0027external_ids\u0027: {ovn_const.OVN_SG_RULE_EXT_ID_KEY: \u0027ruleid1\u0027},"},{"line_number":134,"context_line":"#              \u0027match\u0027: \u0027outport \u003d\u003d @pg_sg1 \u0026\u0026 ip\u0027},"},{"line_number":135,"context_line":"#"},{"line_number":136,"context_line":"#    acl \u003d {\"port_group\": port_group,"},{"line_number":137,"context_line":"#          \"priority\": ovn_const.ACL_PRIORITY_ALLOW,"},{"line_number":138,"context_line":"#          \"action\": ovn_const.ACL_ACTION_ALLOW_RELATED,"},{"line_number":139,"context_line":"#          \"log\": False,"},{"line_number":140,"context_line":"#          \"name\": [],"},{"line_number":141,"context_line":"#          \"severity\": [],"},{"line_number":142,"context_line":"#          \"direction\": dir_map[r[\u0027direction\u0027]],"},{"line_number":143,"context_line":"#          \"match\": match,"},{"line_number":144,"context_line":"#          ovn_const.OVN_SG_RULE_EXT_ID_KEY: r[\u0027id\u0027]}"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        self.ports \u003d ["},{"line_number":147,"context_line":"            {\u0027id\u0027: \u0027p1n1\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_f755ba20","line":144,"range":{"start_line":129,"start_character":0,"end_line":144,"end_character":53},"in_reply_to":"3f79a3b5_829218fb","updated":"2018-10-17 06:18:13.000000000","message":"ooops :)","commit_id":"b37f0f5ebefd6153c1bdce61152ccfe63a36cc47"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"ff208e86f1fd539af04944e67023579187f464f4","unresolved":false,"context_lines":[{"line_number":125,"context_line":"            external_ids\u003d[],"},{"line_number":126,"context_line":"            ports\u003d[],"},{"line_number":127,"context_line":"            acls\u003d[])"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"#        self.acl_pgs_ovn \u003d {"},{"line_number":130,"context_line":"#            \u0027p2n2\u0027:"},{"line_number":131,"context_line":"#            [{\u0027port_group\u0027: \u0027pg_sg1\u0027, \u0027direction\u0027: \u0027to-lport\u0027,"},{"line_number":132,"context_line":"#              \u0027log\u0027: False, \u0027priority\u0027: 1001, \u0027action\u0027: \u0027drop\u0027,"},{"line_number":133,"context_line":"#              \u0027external_ids\u0027: {ovn_const.OVN_SG_RULE_EXT_ID_KEY: \u0027ruleid1\u0027},"},{"line_number":134,"context_line":"#              \u0027match\u0027: \u0027outport \u003d\u003d @pg_sg1 \u0026\u0026 ip\u0027},"},{"line_number":135,"context_line":"#"},{"line_number":136,"context_line":"#    acl \u003d {\"port_group\": port_group,"},{"line_number":137,"context_line":"#          \"priority\": ovn_const.ACL_PRIORITY_ALLOW,"},{"line_number":138,"context_line":"#          \"action\": ovn_const.ACL_ACTION_ALLOW_RELATED,"},{"line_number":139,"context_line":"#          \"log\": False,"},{"line_number":140,"context_line":"#          \"name\": [],"},{"line_number":141,"context_line":"#          \"severity\": [],"},{"line_number":142,"context_line":"#          \"direction\": dir_map[r[\u0027direction\u0027]],"},{"line_number":143,"context_line":"#          \"match\": match,"},{"line_number":144,"context_line":"#          ovn_const.OVN_SG_RULE_EXT_ID_KEY: r[\u0027id\u0027]}"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        self.ports \u003d ["},{"line_number":147,"context_line":"            {\u0027id\u0027: \u0027p1n1\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_020b682a","line":144,"range":{"start_line":128,"start_character":0,"end_line":144,"end_character":53},"updated":"2018-10-16 15:45:50.000000000","message":"To be removed ?","commit_id":"35deb30d412d5ae0ab751b57e138e261ac98ccb9"}]}
