)]}'
{"neutron/db/securitygroups_db.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"9ee0295623a8274d9e30be2ee17fb63fd3f2ba53","unresolved":false,"context_lines":[{"line_number":911,"context_line":"                port_updates[ext_sg.SECURITYGROUPS])):"},{"line_number":912,"context_line":"            # delete the port binding and read it with the new rules"},{"line_number":913,"context_line":"            updated_device_owner \u003d updated_port.get(\u0027device_owner\u0027)"},{"line_number":914,"context_line":"            port_updates.update(device_owner\u003dupdated_device_owner)"},{"line_number":915,"context_line":"            port_updates[ext_sg.SECURITYGROUPS] \u003d ("},{"line_number":916,"context_line":"                self._get_security_groups_on_port(context, port))"},{"line_number":917,"context_line":"            self._delete_port_security_group_bindings(context, id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_6eb9b514","line":914,"updated":"2020-01-15 10:43:25.000000000","message":"The \"device_owner\" check is done in \"_get_security_groups_on_port\" with \"port\" content, not \"port_updates\".\n\nYou should not modify \"port_updates\".\n\nIf I\u0027m not wrong, reading the bug description, the problem you spotted out is that a port belonging to \"network:\" can have a SG assigned. Did you check if \"_get_security_groups_on_port\" returned False? If port device_owner is \"network:*\", then is a trusted port.","commit_id":"e31d4682e55945394828417781e1176c2394ca75"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2c8de72701006625d88ac60c2a201a274f92256a","unresolved":false,"context_lines":[{"line_number":911,"context_line":"                port_updates[ext_sg.SECURITYGROUPS])):"},{"line_number":912,"context_line":"            # delete the port binding and read it with the new rules"},{"line_number":913,"context_line":"            updated_device_owner \u003d updated_port.get(\u0027device_owner\u0027)"},{"line_number":914,"context_line":"            port_updates.update(device_owner\u003dupdated_device_owner)"},{"line_number":915,"context_line":"            port_updates[ext_sg.SECURITYGROUPS] \u003d ("},{"line_number":916,"context_line":"                self._get_security_groups_on_port(context, port))"},{"line_number":917,"context_line":"            self._delete_port_security_group_bindings(context, id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_e1a604ad","line":914,"in_reply_to":"3fa7e38b_5503160d","updated":"2020-01-16 10:35:09.000000000","message":"But \"updated_port\" has this change. The device_owner parameter was updated in [1], before calling this method [2]. You already have this information updated without changing port_updates.\n\nAnother question is (asked in the bug) if the problem is when you are updating a port, changing at the same time the device_owner (to network:*) and the SG. Is that the problem?\n\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L1664-L1665\n[2] https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L1687-L1688","commit_id":"e31d4682e55945394828417781e1176c2394ca75"},{"author":{"_account_id":29870,"name":"sunxifa","email":"sunxifa@inspur.com","username":"sunxifa"},"change_message_id":"4547c5ec1af106d8f78cb298d197190c8309a5c5","unresolved":false,"context_lines":[{"line_number":911,"context_line":"                port_updates[ext_sg.SECURITYGROUPS])):"},{"line_number":912,"context_line":"            # delete the port binding and read it with the new rules"},{"line_number":913,"context_line":"            updated_device_owner \u003d updated_port.get(\u0027device_owner\u0027)"},{"line_number":914,"context_line":"            port_updates.update(device_owner\u003dupdated_device_owner)"},{"line_number":915,"context_line":"            port_updates[ext_sg.SECURITYGROUPS] \u003d ("},{"line_number":916,"context_line":"                self._get_security_groups_on_port(context, port))"},{"line_number":917,"context_line":"            self._delete_port_security_group_bindings(context, id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_e91b5f6c","line":914,"in_reply_to":"3fa7e38b_6eb9b514","updated":"2020-01-15 11:22:51.000000000","message":"The \"port\" is actually a request body. so if the requst body has  no device_owner specified, but has security_groups attr when update a port belonging to \"network:\" ,  then \"_get_security_groups_on_port\" can not get the \"device_owner\" and return the \"port\" SG, \"network:\" port subsequently is added SG.\nAnd, \"port_updates\" is a dict as the \"port\" dict value.","commit_id":"e31d4682e55945394828417781e1176c2394ca75"},{"author":{"_account_id":29870,"name":"sunxifa","email":"sunxifa@inspur.com","username":"sunxifa"},"change_message_id":"3b12e8848282115e3c051d900ac84c2ab221e38c","unresolved":false,"context_lines":[{"line_number":911,"context_line":"                port_updates[ext_sg.SECURITYGROUPS])):"},{"line_number":912,"context_line":"            # delete the port binding and read it with the new rules"},{"line_number":913,"context_line":"            updated_device_owner \u003d updated_port.get(\u0027device_owner\u0027)"},{"line_number":914,"context_line":"            port_updates.update(device_owner\u003dupdated_device_owner)"},{"line_number":915,"context_line":"            port_updates[ext_sg.SECURITYGROUPS] \u003d ("},{"line_number":916,"context_line":"                self._get_security_groups_on_port(context, port))"},{"line_number":917,"context_line":"            self._delete_port_security_group_bindings(context, id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_5503160d","line":914,"in_reply_to":"3fa7e38b_7712e1ff","updated":"2020-01-16 02:00:44.000000000","message":"We can\u0027t pass the original port to the \"_get_security_groups_on_port\" method, as the original port  has no or different SG and other attrs than the port (request body).So just keep the port \"device_owner\" attr in consistence with the updated port and keep passing the modified port.\nThat\u0027s just my opinion, may be wrong or there may be a better solution.","commit_id":"e31d4682e55945394828417781e1176c2394ca75"},{"author":{"_account_id":30380,"name":"ZhouHeng","email":"zhouhenglc@inspur.com","username":"zhouhenglc"},"change_message_id":"e2ff0f76d7650641aec8f627eda6da52adbb393d","unresolved":false,"context_lines":[{"line_number":911,"context_line":"                port_updates[ext_sg.SECURITYGROUPS])):"},{"line_number":912,"context_line":"            # delete the port binding and read it with the new rules"},{"line_number":913,"context_line":"            updated_device_owner \u003d updated_port.get(\u0027device_owner\u0027)"},{"line_number":914,"context_line":"            port_updates.update(device_owner\u003dupdated_device_owner)"},{"line_number":915,"context_line":"            port_updates[ext_sg.SECURITYGROUPS] \u003d ("},{"line_number":916,"context_line":"                self._get_security_groups_on_port(context, port))"},{"line_number":917,"context_line":"            self._delete_port_security_group_bindings(context, id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_edeeebb4","line":914,"in_reply_to":"3fa7e38b_e1a604ad","updated":"2020-01-17 01:28:27.000000000","message":"what about \nport[\u0027device_owner\u0027] \u003d port.get(\u0027device_owner\u0027,  \n updated_port[\u0027device_owner\u0027]) ?","commit_id":"e31d4682e55945394828417781e1176c2394ca75"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"027f7c088951577951858f1877f0882fa85c2d48","unresolved":false,"context_lines":[{"line_number":911,"context_line":"                port_updates[ext_sg.SECURITYGROUPS])):"},{"line_number":912,"context_line":"            # delete the port binding and read it with the new rules"},{"line_number":913,"context_line":"            updated_device_owner \u003d updated_port.get(\u0027device_owner\u0027)"},{"line_number":914,"context_line":"            port_updates.update(device_owner\u003dupdated_device_owner)"},{"line_number":915,"context_line":"            port_updates[ext_sg.SECURITYGROUPS] \u003d ("},{"line_number":916,"context_line":"                self._get_security_groups_on_port(context, port))"},{"line_number":917,"context_line":"            self._delete_port_security_group_bindings(context, id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_7712e1ff","line":914,"in_reply_to":"3fa7e38b_e91b5f6c","updated":"2020-01-15 16:18:36.000000000","message":"Then use the original port info in _get_security_groups_on_port. But why you should modify \"port_updates\"? The goal of is to check that the port is trusted (as checked in \"_get_security_groups_on_port\"). You can pass the original port to this method.","commit_id":"e31d4682e55945394828417781e1176c2394ca75"},{"author":{"_account_id":29870,"name":"sunxifa","email":"sunxifa@inspur.com","username":"sunxifa"},"change_message_id":"03d6fd2a244d6d82cd52d8d3048ca6c5b102ec29","unresolved":false,"context_lines":[{"line_number":911,"context_line":"                port_updates[ext_sg.SECURITYGROUPS])):"},{"line_number":912,"context_line":"            # delete the port binding and read it with the new rules"},{"line_number":913,"context_line":"            updated_device_owner \u003d updated_port.get(\u0027device_owner\u0027)"},{"line_number":914,"context_line":"            port_updates.update(device_owner\u003dupdated_device_owner)"},{"line_number":915,"context_line":"            port_updates[ext_sg.SECURITYGROUPS] \u003d ("},{"line_number":916,"context_line":"                self._get_security_groups_on_port(context, port))"},{"line_number":917,"context_line":"            self._delete_port_security_group_bindings(context, id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_add9d3f1","line":914,"in_reply_to":"3fa7e38b_edeeebb4","updated":"2020-01-17 02:12:14.000000000","message":"OK,that would be more clear","commit_id":"e31d4682e55945394828417781e1176c2394ca75"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"87961ada0239699dd5ae6ecca9d722a165b59b90","unresolved":false,"context_lines":[{"line_number":911,"context_line":"                port_updates[ext_sg.SECURITYGROUPS])):"},{"line_number":912,"context_line":"            # delete the port binding and read it with the new rules"},{"line_number":913,"context_line":"            port[\u0027device_owner\u0027] \u003d port.get(\u0027device_owner\u0027,"},{"line_number":914,"context_line":"                                            updated_port[\u0027device_owner\u0027])"},{"line_number":915,"context_line":"            port_updates[ext_sg.SECURITYGROUPS] \u003d ("},{"line_number":916,"context_line":"                self._get_security_groups_on_port(context, port))"},{"line_number":917,"context_line":"            self._delete_port_security_group_bindings(context, id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_b5028a70","line":914,"updated":"2020-02-04 13:29:36.000000000","message":"this doesn\u0027t match comment above, You are not deleting port binding here","commit_id":"293b478a233aac3e4b360c6a3a434cfa20fb6728"}]}
