)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"82e968fd8293405d44f4de048dfcf5bf6e1bd7c8","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Send notification when port\u0027ip changes"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"with ml2 plugin, when a port ip changes, it should send"},{"line_number":10,"context_line":"\u0027is_security_group_member_updated\u0027 notification to other"},{"line_number":11,"context_line":"l2 agent."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I2e7622d2db4c173ac879a95a6e0adf92b858fe82"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9abe1de1_0bc78d13","line":10,"updated":"2015-04-27 10:12:24.000000000","message":"what do you mean \"to other l2 agent\" ?","commit_id":"90f99864240a60c2e89b804410ac71ab954a9909"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"83d293a32db7358958d56cee0fdba8027c55f170","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Send notification when port\u0027ip changes"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"with ml2 plugin, when a port ip changes, it should send"},{"line_number":10,"context_line":"\u0027is_security_group_member_updated\u0027 notification to other"},{"line_number":11,"context_line":"l2 agent."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I2e7622d2db4c173ac879a95a6e0adf92b858fe82"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"7ad32947_21ca57a2","line":10,"in_reply_to":"9abe1de1_0bc78d13","updated":"2015-04-28 03:41:36.000000000","message":"I am sorry that this is confused, I mean that when a port\u0027ip change, it also need notify the other l2 agents which have same security group with this changed port.","commit_id":"90f99864240a60c2e89b804410ac71ab954a9909"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"5b9a0b835638eca2620fcc173771e14f74a3ab61","unresolved":false,"context_lines":[{"line_number":11,"context_line":"agents which have same security group with this changed port."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I2e7622d2db4c173ac879a95a6e0adf92b858fe82"},{"line_number":14,"context_line":"Closes-bug: 1448022"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7a016987_72458c15","line":14,"updated":"2015-05-16 20:58:17.000000000","message":"please put a # in front of the bug number so it gets linked to from the launchpad bug automatically","commit_id":"09f9b1569e337b0d21c6cd6f202079965983107a"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"546a879a618eab8bc9f1e6004af2ad4d749c9ea0","unresolved":false,"context_lines":[{"line_number":11,"context_line":"agents which have same security group with this changed port."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I2e7622d2db4c173ac879a95a6e0adf92b858fe82"},{"line_number":14,"context_line":"Closes-bug: 1448022"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7a016987_f8e39d31","line":14,"in_reply_to":"7a016987_72458c15","updated":"2015-05-17 01:58:03.000000000","message":"thanks, I forgot it!","commit_id":"09f9b1569e337b0d21c6cd6f202079965983107a"},{"author":{"_account_id":9423,"name":"Roey Chen","email":"roeyc@vmware.com","username":"roeyc"},"change_message_id":"35422dd56daed1721e99e09c7b9cc1edd5c7e08b","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     shihanzhang \u003cshihanzhang@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-06-04 08:54:38 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Send \u0027security_groups_member_updated\u0027 when port\u0027ip changes"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"with ml2 plugin, when a port ip changes, it should send"},{"line_number":10,"context_line":"\u0027security_groups_member_updated\u0027 message to other l2"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":14,"id":"3afb71cf_35195a89","line":7,"updated":"2015-06-07 16:37:15.000000000","message":"typo","commit_id":"8f55f654d60bac2773b923cbd6edc3c322069cb7"}],"neutron/db/securitygroups_rpc_base.py":[{"author":{"_account_id":704,"name":"Edgar Magana","email":"emagana@gmail.com","username":"emagana"},"change_message_id":"dd96447bf09f3b5c6189791bb235d8c648e83e1c","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                original_port[ext_sg.SECURITYGROUPS])"},{"line_number":120,"context_line":"        return need_notify"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def check_security_group_member_ip_changed(self, context,"},{"line_number":123,"context_line":"                                               original_port, updated_port):"},{"line_number":124,"context_line":"        if original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027]:"},{"line_number":125,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3acd31a7_7576d03f","line":122,"updated":"2015-04-29 22:24:54.000000000","message":"This is a helper def I would recommend to start the name with \"_\"","commit_id":"c1956675d28ad7c7574457f1db5851368ce2c7ab"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"1816f4554905965087557528665a03b004fdeb57","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                original_port[ext_sg.SECURITYGROUPS])"},{"line_number":120,"context_line":"        return need_notify"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def check_security_group_member_ip_changed(self, context,"},{"line_number":123,"context_line":"                                               original_port, updated_port):"},{"line_number":124,"context_line":"        if original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027]:"},{"line_number":125,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3acd31a7_e7ff85a8","line":122,"in_reply_to":"3acd31a7_7576d03f","updated":"2015-05-04 03:11:03.000000000","message":"hi Edgar, thanks very much for your suggestion, I want add a method not just for ml2 plugin, so I put this method in this \u0027securitygroups_rpc_base.py\u0027 file, if I put this method in ml2/plugin.py, I think it is better to start the name with \"_\", do you agree?","commit_id":"c1956675d28ad7c7574457f1db5851368ce2c7ab"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"5b9a0b835638eca2620fcc173771e14f74a3ab61","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    def check_and_notify_security_group_member_changed("},{"line_number":123,"context_line":"            self, context, original_port, updated_port):"},{"line_number":124,"context_line":"        if (original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027] or"},{"line_number":125,"context_line":"            not utils.compare_elements("},{"line_number":126,"context_line":"                original_port.get(ext_sg.SECURITYGROUPS),"},{"line_number":127,"context_line":"                updated_port.get(ext_sg.SECURITYGROUPS))):"},{"line_number":128,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a016987_b262e4ab","line":125,"updated":"2015-05-16 20:58:17.000000000","message":"these two compare elements calls are the same, you can cut down the code a bunch by saving the result.\n\nsg_change \u003d not utils.compare_elements(\n    original_port.get(ext_sg.SECURITYGROUPS),\n    updated_port.get(ext_sg.SECURITYGROUPS))\n\nif original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027] or sg_change:\n    self.notify_security_groups_member_updated(context, updated_port)\nif sg_change:\n    self.notify_security_groups_member_updated(context, original_port)","commit_id":"09f9b1569e337b0d21c6cd6f202079965983107a"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"546a879a618eab8bc9f1e6004af2ad4d749c9ea0","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    def check_and_notify_security_group_member_changed("},{"line_number":123,"context_line":"            self, context, original_port, updated_port):"},{"line_number":124,"context_line":"        if (original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027] or"},{"line_number":125,"context_line":"            not utils.compare_elements("},{"line_number":126,"context_line":"                original_port.get(ext_sg.SECURITYGROUPS),"},{"line_number":127,"context_line":"                updated_port.get(ext_sg.SECURITYGROUPS))):"},{"line_number":128,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a016987_d8d10159","line":125,"in_reply_to":"7a016987_b262e4ab","updated":"2015-05-17 01:58:03.000000000","message":"thanks for your suggetion","commit_id":"09f9b1569e337b0d21c6cd6f202079965983107a"},{"author":{"_account_id":7987,"name":"Ivar Lazzaro","email":"ivarlazzaro@gmail.com","username":"Ivar"},"change_message_id":"c437454bf85b22462808a8adcc644c967ab7c946","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        sg_change \u003d not utils.compare_elements("},{"line_number":125,"context_line":"            original_port.get(ext_sg.SECURITYGROUPS),"},{"line_number":126,"context_line":"            updated_port.get(ext_sg.SECURITYGROUPS))"},{"line_number":127,"context_line":"        if (original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027]"},{"line_number":128,"context_line":"            or sg_change):"},{"line_number":129,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"},{"line_number":130,"context_line":"        if sg_change:"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a016987_4895bf30","line":127,"updated":"2015-05-22 19:39:51.000000000","message":"Another reason for notifying related agents is when a port security group membership is updated.\n\nPlease see https://bugs.launchpad.net/neutron/+bug/1455630","commit_id":"d128a6d804c68afa4f9d54e3cbd226f75f6648fd"},{"author":{"_account_id":7987,"name":"Ivar Lazzaro","email":"ivarlazzaro@gmail.com","username":"Ivar"},"change_message_id":"2596e8b64049de904edbb75a0a9ed03d6baff90e","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        sg_change \u003d not utils.compare_elements("},{"line_number":125,"context_line":"            original_port.get(ext_sg.SECURITYGROUPS),"},{"line_number":126,"context_line":"            updated_port.get(ext_sg.SECURITYGROUPS))"},{"line_number":127,"context_line":"        if (original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027]"},{"line_number":128,"context_line":"            or sg_change):"},{"line_number":129,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"},{"line_number":130,"context_line":"        if sg_change:"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a016987_e8fb4b77","line":127,"in_reply_to":"7a016987_4895bf30","updated":"2015-05-22 19:42:04.000000000","message":"I just realized that is done afterwards, apologies :)","commit_id":"d128a6d804c68afa4f9d54e3cbd226f75f6648fd"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"faa972b4fe101594414f060aae4619d69329eea5","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        sg_change \u003d not utils.compare_elements("},{"line_number":126,"context_line":"            original_port.get(ext_sg.SECURITYGROUPS),"},{"line_number":127,"context_line":"            updated_port.get(ext_sg.SECURITYGROUPS))"},{"line_number":128,"context_line":"        if (original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027]"},{"line_number":129,"context_line":"            or sg_change):"},{"line_number":130,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"},{"line_number":131,"context_line":"        if sg_change:"}],"source_content_type":"text/x-python","patch_set":12,"id":"5afe65bd_e1456b17","line":128,"updated":"2015-06-02 09:28:16.000000000","message":"It would be nice if we had a constant for \u0027fixed_ips\u0027 somewhere in neutron (neutron/common/constants), but that doesn\u0027t belong to your patch. :)","commit_id":"34b4ddbc8d318187b019a89102795bbe2b9e7f9e"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"def78aeefb34e45156cb2c30ea2fbd6008d30951","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        sg_change \u003d not utils.compare_elements("},{"line_number":126,"context_line":"            original_port.get(ext_sg.SECURITYGROUPS),"},{"line_number":127,"context_line":"            updated_port.get(ext_sg.SECURITYGROUPS))"},{"line_number":128,"context_line":"        if (original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027]"},{"line_number":129,"context_line":"            or sg_change):"},{"line_number":130,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"},{"line_number":131,"context_line":"        if sg_change:"}],"source_content_type":"text/x-python","patch_set":12,"id":"5afe65bd_e13e66d9","line":128,"in_reply_to":"5afe65bd_1d78e7c3","updated":"2015-06-03 00:42:55.000000000","message":"ok","commit_id":"34b4ddbc8d318187b019a89102795bbe2b9e7f9e"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"48b5d338219d400e2960513adb6bd1153cb605e0","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        sg_change \u003d not utils.compare_elements("},{"line_number":126,"context_line":"            original_port.get(ext_sg.SECURITYGROUPS),"},{"line_number":127,"context_line":"            updated_port.get(ext_sg.SECURITYGROUPS))"},{"line_number":128,"context_line":"        if (original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027]"},{"line_number":129,"context_line":"            or sg_change):"},{"line_number":130,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"},{"line_number":131,"context_line":"        if sg_change:"}],"source_content_type":"text/x-python","patch_set":12,"id":"5afe65bd_1d78e7c3","line":128,"in_reply_to":"5afe65bd_a1ff7333","updated":"2015-06-02 12:25:44.000000000","message":"no need to work on that within this patch, I believe that\u0027s out of scope since we don\u0027t even have a constant.. it probably belongs to a refactor patch if we wanted to do such thing.","commit_id":"34b4ddbc8d318187b019a89102795bbe2b9e7f9e"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"041d9e93e5c26f8cfbdd1c8aa64672c208d98dd9","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        sg_change \u003d not utils.compare_elements("},{"line_number":126,"context_line":"            original_port.get(ext_sg.SECURITYGROUPS),"},{"line_number":127,"context_line":"            updated_port.get(ext_sg.SECURITYGROUPS))"},{"line_number":128,"context_line":"        if (original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027]"},{"line_number":129,"context_line":"            or sg_change):"},{"line_number":130,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"},{"line_number":131,"context_line":"        if sg_change:"}],"source_content_type":"text/x-python","patch_set":12,"id":"5afe65bd_a1ff7333","line":128,"in_reply_to":"5afe65bd_e1456b17","updated":"2015-06-02 11:10:29.000000000","message":"yes it is better to has a constant for \u0027fixed_ips\u0027, \u0027fixed_ips\u0027 is used at many places","commit_id":"34b4ddbc8d318187b019a89102795bbe2b9e7f9e"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"faa972b4fe101594414f060aae4619d69329eea5","unresolved":false,"context_lines":[{"line_number":129,"context_line":"            or sg_change):"},{"line_number":130,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"},{"line_number":131,"context_line":"        if sg_change:"},{"line_number":132,"context_line":"            self.notify_security_groups_member_updated(context, original_port)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def is_security_group_member_updated(self, context,"},{"line_number":135,"context_line":"                                         original_port, updated_port):"}],"source_content_type":"text/x-python","patch_set":12,"id":"5afe65bd_213143a3","line":132,"updated":"2015-06-02 09:28:16.000000000","message":"Hmm, why do we resend to original_port on sg_change ? \n\nIsn\u0027t that going to revert the change?","commit_id":"34b4ddbc8d318187b019a89102795bbe2b9e7f9e"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"48b5d338219d400e2960513adb6bd1153cb605e0","unresolved":false,"context_lines":[{"line_number":129,"context_line":"            or sg_change):"},{"line_number":130,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"},{"line_number":131,"context_line":"        if sg_change:"},{"line_number":132,"context_line":"            self.notify_security_groups_member_updated(context, original_port)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def is_security_group_member_updated(self, context,"},{"line_number":135,"context_line":"                                         original_port, updated_port):"}],"source_content_type":"text/x-python","patch_set":12,"id":"5afe65bd_5d441f73","line":132,"in_reply_to":"5afe65bd_0f030d44","updated":"2015-06-02 12:25:44.000000000","message":"Ahh, I got it, could you include a comment into the code to explain this specific case under the \"if sg_change\" ? \n\nThanks for the explanation.","commit_id":"34b4ddbc8d318187b019a89102795bbe2b9e7f9e"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"041d9e93e5c26f8cfbdd1c8aa64672c208d98dd9","unresolved":false,"context_lines":[{"line_number":129,"context_line":"            or sg_change):"},{"line_number":130,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"},{"line_number":131,"context_line":"        if sg_change:"},{"line_number":132,"context_line":"            self.notify_security_groups_member_updated(context, original_port)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def is_security_group_member_updated(self, context,"},{"line_number":135,"context_line":"                                         original_port, updated_port):"}],"source_content_type":"text/x-python","patch_set":12,"id":"5afe65bd_0f030d44","line":132,"in_reply_to":"5afe65bd_213143a3","updated":"2015-06-02 11:10:29.000000000","message":"in below use case, it should notify the security group of original_port:\nport A in sg A, port B in sg B, port C in sg C, sg A can access with sg B, when port A update it\u0027s sg to sg C, it should notify sg C and sg B, so it should send nitify to updated_port and  original_port.","commit_id":"34b4ddbc8d318187b019a89102795bbe2b9e7f9e"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"def78aeefb34e45156cb2c30ea2fbd6008d30951","unresolved":false,"context_lines":[{"line_number":129,"context_line":"            or sg_change):"},{"line_number":130,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"},{"line_number":131,"context_line":"        if sg_change:"},{"line_number":132,"context_line":"            self.notify_security_groups_member_updated(context, original_port)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def is_security_group_member_updated(self, context,"},{"line_number":135,"context_line":"                                         original_port, updated_port):"}],"source_content_type":"text/x-python","patch_set":12,"id":"5afe65bd_a1218eb6","line":132,"in_reply_to":"5afe65bd_5d441f73","updated":"2015-06-03 00:42:55.000000000","message":"thx for your suggestion, I agree to add comment","commit_id":"34b4ddbc8d318187b019a89102795bbe2b9e7f9e"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"91b2a5019aaa8004c39fb811fe3c054285a3643f","unresolved":false,"context_lines":[{"line_number":127,"context_line":"            updated_port.get(ext_sg.SECURITYGROUPS))"},{"line_number":128,"context_line":"        if (original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027]"},{"line_number":129,"context_line":"            or sg_change):"},{"line_number":130,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"},{"line_number":131,"context_line":"        # If port update it\u0027s security group form one to another, it also need"},{"line_number":132,"context_line":"        # to notify the original security group."},{"line_number":133,"context_line":"        if sg_change:"}],"source_content_type":"text/x-python","patch_set":14,"id":"3afb71cf_a1362ce5","line":130,"updated":"2015-06-08 01:13:45.000000000","message":"+1, but it can be even simpler than that because the set logic already exists in notify_security_groups_member_updated_bulk.\n\nif sg_change:\n    self.notify_security_groups_member_updated_bulk(\n        context, [original_port, updated_port])\nelif original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027]:\n    self.notify_security_groups_member_updated(context, updated_port)","commit_id":"8f55f654d60bac2773b923cbd6edc3c322069cb7"},{"author":{"_account_id":9423,"name":"Roey Chen","email":"roeyc@vmware.com","username":"roeyc"},"change_message_id":"35422dd56daed1721e99e09c7b9cc1edd5c7e08b","unresolved":false,"context_lines":[{"line_number":127,"context_line":"            updated_port.get(ext_sg.SECURITYGROUPS))"},{"line_number":128,"context_line":"        if (original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027]"},{"line_number":129,"context_line":"            or sg_change):"},{"line_number":130,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"},{"line_number":131,"context_line":"        # If port update it\u0027s security group form one to another, it also need"},{"line_number":132,"context_line":"        # to notify the original security group."},{"line_number":133,"context_line":"        if sg_change:"}],"source_content_type":"text/x-python","patch_set":14,"id":"3afb71cf_c097e68e","line":130,"updated":"2015-06-07 16:37:15.000000000","message":"I think you could just call the notifier directly with the list of relevant security-groups\n\nsecurity_groups \u003d set(original_port[ext_sg.SECURITYGROUPS] + updated_port[ext_sg.SECURITYGROUPS])\nself.notifier.security_groups_member_updated(context, security_groups)\n\nthis way you can remove the next if-block, and you save duplicate processing for security-groups which are in original_port and update_port.","commit_id":"8f55f654d60bac2773b923cbd6edc3c322069cb7"},{"author":{"_account_id":9423,"name":"Roey Chen","email":"roeyc@vmware.com","username":"roeyc"},"change_message_id":"35422dd56daed1721e99e09c7b9cc1edd5c7e08b","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        if (original_port[\u0027fixed_ips\u0027] !\u003d updated_port[\u0027fixed_ips\u0027]"},{"line_number":129,"context_line":"            or sg_change):"},{"line_number":130,"context_line":"            self.notify_security_groups_member_updated(context, updated_port)"},{"line_number":131,"context_line":"        # If port update it\u0027s security group form one to another, it also need"},{"line_number":132,"context_line":"        # to notify the original security group."},{"line_number":133,"context_line":"        if sg_change:"},{"line_number":134,"context_line":"            self.notify_security_groups_member_updated(context, original_port)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3afb71cf_ac7d0b1e","line":131,"updated":"2015-06-07 16:37:15.000000000","message":"s/form/from","commit_id":"8f55f654d60bac2773b923cbd6edc3c322069cb7"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"82e968fd8293405d44f4de048dfcf5bf6e1bd7c8","unresolved":false,"context_lines":[{"line_number":1152,"context_line":"        # either undo/retry the operation or delete the resource."},{"line_number":1153,"context_line":"        self.mechanism_manager.update_port_postcommit(mech_context)"},{"line_number":1154,"context_line":""},{"line_number":1155,"context_line":"        self.check_security_group_member_ip_changed("},{"line_number":1156,"context_line":"            context, original_port, updated_port)"},{"line_number":1157,"context_line":"        need_port_update_notify |\u003d self.is_security_group_member_updated("},{"line_number":1158,"context_line":"            context, original_port, updated_port)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9abe1de1_eb64594a","line":1155,"updated":"2015-04-27 10:12:24.000000000","message":"I would change this method name to something like \"notify_security_group_member_if/on_ip_changed\"\n\n(Because it is notifying...)","commit_id":"90f99864240a60c2e89b804410ac71ab954a9909"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"83d293a32db7358958d56cee0fdba8027c55f170","unresolved":false,"context_lines":[{"line_number":1152,"context_line":"        # either undo/retry the operation or delete the resource."},{"line_number":1153,"context_line":"        self.mechanism_manager.update_port_postcommit(mech_context)"},{"line_number":1154,"context_line":""},{"line_number":1155,"context_line":"        self.check_security_group_member_ip_changed("},{"line_number":1156,"context_line":"            context, original_port, updated_port)"},{"line_number":1157,"context_line":"        need_port_update_notify |\u003d self.is_security_group_member_updated("},{"line_number":1158,"context_line":"            context, original_port, updated_port)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7ad32947_818dab7d","line":1155,"in_reply_to":"9abe1de1_eb64594a","updated":"2015-04-28 03:41:36.000000000","message":"I just want add a common method in securitygroups_rpc_base.py  \nnot just for ml2 plugin, if it just for ml2 plugin, I can directly use notify_security_groups_member_updated like create_port()","commit_id":"90f99864240a60c2e89b804410ac71ab954a9909"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"9a9f98882489b2275cdd6e374341731527eca5d6","unresolved":false,"context_lines":[{"line_number":1154,"context_line":""},{"line_number":1155,"context_line":"        self.check_security_group_member_ip_changed("},{"line_number":1156,"context_line":"            context, original_port, updated_port)"},{"line_number":1157,"context_line":"        need_port_update_notify |\u003d self.is_security_group_member_updated("},{"line_number":1158,"context_line":"            context, original_port, updated_port)"},{"line_number":1159,"context_line":""},{"line_number":1160,"context_line":"        if original_port[\u0027admin_state_up\u0027] !\u003d updated_port[\u0027admin_state_up\u0027]:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3acd31a7_6048505c","line":1157,"updated":"2015-04-29 22:49:38.000000000","message":"This function here checks what you are checking above. Remove your function and adjust this:\n\nif self.is_security_group_member_updated(context, original_port,\n                                         updated_port):\n    self.notify_security_groups_member_updated(context, updated_port)","commit_id":"c1956675d28ad7c7574457f1db5851368ce2c7ab"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"1816f4554905965087557528665a03b004fdeb57","unresolved":false,"context_lines":[{"line_number":1154,"context_line":""},{"line_number":1155,"context_line":"        self.check_security_group_member_ip_changed("},{"line_number":1156,"context_line":"            context, original_port, updated_port)"},{"line_number":1157,"context_line":"        need_port_update_notify |\u003d self.is_security_group_member_updated("},{"line_number":1158,"context_line":"            context, original_port, updated_port)"},{"line_number":1159,"context_line":""},{"line_number":1160,"context_line":"        if original_port[\u0027admin_state_up\u0027] !\u003d updated_port[\u0027admin_state_up\u0027]:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3acd31a7_075721cf","line":1157,"in_reply_to":"3acd31a7_6048505c","updated":"2015-05-04 03:11:03.000000000","message":"hi Kevin, thanks for your review and suggestion. in \u0027is_security_group_member_updated\u0027, if port\u0027s mac changes, it  \nwill return True, but it does not need sending \u0027notify_security_groups_member_updated\u0027, so I add a new method just to verify the port\u0027s IP change","commit_id":"c1956675d28ad7c7574457f1db5851368ce2c7ab"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"8bf581637b1b2e778e94d9c885568032120e355f","unresolved":false,"context_lines":[{"line_number":1152,"context_line":"        # either undo/retry the operation or delete the resource."},{"line_number":1153,"context_line":"        self.mechanism_manager.update_port_postcommit(mech_context)"},{"line_number":1154,"context_line":""},{"line_number":1155,"context_line":"        self.check_security_group_member_ip_changed("},{"line_number":1156,"context_line":"            context, original_port, updated_port)"},{"line_number":1157,"context_line":"        need_port_update_notify |\u003d self.is_security_group_member_updated("},{"line_number":1158,"context_line":"            context, original_port, updated_port)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aca2d91_38002f34","line":1155,"updated":"2015-05-07 03:15:29.000000000","message":"please rename this to indicate that it will send a notification.\n\ncheck_and_notify_security_group_member_ip_changed","commit_id":"c0574caf695ab94b61c505e847aa4424f539b6d8"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"0bd8078b4643ef1742c9fc9c6379b404aa5f9e12","unresolved":false,"context_lines":[{"line_number":1152,"context_line":"        # either undo/retry the operation or delete the resource."},{"line_number":1153,"context_line":"        self.mechanism_manager.update_port_postcommit(mech_context)"},{"line_number":1154,"context_line":""},{"line_number":1155,"context_line":"        self.check_security_group_member_ip_changed("},{"line_number":1156,"context_line":"            context, original_port, updated_port)"},{"line_number":1157,"context_line":"        need_port_update_notify |\u003d self.is_security_group_member_updated("},{"line_number":1158,"context_line":"            context, original_port, updated_port)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aca2d91_d8637b19","line":1155,"in_reply_to":"1aca2d91_38002f34","updated":"2015-05-07 03:18:24.000000000","message":"agree, thanks for your good suggestion","commit_id":"c0574caf695ab94b61c505e847aa4424f539b6d8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"83021b703b3a29323492214da9f42d2028f2530f","unresolved":false,"context_lines":[{"line_number":1154,"context_line":""},{"line_number":1155,"context_line":"        self.check_security_group_member_ip_changed("},{"line_number":1156,"context_line":"            context, original_port, updated_port)"},{"line_number":1157,"context_line":"        need_port_update_notify |\u003d self.is_security_group_member_updated("},{"line_number":1158,"context_line":"            context, original_port, updated_port)"},{"line_number":1159,"context_line":""},{"line_number":1160,"context_line":"        if original_port[\u0027admin_state_up\u0027] !\u003d updated_port[\u0027admin_state_up\u0027]:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3acd31a7_0708412b","line":1157,"updated":"2015-05-04 04:13:31.000000000","message":"You\u0027re right that it\u0027s for the MAC change as well, but the security group rules need to be updated in that case too so the MAC spoofing rules are correct here: https://github.com/openstack/neutron/blob/master/neutron/agent/linux/iptables_firewall.py#L288\n\nPlease use the is_security_group_member_updated function because both cases it covers require an iptables refresh.","commit_id":"c0574caf695ab94b61c505e847aa4424f539b6d8"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"0bd8078b4643ef1742c9fc9c6379b404aa5f9e12","unresolved":false,"context_lines":[{"line_number":1154,"context_line":""},{"line_number":1155,"context_line":"        self.check_security_group_member_ip_changed("},{"line_number":1156,"context_line":"            context, original_port, updated_port)"},{"line_number":1157,"context_line":"        need_port_update_notify |\u003d self.is_security_group_member_updated("},{"line_number":1158,"context_line":"            context, original_port, updated_port)"},{"line_number":1159,"context_line":""},{"line_number":1160,"context_line":"        if original_port[\u0027admin_state_up\u0027] !\u003d updated_port[\u0027admin_state_up\u0027]:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aca2d91_b868bff6","line":1157,"in_reply_to":"1aca2d91_58dc0be4","updated":"2015-05-07 03:18:24.000000000","message":"Done","commit_id":"c0574caf695ab94b61c505e847aa4424f539b6d8"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"93ad3abc2a87107ef4c124f3508fe6921dc69d64","unresolved":false,"context_lines":[{"line_number":1154,"context_line":""},{"line_number":1155,"context_line":"        self.check_security_group_member_ip_changed("},{"line_number":1156,"context_line":"            context, original_port, updated_port)"},{"line_number":1157,"context_line":"        need_port_update_notify |\u003d self.is_security_group_member_updated("},{"line_number":1158,"context_line":"            context, original_port, updated_port)"},{"line_number":1159,"context_line":""},{"line_number":1160,"context_line":"        if original_port[\u0027admin_state_up\u0027] !\u003d updated_port[\u0027admin_state_up\u0027]:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3acd31a7_600d9b36","line":1157,"in_reply_to":"3acd31a7_0708412b","updated":"2015-05-04 06:56:20.000000000","message":"if port MAC change or security group rules update, it will send \u0027_notify_port_updated\u0027 in _bind_port_if_needed, so the the host that this port residing on will  refresh it\u0027s iptables, when port\u0027s ip change, it also need send \u0027notify_security_groups_member_updated\u0027 to other l2\nagents which have same security group with this changed port, do you agree?","commit_id":"c0574caf695ab94b61c505e847aa4424f539b6d8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"8bf581637b1b2e778e94d9c885568032120e355f","unresolved":false,"context_lines":[{"line_number":1154,"context_line":""},{"line_number":1155,"context_line":"        self.check_security_group_member_ip_changed("},{"line_number":1156,"context_line":"            context, original_port, updated_port)"},{"line_number":1157,"context_line":"        need_port_update_notify |\u003d self.is_security_group_member_updated("},{"line_number":1158,"context_line":"            context, original_port, updated_port)"},{"line_number":1159,"context_line":""},{"line_number":1160,"context_line":"        if original_port[\u0027admin_state_up\u0027] !\u003d updated_port[\u0027admin_state_up\u0027]:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aca2d91_58dc0be4","line":1157,"in_reply_to":"3acd31a7_600d9b36","updated":"2015-05-07 03:15:29.000000000","message":"oh, i see. the issue is with other hosts, not the one that the port is on.","commit_id":"c0574caf695ab94b61c505e847aa4424f539b6d8"},{"author":{"_account_id":7987,"name":"Ivar Lazzaro","email":"ivarlazzaro@gmail.com","username":"Ivar"},"change_message_id":"c437454bf85b22462808a8adcc644c967ab7c946","unresolved":false,"context_lines":[{"line_number":1154,"context_line":"        # either undo/retry the operation or delete the resource."},{"line_number":1155,"context_line":"        self.mechanism_manager.update_port_postcommit(mech_context)"},{"line_number":1156,"context_line":""},{"line_number":1157,"context_line":"        self.check_and_notify_security_group_member_changed("},{"line_number":1158,"context_line":"            context, original_port, updated_port)"},{"line_number":1159,"context_line":"        need_port_update_notify |\u003d self.is_security_group_member_updated("},{"line_number":1160,"context_line":"            context, original_port, updated_port)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a016987_48bc9fba","line":1157,"updated":"2015-05-22 19:39:51.000000000","message":"Is this notification useful for unbound ports?","commit_id":"d128a6d804c68afa4f9d54e3cbd226f75f6648fd"}],"neutron/tests/unit/plugins/ml2/test_plugin.py":[{"author":{"_account_id":9423,"name":"Roey Chen","email":"roeyc@vmware.com","username":"roeyc"},"change_message_id":"28344547f765f2c103ef9cc8386caa2df868c5a1","unresolved":false,"context_lines":[{"line_number":398,"context_line":"    def test_update_port_fixed_ip_changed(self):"},{"line_number":399,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":400,"context_line":"        plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":401,"context_line":"        with contextlib.nested("},{"line_number":402,"context_line":"            self.port(),"},{"line_number":403,"context_line":"            mock.patch.object(plugin.notifier,"},{"line_number":404,"context_line":"                              \u0027security_groups_member_updated\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3acd31a7_7bf5b081","line":401,"updated":"2015-04-29 16:35:01.000000000","message":"contextlib.nested is deprecated.\nsee https://bugs.launchpad.net/nova/+bug/1428424 for details.\n\nyou can do the following:\n\nwith self.port() as port, mock.patch.object(plugin.notifier,    \n    \u0027security_groups_member_updated\u0027) as sg_member_update:\n\nor use \u0027\\\u0027 to add a new line","commit_id":"c1956675d28ad7c7574457f1db5851368ce2c7ab"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"1816f4554905965087557528665a03b004fdeb57","unresolved":false,"context_lines":[{"line_number":398,"context_line":"    def test_update_port_fixed_ip_changed(self):"},{"line_number":399,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":400,"context_line":"        plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":401,"context_line":"        with contextlib.nested("},{"line_number":402,"context_line":"            self.port(),"},{"line_number":403,"context_line":"            mock.patch.object(plugin.notifier,"},{"line_number":404,"context_line":"                              \u0027security_groups_member_updated\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3acd31a7_5a5bb154","line":401,"in_reply_to":"3acd31a7_7bf5b081","updated":"2015-05-04 03:11:03.000000000","message":"agree, thanks for your review and suggestion!","commit_id":"c1956675d28ad7c7574457f1db5851368ce2c7ab"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"faa972b4fe101594414f060aae4619d69329eea5","unresolved":false,"context_lines":[{"line_number":411,"context_line":"            port[\u0027port\u0027][\u0027fixed_ips\u0027][0][\u0027ip_address\u0027] \u003d \u002710.0.0.3\u0027"},{"line_number":412,"context_line":"            plugin.update_port(ctx, port[\u0027port\u0027][\u0027id\u0027], port)"},{"line_number":413,"context_line":"            self.assertTrue(sg_member_update.called)"},{"line_number":414,"context_line":""},{"line_number":415,"context_line":"    def test_update_port_mac(self):"},{"line_number":416,"context_line":"        self.check_update_port_mac("},{"line_number":417,"context_line":"            host_arg\u003d{portbindings.HOST_ID: HOST},"}],"source_content_type":"text/x-python","patch_set":12,"id":"5afe65bd_21d82353","line":414,"updated":"2015-06-02 09:28:16.000000000","message":"I would add a test for the \"sg_change\" case.","commit_id":"34b4ddbc8d318187b019a89102795bbe2b9e7f9e"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"041d9e93e5c26f8cfbdd1c8aa64672c208d98dd9","unresolved":false,"context_lines":[{"line_number":411,"context_line":"            port[\u0027port\u0027][\u0027fixed_ips\u0027][0][\u0027ip_address\u0027] \u003d \u002710.0.0.3\u0027"},{"line_number":412,"context_line":"            plugin.update_port(ctx, port[\u0027port\u0027][\u0027id\u0027], port)"},{"line_number":413,"context_line":"            self.assertTrue(sg_member_update.called)"},{"line_number":414,"context_line":""},{"line_number":415,"context_line":"    def test_update_port_mac(self):"},{"line_number":416,"context_line":"        self.check_update_port_mac("},{"line_number":417,"context_line":"            host_arg\u003d{portbindings.HOST_ID: HOST},"}],"source_content_type":"text/x-python","patch_set":12,"id":"5afe65bd_cf93b5f9","line":414,"in_reply_to":"5afe65bd_21d82353","updated":"2015-06-02 11:10:29.000000000","message":"agree, I find this bug in IP change use case, so I just add this test :), thx for your suggestion!","commit_id":"34b4ddbc8d318187b019a89102795bbe2b9e7f9e"}]}
