)]}'
{"neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py":[{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"7a9266eb244c2da75c14d3476f0eb514bf4eb571","unresolved":false,"context_lines":[{"line_number":345,"context_line":"            elif \u0027cmd\u0027 in port_info.dhcpv6_options:"},{"line_number":346,"context_line":"                dhcpv6_options \u003d txn.add(port_info.dhcpv6_options[\u0027cmd\u0027])"},{"line_number":347,"context_line":"            else:"},{"line_number":348,"context_line":"                dhcpv6_options \u003d [port_info.dhcpv6_options[\u0027uuid\u0027]]"},{"line_number":349,"context_line":"            # The lport_name *must* be neutron port[\u0027id\u0027].  It must match the"},{"line_number":350,"context_line":"            # iface-id set in the Interfaces table of the Open_vSwitch"},{"line_number":351,"context_line":"            # database which nova sets to be the port ID."}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_dac50190","line":348,"range":{"start_line":348,"start_character":0,"end_line":348,"end_character":1},"updated":"2020-06-02 07:34:29.000000000","message":"At this point you seem to be missing the subnet port group bits as well (during port creation)","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":11952,"name":"Flavio Fernandes","email":"flavio@flaviof.com","username":"ffernand"},"change_message_id":"8d9f1dfcbfb15c1b151b9d8683f20120c6a5685c","unresolved":false,"context_lines":[{"line_number":564,"context_line":"            detached_sg_ids \u003d old_sg_ids - new_sg_ids"},{"line_number":565,"context_line":"            attached_sg_ids \u003d new_sg_ids - old_sg_ids"},{"line_number":566,"context_line":""},{"line_number":567,"context_line":"            # Assuming that neutron port cannot change its network, check"},{"line_number":568,"context_line":"            # for changes in subnet id for the neutron port"},{"line_number":569,"context_line":"            #filters \u003d dict(network_id\u003d[port[\u0027network_id\u0027]])"},{"line_number":570,"context_line":"            #subnets \u003d self._plugin.get_subnets(context, filters\u003dfilters)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_af70cd73","line":567,"range":{"start_line":567,"start_character":14,"end_line":567,"end_character":66},"updated":"2020-06-02 05:23:32.000000000","message":"can we assume that a neutron port does not change its network? If not, we will need a better way to determine the old subnet pgs.","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":11952,"name":"Flavio Fernandes","email":"flavio@flaviof.com","username":"ffernand"},"change_message_id":"3d142de9bd1d28aeb1e9fd51f8436ceae831abb6","unresolved":false,"context_lines":[{"line_number":564,"context_line":"            detached_sg_ids \u003d old_sg_ids - new_sg_ids"},{"line_number":565,"context_line":"            attached_sg_ids \u003d new_sg_ids - old_sg_ids"},{"line_number":566,"context_line":""},{"line_number":567,"context_line":"            # Assuming that neutron port cannot change its network, check"},{"line_number":568,"context_line":"            # for changes in subnet id for the neutron port"},{"line_number":569,"context_line":"            #filters \u003d dict(network_id\u003d[port[\u0027network_id\u0027]])"},{"line_number":570,"context_line":"            #subnets \u003d self._plugin.get_subnets(context, filters\u003dfilters)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_c0ab4ed3","line":567,"range":{"start_line":567,"start_character":14,"end_line":567,"end_character":66},"in_reply_to":"ff570b3c_5a84515e","updated":"2020-06-02 10:47:29.000000000","message":"ack. Thanks for the link!","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"7a9266eb244c2da75c14d3476f0eb514bf4eb571","unresolved":false,"context_lines":[{"line_number":564,"context_line":"            detached_sg_ids \u003d old_sg_ids - new_sg_ids"},{"line_number":565,"context_line":"            attached_sg_ids \u003d new_sg_ids - old_sg_ids"},{"line_number":566,"context_line":""},{"line_number":567,"context_line":"            # Assuming that neutron port cannot change its network, check"},{"line_number":568,"context_line":"            # for changes in subnet id for the neutron port"},{"line_number":569,"context_line":"            #filters \u003d dict(network_id\u003d[port[\u0027network_id\u0027]])"},{"line_number":570,"context_line":"            #subnets \u003d self._plugin.get_subnets(context, filters\u003dfilters)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_5a84515e","line":567,"range":{"start_line":567,"start_character":14,"end_line":567,"end_character":66},"in_reply_to":"ff570b3c_af70cd73","updated":"2020-06-02 07:34:29.000000000","message":"I think we can according to the API:\n\nhttps://docs.openstack.org/api-ref/network/v2/?expanded\u003dupdate-port-detail#update-port","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"ae316c025cefe5744cb9c49904ec3d6ae909bbf5","unresolved":false,"context_lines":[{"line_number":566,"context_line":""},{"line_number":567,"context_line":"            # Assuming that neutron port cannot change its network, check"},{"line_number":568,"context_line":"            # for changes in subnet id for the neutron port"},{"line_number":569,"context_line":"            #filters \u003d dict(network_id\u003d[port[\u0027network_id\u0027]])"},{"line_number":570,"context_line":"            #subnets \u003d self._plugin.get_subnets(context, filters\u003dfilters)"},{"line_number":571,"context_line":""},{"line_number":572,"context_line":"            network_subnet_pgs \u003d self._nb_idl.db_find("}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_da8861c7","line":569,"updated":"2020-06-02 08:27:26.000000000","message":"pep8: E265 block comment should start with \u0027# \u0027","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"ae316c025cefe5744cb9c49904ec3d6ae909bbf5","unresolved":false,"context_lines":[{"line_number":567,"context_line":"            # Assuming that neutron port cannot change its network, check"},{"line_number":568,"context_line":"            # for changes in subnet id for the neutron port"},{"line_number":569,"context_line":"            #filters \u003d dict(network_id\u003d[port[\u0027network_id\u0027]])"},{"line_number":570,"context_line":"            #subnets \u003d self._plugin.get_subnets(context, filters\u003dfilters)"},{"line_number":571,"context_line":""},{"line_number":572,"context_line":"            network_subnet_pgs \u003d self._nb_idl.db_find("},{"line_number":573,"context_line":"                \u0027Port_Group\u0027, (\u0027external_ids\u0027, \u0027\u003d\u0027, {"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_ba85adaf","line":570,"updated":"2020-06-02 08:27:26.000000000","message":"pep8: E265 block comment should start with \u0027# \u0027","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"7a9266eb244c2da75c14d3476f0eb514bf4eb571","unresolved":false,"context_lines":[{"line_number":571,"context_line":""},{"line_number":572,"context_line":"            network_subnet_pgs \u003d self._nb_idl.db_find("},{"line_number":573,"context_line":"                \u0027Port_Group\u0027, (\u0027external_ids\u0027, \u0027\u003d\u0027, {"},{"line_number":574,"context_line":"                    ovn_const.OVN_NETWORK_NAME_EXT_ID_KEY:"},{"line_number":575,"context_line":"                        utils.ovn_name(port[\u0027network_id\u0027])}))"},{"line_number":576,"context_line":"            old_subnet_pgs \u003d []"},{"line_number":577,"context_line":"            if network_subnet_pgs:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_ba948d8c","line":574,"range":{"start_line":574,"start_character":20,"end_line":574,"end_character":58},"updated":"2020-06-02 07:34:29.000000000","message":"Isn\u0027t it better to just have the subnet UUID?\nFor consistency purposes we want to map 1 Neutron Subnet to (Subnet Port Group, DHCP Options ) row pair in OVN so having the subnet UUID allows better matching.\n\nTo figure out if it belongs or not I think that you may want to fetch all subnet port groups (not sure if db_find can match the name by \u0027startswith\u0027 or something like that, need to check); otherwise what you\u0027re doing is fine but perhaps we need as well the subnet id.","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"85cc80ab3e9201c0866937b57a496cb7cd93a28b","unresolved":false,"context_lines":[{"line_number":571,"context_line":""},{"line_number":572,"context_line":"            network_subnet_pgs \u003d self._nb_idl.db_find("},{"line_number":573,"context_line":"                \u0027Port_Group\u0027, (\u0027external_ids\u0027, \u0027\u003d\u0027, {"},{"line_number":574,"context_line":"                    ovn_const.OVN_NETWORK_NAME_EXT_ID_KEY:"},{"line_number":575,"context_line":"                        utils.ovn_name(port[\u0027network_id\u0027])}))"},{"line_number":576,"context_line":"            old_subnet_pgs \u003d []"},{"line_number":577,"context_line":"            if network_subnet_pgs:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_fb2e078a","line":574,"range":{"start_line":574,"start_character":20,"end_line":574,"end_character":58},"in_reply_to":"ff570b3c_80f4b6f2","updated":"2020-06-02 10:56:59.000000000","message":"Not sure I follow.\n\nEach subnet belonging to a network with DHCP enabled should have a Port Group associated to it (external_id: subnet uuid).\n\nWhat could change is the IP allocations of ports. For example you can remove the IP allocation of a given port from a particular subnet. What you need to do in this case is remove that port from such subnet Port Group.\n\nI don\u0027t think you need the network uuid for anything but for performance reasons you can fetch all the subnet PGs from a particular subnet if you want to *also* add the network uuid to the external_ids. Another option is fetch all the subnets from a network. (new ovsdbapp indexes may help here)\n\nOn the other hand from L617, this function calculates the new vs old allocations. You can calculate the subnets at the same time for efficiency.\n\nAfter this, you\u0027ll remove the port from the detached subnets PGs and add the port to the attached subnet PGs.\n\nDoes this make sense?","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":11952,"name":"Flavio Fernandes","email":"flavio@flaviof.com","username":"ffernand"},"change_message_id":"3d142de9bd1d28aeb1e9fd51f8436ceae831abb6","unresolved":false,"context_lines":[{"line_number":571,"context_line":""},{"line_number":572,"context_line":"            network_subnet_pgs \u003d self._nb_idl.db_find("},{"line_number":573,"context_line":"                \u0027Port_Group\u0027, (\u0027external_ids\u0027, \u0027\u003d\u0027, {"},{"line_number":574,"context_line":"                    ovn_const.OVN_NETWORK_NAME_EXT_ID_KEY:"},{"line_number":575,"context_line":"                        utils.ovn_name(port[\u0027network_id\u0027])}))"},{"line_number":576,"context_line":"            old_subnet_pgs \u003d []"},{"line_number":577,"context_line":"            if network_subnet_pgs:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_80f4b6f2","line":574,"range":{"start_line":574,"start_character":20,"end_line":574,"end_character":58},"in_reply_to":"ff570b3c_ba948d8c","updated":"2020-06-02 10:47:29.000000000","message":"subnet id may have changed and the goal here is to find the \u0027old\u0027 uuids. The old uuids are in the name or something we can store in the external ids as well. Make sense?","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"ae316c025cefe5744cb9c49904ec3d6ae909bbf5","unresolved":false,"context_lines":[{"line_number":577,"context_line":"            if network_subnet_pgs:"},{"line_number":578,"context_line":"                for network_subnet_pg in network_subnet_pgs:"},{"line_number":579,"context_line":"                    for pg_port in network_subnet_pg.get(\u0027ports\u0027, []):"},{"line_number":580,"context_line":"                        #FIXME(flaviof): check if ovn_port is in ports"},{"line_number":581,"context_line":"                        #if it is, add pg_name to old_subnet_pgs"},{"line_number":582,"context_line":"                        break"},{"line_number":583,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_1a8f79cd","line":580,"updated":"2020-06-02 08:27:26.000000000","message":"pep8: E265 block comment should start with \u0027# \u0027","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"ae316c025cefe5744cb9c49904ec3d6ae909bbf5","unresolved":false,"context_lines":[{"line_number":578,"context_line":"                for network_subnet_pg in network_subnet_pgs:"},{"line_number":579,"context_line":"                    for pg_port in network_subnet_pg.get(\u0027ports\u0027, []):"},{"line_number":580,"context_line":"                        #FIXME(flaviof): check if ovn_port is in ports"},{"line_number":581,"context_line":"                        #if it is, add pg_name to old_subnet_pgs"},{"line_number":582,"context_line":"                        break"},{"line_number":583,"context_line":""},{"line_number":584,"context_line":"            new_subnet_pgs \u003d [utils.ovn_port_group_name(ip[\u0027subnet_id\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_fa8ba5bc","line":581,"updated":"2020-06-02 08:27:26.000000000","message":"pep8: E265 block comment should start with \u0027# \u0027","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"7a9266eb244c2da75c14d3476f0eb514bf4eb571","unresolved":false,"context_lines":[{"line_number":586,"context_line":""},{"line_number":587,"context_line":"            detached_subnet_pg_ids \u003d set(old_subnet_pgs) - set(new_subnet_pgs)"},{"line_number":588,"context_line":"            attached_subnet_pg_ids \u003d set(new_subnet_pgs) - set(old_subnet_pgs)"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"            if self._nb_idl.is_port_groups_supported():"},{"line_number":591,"context_line":"                for sg in detached_sg_ids:"},{"line_number":592,"context_line":"                    txn.add(self._nb_idl.pg_del_ports("}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_9aef091c","line":589,"updated":"2020-06-02 07:34:29.000000000","message":"I know that this function has been growing and growing so you\u0027re just following the existing pattern. We may need to refactor it and break it down in functions","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":11952,"name":"Flavio Fernandes","email":"flavio@flaviof.com","username":"ffernand"},"change_message_id":"3d142de9bd1d28aeb1e9fd51f8436ceae831abb6","unresolved":false,"context_lines":[{"line_number":586,"context_line":""},{"line_number":587,"context_line":"            detached_subnet_pg_ids \u003d set(old_subnet_pgs) - set(new_subnet_pgs)"},{"line_number":588,"context_line":"            attached_subnet_pg_ids \u003d set(new_subnet_pgs) - set(old_subnet_pgs)"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"            if self._nb_idl.is_port_groups_supported():"},{"line_number":591,"context_line":"                for sg in detached_sg_ids:"},{"line_number":592,"context_line":"                    txn.add(self._nb_idl.pg_del_ports("}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_401f3e6b","line":589,"in_reply_to":"ff570b3c_9aef091c","updated":"2020-06-02 10:47:29.000000000","message":"agree. I can at least move the new chunk to a new function.","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"7a9266eb244c2da75c14d3476f0eb514bf4eb571","unresolved":false,"context_lines":[{"line_number":595,"context_line":"                    txn.add(self._nb_idl.pg_add_ports("},{"line_number":596,"context_line":"                        utils.ovn_port_group_name(sg), port[\u0027id\u0027]))"},{"line_number":597,"context_line":""},{"line_number":598,"context_line":"                for subnet_pg in detached_subnet_pg_ids:"},{"line_number":599,"context_line":"                    txn.add(self._nb_idl.pg_del_ports("},{"line_number":600,"context_line":"                        subnet_pg, port[\u0027id\u0027]))"},{"line_number":601,"context_line":"                for subnet_pg in attached_subnet_pg_ids:"},{"line_number":602,"context_line":"                    txn.add(self._nb_idl.pg_add_ports("},{"line_number":603,"context_line":"                        subnet_pg, port[\u0027id\u0027]))"},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"                if (not utils.is_lsp_trusted(port) and"},{"line_number":606,"context_line":"                        utils.is_port_security_enabled(port)):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_9ac8a9a8","line":603,"range":{"start_line":598,"start_character":16,"end_line":603,"end_character":47},"updated":"2020-06-02 07:34:29.000000000","message":"This code is under \u0027is_port_groups_supported()\u0027 if clause.\nThe code in L567-L589 is assuming it is supported so it should check for it .\n\nif we refactor it we can do the port update operation by sections\n\nDHCP stuff: dhcp options + subnet row if PGs are supported \nSG stuff\n...\n\nAlso I think that it\u0027s time to remove the \u0027is_port_groups_supported\u0027 check as we have it since stable/queens and OVS 2.9 but definitely doesn\u0027t belong to this patch :)","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":11952,"name":"Flavio Fernandes","email":"flavio@flaviof.com","username":"ffernand"},"change_message_id":"3d142de9bd1d28aeb1e9fd51f8436ceae831abb6","unresolved":false,"context_lines":[{"line_number":595,"context_line":"                    txn.add(self._nb_idl.pg_add_ports("},{"line_number":596,"context_line":"                        utils.ovn_port_group_name(sg), port[\u0027id\u0027]))"},{"line_number":597,"context_line":""},{"line_number":598,"context_line":"                for subnet_pg in detached_subnet_pg_ids:"},{"line_number":599,"context_line":"                    txn.add(self._nb_idl.pg_del_ports("},{"line_number":600,"context_line":"                        subnet_pg, port[\u0027id\u0027]))"},{"line_number":601,"context_line":"                for subnet_pg in attached_subnet_pg_ids:"},{"line_number":602,"context_line":"                    txn.add(self._nb_idl.pg_add_ports("},{"line_number":603,"context_line":"                        subnet_pg, port[\u0027id\u0027]))"},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"                if (not utils.is_lsp_trusted(port) and"},{"line_number":606,"context_line":"                        utils.is_port_security_enabled(port)):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_a0cd7a31","line":603,"range":{"start_line":598,"start_character":16,"end_line":603,"end_character":47},"in_reply_to":"ff570b3c_9ac8a9a8","updated":"2020-06-02 10:47:29.000000000","message":"ack.","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"ae316c025cefe5744cb9c49904ec3d6ae909bbf5","unresolved":false,"context_lines":[{"line_number":2073,"context_line":"            return"},{"line_number":2074,"context_line":"        # Create subnet Port Group."},{"line_number":2075,"context_line":"        ext_ids \u003d {ovn_const.OVN_NETWORK_NAME_EXT_ID_KEY:"},{"line_number":2076,"context_line":"                       utils.ovn_name(network[\u0027id\u0027])}"},{"line_number":2077,"context_line":"        txn.add(self._nb_idl.pg_add(pg_name, acls\u003d[], external_ids\u003dext_ids))"},{"line_number":2078,"context_line":"        # Add ACLs to this Port Group."},{"line_number":2079,"context_line":"        acls \u003d ovn_acl.add_acls_for_subnet_port_group("}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_5abe1165","line":2076,"updated":"2020-06-02 08:27:26.000000000","message":"pep8: E127 continuation line over-indented for visual indent","commit_id":"ec4b00a8f5c21ed8ad911d22cace8a936c36ed13"}]}
