)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"9442f24f56e76915919c61fb18b87c2aaee594f0","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Correct floating IP updating issues"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Know issues:"},{"line_number":10,"context_line":"1. Unable to update floating IP to the same port_id that it already"},{"line_number":11,"context_line":"associated with. Nothing changed, but the neutron API will return a"},{"line_number":12,"context_line":"bad request exception."},{"line_number":13,"context_line":"2. Update floating IP extra attributes, for instance description,"},{"line_number":14,"context_line":"will unexpectedly disassociate it. This will interrupt the user\u0027s"},{"line_number":15,"context_line":"service traffic."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"3aaa91ec_24225ba3","line":12,"range":{"start_line":10,"start_character":0,"end_line":12,"end_character":22},"updated":"2016-06-27 05:03:13.000000000","message":"To be honest,I don\u0027t think this is an issue. If you associate a floating ip twice, neutron will report http conflict, and that the port already has an floatingip associated. To me, it is a reasonable output to tell user he/she is doing something wrong.","commit_id":"203d3cdafce857f46f7ee77f9cdbc7c062122d12"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d44f870fe59ceec31b764458ca170f1001a0daf2","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Correct floating IP updating issues"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Know issues:"},{"line_number":10,"context_line":"1. Unable to update floating IP to the same port_id that it already"},{"line_number":11,"context_line":"associated with. Nothing changed, but the neutron API will return a"},{"line_number":12,"context_line":"bad request exception."},{"line_number":13,"context_line":"2. Update floating IP extra attributes, for instance description,"},{"line_number":14,"context_line":"will unexpectedly disassociate it. This will interrupt the user\u0027s"},{"line_number":15,"context_line":"service traffic."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"3aaa91ec_ed015706","line":12,"range":{"start_line":10,"start_character":0,"end_line":12,"end_character":22},"in_reply_to":"3aaa91ec_24225ba3","updated":"2016-06-27 06:49:47.000000000","message":"OK, done, I will make description this more accuracy. Actually this issue was a test scenario I\u0027ve done for this bug. The first time I noticed that the floating IP was disassociated unexpectedly when I try to update the floating IP description, so then I try to update the description with its original port_id, finally the bad request comes.","commit_id":"203d3cdafce857f46f7ee77f9cdbc7c062122d12"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"dcb8ecc1ff2a658834b083eba239e441f3f321e0","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Correct floating IP updating issues"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Know issues:"},{"line_number":10,"context_line":"1. Unable to update floating IP to the same port_id that it already"},{"line_number":11,"context_line":"associated with. Nothing changed, but the neutron API will return a"},{"line_number":12,"context_line":"bad request exception."},{"line_number":13,"context_line":"2. Update floating IP extra attributes, for instance description,"},{"line_number":14,"context_line":"will unexpectedly disassociate it. This will interrupt the user\u0027s"},{"line_number":15,"context_line":"service traffic."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"3aaa91ec_704eda3b","line":12,"range":{"start_line":10,"start_character":0,"end_line":12,"end_character":22},"in_reply_to":"3aaa91ec_8da4134b","updated":"2016-06-27 07:22:58.000000000","message":"Yes, this patch aims to make that possible. You will be able to update the floating IP description without the port_id, and at the same time its association will be not changed. And an explicit `null` port_id will be required when user try to disassociate floating IP from a port.","commit_id":"203d3cdafce857f46f7ee77f9cdbc7c062122d12"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"64ecdd6bebb3a7610aace3efb98d1661c6496ea2","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Correct floating IP updating issues"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Know issues:"},{"line_number":10,"context_line":"1. Unable to update floating IP to the same port_id that it already"},{"line_number":11,"context_line":"associated with. Nothing changed, but the neutron API will return a"},{"line_number":12,"context_line":"bad request exception."},{"line_number":13,"context_line":"2. Update floating IP extra attributes, for instance description,"},{"line_number":14,"context_line":"will unexpectedly disassociate it. This will interrupt the user\u0027s"},{"line_number":15,"context_line":"service traffic."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"3aaa91ec_8da4134b","line":12,"range":{"start_line":10,"start_character":0,"end_line":12,"end_character":22},"in_reply_to":"3aaa91ec_ed015706","updated":"2016-06-27 07:07:16.000000000","message":"I think you can update the description without specifying port_id, based on this patch, right?","commit_id":"203d3cdafce857f46f7ee77f9cdbc7c062122d12"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"68f2923ef1262f9609fdbd35f3c49c773397da1c","unresolved":false,"context_lines":[{"line_number":16,"context_line":"So there is no way to update the floating IP extra attributes without"},{"line_number":17,"context_line":"changing it\u0027s association."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"This patch will make this work properly, after this patch, an explicit"},{"line_number":20,"context_line":"`null` port_id will be required when user try to disassociate floating"},{"line_number":21,"context_line":"IP from a port."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Closes-Bug: #1578523"},{"line_number":24,"context_line":"Change-Id: I036e473118431856550249359a22445380ef9ece"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"3aaa91ec_7a57a2ca","line":21,"range":{"start_line":19,"start_character":0,"end_line":21,"end_character":15},"updated":"2016-06-28 01:52:48.000000000","message":"This paragraph makes me think that this patch changes api, which is, before this patch, an explicit null is not required while, after this patch, it is required. And, if it changes api, an APIImpact will be required.\n\nBut, I think this patch is fixing the problem that, without specifying port_id, updating floatingip will disassociate it.\nSo, maybe this commit msg needs some updates.","commit_id":"157a3b82ac3a7eeb62fd238d49f19409c74dc0a9"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"920aad809822df68ab3251967db79cb88ab4ec38","unresolved":false,"context_lines":[{"line_number":16,"context_line":"So there is no way to update the floating IP extra attributes without"},{"line_number":17,"context_line":"changing it\u0027s association."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"This patch will make this work properly, after this patch, an explicit"},{"line_number":20,"context_line":"`null` port_id will be required when user try to disassociate floating"},{"line_number":21,"context_line":"IP from a port."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Closes-Bug: #1578523"},{"line_number":24,"context_line":"Change-Id: I036e473118431856550249359a22445380ef9ece"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"3aaa91ec_26ed0326","line":21,"range":{"start_line":19,"start_character":0,"end_line":21,"end_character":15},"in_reply_to":"3aaa91ec_7a57a2ca","updated":"2016-06-28 04:06:28.000000000","message":"Done, I will add a APIImpact, and make this more precise. Before this patch, if user submit a floating IP updating request without port_id, it will be disassociated by default. For instance:  \" -d \u0027{\"floatingip\": {}}\u0027 \". But after this patch, such kind of APIs will change nothing on a floating IP. AKA, an explicit `null` port_id will be required when user try to disassociate floating IP from a port. And Ryan Moats (rmoats) has already added a `API` tag to the LP bug.","commit_id":"157a3b82ac3a7eeb62fd238d49f19409c74dc0a9"}],"neutron/db/l3_db.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"1f9972e7bdc8ecb2804d5d5644c6267621e9fcc2","unresolved":false,"context_lines":[{"line_number":1058,"context_line":"        return (fip[\u0027port_id\u0027], internal_ip_address, router_id)"},{"line_number":1059,"context_line":""},{"line_number":1060,"context_line":"    def _check_and_get_fip_assoc(self, context, fip, floatingip_db):"},{"line_number":1061,"context_line":"        port_id \u003d internal_ip_address \u003d router_id \u003d None"},{"line_number":1062,"context_line":"        floating_network_id \u003d floatingip_db[\u0027floating_network_id\u0027]"},{"line_number":1063,"context_line":"        if fip.get(\u0027fixed_ip_address\u0027) and not fip.get(\u0027port_id\u0027):"},{"line_number":1064,"context_line":"            msg \u003d _(\"fixed_ip_address cannot be specified without a port_id\")"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_deecad2b","line":1061,"updated":"2016-06-22 16:17:59.000000000","message":"Seems you can do:\n\nport_id \u003d fip.get(\u0027port_id\u0027)\n\nIt should be None if port_id is not present.\n\nThen you can use it throughout here, and remove _get_assoc_data() completely, just call _get_fip_internal_data()","commit_id":"7969c5a1a60a98b69f3ba99537f1a3fbdef71724"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"c8e9998abacd8bb083826b56eba9e0b12829c494","unresolved":false,"context_lines":[{"line_number":1058,"context_line":"        return (fip[\u0027port_id\u0027], internal_ip_address, router_id)"},{"line_number":1059,"context_line":""},{"line_number":1060,"context_line":"    def _check_and_get_fip_assoc(self, context, fip, floatingip_db):"},{"line_number":1061,"context_line":"        port_id \u003d internal_ip_address \u003d router_id \u003d None"},{"line_number":1062,"context_line":"        floating_network_id \u003d floatingip_db[\u0027floating_network_id\u0027]"},{"line_number":1063,"context_line":"        if fip.get(\u0027fixed_ip_address\u0027) and not fip.get(\u0027port_id\u0027):"},{"line_number":1064,"context_line":"            msg \u003d _(\"fixed_ip_address cannot be specified without a port_id\")"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_b11bbd7f","line":1061,"in_reply_to":"3aaa91ec_deecad2b","updated":"2016-06-23 02:39:38.000000000","message":"Done","commit_id":"7969c5a1a60a98b69f3ba99537f1a3fbdef71724"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"0842971fb5c2fee7c3014ad3065195c21d0b6d41","unresolved":false,"context_lines":[{"line_number":1059,"context_line":""},{"line_number":1060,"context_line":"    def _check_and_get_fip_assoc(self, context, fip, floatingip_db):"},{"line_number":1061,"context_line":"        port_id \u003d internal_ip_address \u003d router_id \u003d None"},{"line_number":1062,"context_line":"        floating_network_id \u003d floatingip_db[\u0027floating_network_id\u0027]"},{"line_number":1063,"context_line":"        if fip.get(\u0027fixed_ip_address\u0027) and not fip.get(\u0027port_id\u0027):"},{"line_number":1064,"context_line":"            msg \u003d _(\"fixed_ip_address cannot be specified without a port_id\")"},{"line_number":1065,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027floatingip\u0027, msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a9d85d2_14775e3b","line":1062,"updated":"2016-06-20 13:48:55.000000000","message":"Nice! But please add new line after floating_network_id","commit_id":"7969c5a1a60a98b69f3ba99537f1a3fbdef71724"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"c8e9998abacd8bb083826b56eba9e0b12829c494","unresolved":false,"context_lines":[{"line_number":1059,"context_line":""},{"line_number":1060,"context_line":"    def _check_and_get_fip_assoc(self, context, fip, floatingip_db):"},{"line_number":1061,"context_line":"        port_id \u003d internal_ip_address \u003d router_id \u003d None"},{"line_number":1062,"context_line":"        floating_network_id \u003d floatingip_db[\u0027floating_network_id\u0027]"},{"line_number":1063,"context_line":"        if fip.get(\u0027fixed_ip_address\u0027) and not fip.get(\u0027port_id\u0027):"},{"line_number":1064,"context_line":"            msg \u003d _(\"fixed_ip_address cannot be specified without a port_id\")"},{"line_number":1065,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027floatingip\u0027, msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_6c5e9e13","line":1062,"in_reply_to":"5a9d85d2_14775e3b","updated":"2016-06-23 02:39:38.000000000","message":"Done","commit_id":"7969c5a1a60a98b69f3ba99537f1a3fbdef71724"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"1f9972e7bdc8ecb2804d5d5644c6267621e9fcc2","unresolved":false,"context_lines":[{"line_number":1068,"context_line":"                context,"},{"line_number":1069,"context_line":"                fip,"},{"line_number":1070,"context_line":"                floating_network_id)"},{"line_number":1071,"context_line":"            if (port_id and floatingip_db.fixed_port_id"},{"line_number":1072,"context_line":"                    and port_id \u003d\u003d floatingip_db.fixed_port_id):"},{"line_number":1073,"context_line":"                # Floating IP association is not changed."},{"line_number":1074,"context_line":"                return port_id, internal_ip_address, router_id"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_b363dadb","line":1071,"updated":"2016-06-22 16:17:59.000000000","message":"You shouldn\u0027t need to check both here, if port_id is not None, then you only need to check if it then matched fixed_port_id.\n\nif port_id and port_id \u003d\u003d floatingip_db.fixed_port_id:\n\n\u0027foo\u0027 and \u0027foo\u0027 \u003d\u003d None\n\nActually, if we\u0027re here we know port_id is not None.","commit_id":"7969c5a1a60a98b69f3ba99537f1a3fbdef71724"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"c8e9998abacd8bb083826b56eba9e0b12829c494","unresolved":false,"context_lines":[{"line_number":1068,"context_line":"                context,"},{"line_number":1069,"context_line":"                fip,"},{"line_number":1070,"context_line":"                floating_network_id)"},{"line_number":1071,"context_line":"            if (port_id and floatingip_db.fixed_port_id"},{"line_number":1072,"context_line":"                    and port_id \u003d\u003d floatingip_db.fixed_port_id):"},{"line_number":1073,"context_line":"                # Floating IP association is not changed."},{"line_number":1074,"context_line":"                return port_id, internal_ip_address, router_id"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_d1180987","line":1071,"in_reply_to":"3aaa91ec_b363dadb","updated":"2016-06-23 02:39:38.000000000","message":"Done","commit_id":"7969c5a1a60a98b69f3ba99537f1a3fbdef71724"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"0842971fb5c2fee7c3014ad3065195c21d0b6d41","unresolved":false,"context_lines":[{"line_number":1071,"context_line":"            if (port_id and floatingip_db.fixed_port_id"},{"line_number":1072,"context_line":"                    and port_id \u003d\u003d floatingip_db.fixed_port_id):"},{"line_number":1073,"context_line":"                # Floating IP association is not changed."},{"line_number":1074,"context_line":"                return port_id, internal_ip_address, router_id"},{"line_number":1075,"context_line":"            fip_qry \u003d context.session.query(FloatingIP)"},{"line_number":1076,"context_line":"            try:"},{"line_number":1077,"context_line":"                fip_qry.filter_by("}],"source_content_type":"text/x-python","patch_set":10,"id":"5a9d85d2_d43f9623","line":1074,"updated":"2016-06-20 13:48:55.000000000","message":"Please add new line after ``return``.","commit_id":"7969c5a1a60a98b69f3ba99537f1a3fbdef71724"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"c8e9998abacd8bb083826b56eba9e0b12829c494","unresolved":false,"context_lines":[{"line_number":1071,"context_line":"            if (port_id and floatingip_db.fixed_port_id"},{"line_number":1072,"context_line":"                    and port_id \u003d\u003d floatingip_db.fixed_port_id):"},{"line_number":1073,"context_line":"                # Floating IP association is not changed."},{"line_number":1074,"context_line":"                return port_id, internal_ip_address, router_id"},{"line_number":1075,"context_line":"            fip_qry \u003d context.session.query(FloatingIP)"},{"line_number":1076,"context_line":"            try:"},{"line_number":1077,"context_line":"                fip_qry.filter_by("}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_2cc0167c","line":1074,"in_reply_to":"5a9d85d2_d43f9623","updated":"2016-06-23 02:39:38.000000000","message":"Done","commit_id":"7969c5a1a60a98b69f3ba99537f1a3fbdef71724"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"1f9972e7bdc8ecb2804d5d5644c6267621e9fcc2","unresolved":false,"context_lines":[{"line_number":1087,"context_line":"            except exc.NoResultFound:"},{"line_number":1088,"context_line":"                pass"},{"line_number":1089,"context_line":""},{"line_number":1090,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1091,"context_line":"            # NOTE(liuyulong): updating floating IP extra attributes should"},{"line_number":1092,"context_line":"            # not change its association."},{"line_number":1093,"context_line":"            port_id \u003d floatingip_db.fixed_port_id"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_5e855dab","line":1090,"updated":"2016-06-22 16:17:59.000000000","message":"This would change based on my suggestion on L1061, something like:\n\nelif floatingip_db.fixed_port_id:","commit_id":"7969c5a1a60a98b69f3ba99537f1a3fbdef71724"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"c8e9998abacd8bb083826b56eba9e0b12829c494","unresolved":false,"context_lines":[{"line_number":1087,"context_line":"            except exc.NoResultFound:"},{"line_number":1088,"context_line":"                pass"},{"line_number":1089,"context_line":""},{"line_number":1090,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1091,"context_line":"            # NOTE(liuyulong): updating floating IP extra attributes should"},{"line_number":1092,"context_line":"            # not change its association."},{"line_number":1093,"context_line":"            port_id \u003d floatingip_db.fixed_port_id"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_6c305ee9","line":1090,"in_reply_to":"3aaa91ec_5e855dab","updated":"2016-06-23 02:39:38.000000000","message":"Here can not be what you suggested. When user try to dissociate the floating IP, an explicit None port_id will be required, aka \"-d \u0027{\"floatingip\": {\"port_id\": null}}\u0027\". So if here is \"elif floatingip_db.fixed_port_id\", the floating IP will never can be dissociated.","commit_id":"7969c5a1a60a98b69f3ba99537f1a3fbdef71724"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"0842971fb5c2fee7c3014ad3065195c21d0b6d41","unresolved":false,"context_lines":[{"line_number":1090,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1091,"context_line":"            # NOTE(liuyulong): updating floating IP extra attributes should"},{"line_number":1092,"context_line":"            # not change its association."},{"line_number":1093,"context_line":"            port_id \u003d floatingip_db.fixed_port_id"},{"line_number":1094,"context_line":"            fip[\u0027port_id\u0027] \u003d port_id"},{"line_number":1095,"context_line":"            internal_ip_address, router_id \u003d self._get_fip_internal_data("},{"line_number":1096,"context_line":"                context, fip, floating_network_id)"},{"line_number":1097,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a9d85d2_14e63eb4","line":1094,"range":{"start_line":1093,"start_character":0,"end_line":1094,"end_character":36},"updated":"2016-06-20 13:48:55.000000000","message":"nit: you can assign this in one line.","commit_id":"7969c5a1a60a98b69f3ba99537f1a3fbdef71724"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"c8e9998abacd8bb083826b56eba9e0b12829c494","unresolved":false,"context_lines":[{"line_number":1090,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1091,"context_line":"            # NOTE(liuyulong): updating floating IP extra attributes should"},{"line_number":1092,"context_line":"            # not change its association."},{"line_number":1093,"context_line":"            port_id \u003d floatingip_db.fixed_port_id"},{"line_number":1094,"context_line":"            fip[\u0027port_id\u0027] \u003d port_id"},{"line_number":1095,"context_line":"            internal_ip_address, router_id \u003d self._get_fip_internal_data("},{"line_number":1096,"context_line":"                context, fip, floating_network_id)"},{"line_number":1097,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_2cd93684","line":1094,"range":{"start_line":1093,"start_character":0,"end_line":1094,"end_character":36},"in_reply_to":"5a9d85d2_14e63eb4","updated":"2016-06-23 02:39:38.000000000","message":"Done","commit_id":"7969c5a1a60a98b69f3ba99537f1a3fbdef71724"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"9442f24f56e76915919c61fb18b87c2aaee594f0","unresolved":false,"context_lines":[{"line_number":1047,"context_line":"            internal_subnet_id \u003d ipv4_fixed_ips[0][\u0027subnet_id\u0027]"},{"line_number":1048,"context_line":"        return internal_port, internal_subnet_id, internal_ip_address"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":"    def _get_fip_internal_data(self, context, fip, floating_network_id):"},{"line_number":1051,"context_line":"        \"\"\"Determine/extract data associated with the internal port."},{"line_number":1052,"context_line":""},{"line_number":1053,"context_line":"        When a floating IP is associated with an internal port,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_8e29b0e8","line":1050,"range":{"start_line":1050,"start_character":8,"end_line":1050,"end_character":30},"updated":"2016-06-27 05:03:13.000000000","message":"nit: I think method name changing is not required here. And not changing it might ease the burden of potential cherry pick.","commit_id":"203d3cdafce857f46f7ee77f9cdbc7c062122d12"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d44f870fe59ceec31b764458ca170f1001a0daf2","unresolved":false,"context_lines":[{"line_number":1047,"context_line":"            internal_subnet_id \u003d ipv4_fixed_ips[0][\u0027subnet_id\u0027]"},{"line_number":1048,"context_line":"        return internal_port, internal_subnet_id, internal_ip_address"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":"    def _get_fip_internal_data(self, context, fip, floating_network_id):"},{"line_number":1051,"context_line":"        \"\"\"Determine/extract data associated with the internal port."},{"line_number":1052,"context_line":""},{"line_number":1053,"context_line":"        When a floating IP is associated with an internal port,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_0d7023a3","line":1050,"range":{"start_line":1050,"start_character":8,"end_line":1050,"end_character":30},"in_reply_to":"3aaa91ec_8e29b0e8","updated":"2016-06-27 06:49:47.000000000","message":"Done","commit_id":"203d3cdafce857f46f7ee77f9cdbc7c062122d12"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"9442f24f56e76915919c61fb18b87c2aaee594f0","unresolved":false,"context_lines":[{"line_number":1077,"context_line":"                context,"},{"line_number":1078,"context_line":"                fip,"},{"line_number":1079,"context_line":"                floating_network_id)"},{"line_number":1080,"context_line":"            if (floatingip_db.fixed_port_id"},{"line_number":1081,"context_line":"                    and port_id \u003d\u003d floatingip_db.fixed_port_id):"},{"line_number":1082,"context_line":"                # Floating IP association is not changed."},{"line_number":1083,"context_line":"                return port_id, internal_ip_address, router_id"},{"line_number":1084,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_4e8228c9","line":1081,"range":{"start_line":1080,"start_character":12,"end_line":1081,"end_character":64},"updated":"2016-06-27 05:03:13.000000000","message":"You could just use if port_id \u003d\u003d floatingip_db.fixed_port_id: here because port_id is aleady not none in this clause.","commit_id":"203d3cdafce857f46f7ee77f9cdbc7c062122d12"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d44f870fe59ceec31b764458ca170f1001a0daf2","unresolved":false,"context_lines":[{"line_number":1077,"context_line":"                context,"},{"line_number":1078,"context_line":"                fip,"},{"line_number":1079,"context_line":"                floating_network_id)"},{"line_number":1080,"context_line":"            if (floatingip_db.fixed_port_id"},{"line_number":1081,"context_line":"                    and port_id \u003d\u003d floatingip_db.fixed_port_id):"},{"line_number":1082,"context_line":"                # Floating IP association is not changed."},{"line_number":1083,"context_line":"                return port_id, internal_ip_address, router_id"},{"line_number":1084,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_adbd8f03","line":1081,"range":{"start_line":1080,"start_character":12,"end_line":1081,"end_character":64},"in_reply_to":"3aaa91ec_4e8228c9","updated":"2016-06-27 06:49:47.000000000","message":"Done","commit_id":"203d3cdafce857f46f7ee77f9cdbc7c062122d12"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"9442f24f56e76915919c61fb18b87c2aaee594f0","unresolved":false,"context_lines":[{"line_number":1097,"context_line":"            except exc.NoResultFound:"},{"line_number":1098,"context_line":"                pass"},{"line_number":1099,"context_line":""},{"line_number":1100,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1101,"context_line":"            # NOTE(liuyulong): updating floating IP extra attributes should"},{"line_number":1102,"context_line":"            # not change its association."},{"line_number":1103,"context_line":"            fip[\u0027port_id\u0027] \u003d port_id \u003d floatingip_db.fixed_port_id"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_ae290c9d","line":1100,"range":{"start_line":1100,"start_character":8,"end_line":1100,"end_character":35},"updated":"2016-06-27 05:03:13.000000000","message":"maybe you can use elif floatingip_db.fixed_port_id: to avoid unnecessary check here.","commit_id":"203d3cdafce857f46f7ee77f9cdbc7c062122d12"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d44f870fe59ceec31b764458ca170f1001a0daf2","unresolved":false,"context_lines":[{"line_number":1097,"context_line":"            except exc.NoResultFound:"},{"line_number":1098,"context_line":"                pass"},{"line_number":1099,"context_line":""},{"line_number":1100,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1101,"context_line":"            # NOTE(liuyulong): updating floating IP extra attributes should"},{"line_number":1102,"context_line":"            # not change its association."},{"line_number":1103,"context_line":"            fip[\u0027port_id\u0027] \u003d port_id \u003d floatingip_db.fixed_port_id"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_edeb1711","line":1100,"range":{"start_line":1100,"start_character":8,"end_line":1100,"end_character":35},"in_reply_to":"3aaa91ec_ae290c9d","updated":"2016-06-27 06:49:47.000000000","message":"We can\u0027t, because you will never be able to dissociate the floating IP.\nPlease see my comment to @Brian Haley in PS 10:\nhttps://review.openstack.org/#/c/312849/10/neutron/db/l3_db.py","commit_id":"203d3cdafce857f46f7ee77f9cdbc7c062122d12"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"64ecdd6bebb3a7610aace3efb98d1661c6496ea2","unresolved":false,"context_lines":[{"line_number":1097,"context_line":"            except exc.NoResultFound:"},{"line_number":1098,"context_line":"                pass"},{"line_number":1099,"context_line":""},{"line_number":1100,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1101,"context_line":"            # NOTE(liuyulong): updating floating IP extra attributes should"},{"line_number":1102,"context_line":"            # not change its association."},{"line_number":1103,"context_line":"            fip[\u0027port_id\u0027] \u003d port_id \u003d floatingip_db.fixed_port_id"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_6d7a87be","line":1100,"range":{"start_line":1100,"start_character":8,"end_line":1100,"end_character":35},"in_reply_to":"3aaa91ec_edeb1711","updated":"2016-06-27 07:07:16.000000000","message":"Thanks for clarifying.","commit_id":"203d3cdafce857f46f7ee77f9cdbc7c062122d12"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"9442f24f56e76915919c61fb18b87c2aaee594f0","unresolved":false,"context_lines":[{"line_number":1098,"context_line":"                pass"},{"line_number":1099,"context_line":""},{"line_number":1100,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1101,"context_line":"            # NOTE(liuyulong): updating floating IP extra attributes should"},{"line_number":1102,"context_line":"            # not change its association."},{"line_number":1103,"context_line":"            fip[\u0027port_id\u0027] \u003d port_id \u003d floatingip_db.fixed_port_id"},{"line_number":1104,"context_line":"            internal_ip_address, router_id \u003d self._get_fip_internal_data("}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_eef31471","line":1101,"range":{"start_line":1101,"start_character":14,"end_line":1101,"end_character":29},"updated":"2016-06-27 05:03:13.000000000","message":"nit: I think a normal comment should be sufficient here. This is not a complicating scenario that needs a note.","commit_id":"203d3cdafce857f46f7ee77f9cdbc7c062122d12"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d44f870fe59ceec31b764458ca170f1001a0daf2","unresolved":false,"context_lines":[{"line_number":1098,"context_line":"                pass"},{"line_number":1099,"context_line":""},{"line_number":1100,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1101,"context_line":"            # NOTE(liuyulong): updating floating IP extra attributes should"},{"line_number":1102,"context_line":"            # not change its association."},{"line_number":1103,"context_line":"            fip[\u0027port_id\u0027] \u003d port_id \u003d floatingip_db.fixed_port_id"},{"line_number":1104,"context_line":"            internal_ip_address, router_id \u003d self._get_fip_internal_data("}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_cd529b12","line":1101,"range":{"start_line":1101,"start_character":14,"end_line":1101,"end_character":29},"in_reply_to":"3aaa91ec_eef31471","updated":"2016-06-27 06:49:47.000000000","message":"Done","commit_id":"203d3cdafce857f46f7ee77f9cdbc7c062122d12"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"109028b8b3d5e366fe16b22251af3ff18dfb9f85","unresolved":false,"context_lines":[{"line_number":1105,"context_line":"                pass"},{"line_number":1106,"context_line":""},{"line_number":1107,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1108,"context_line":"            fip[\u0027port_id\u0027] \u003d port_id \u003d floatingip_db.fixed_port_id"},{"line_number":1109,"context_line":"            internal_ip_address, router_id \u003d self._get_assoc_data("},{"line_number":1110,"context_line":"                context, fip, floating_network_id)"},{"line_number":1111,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"bacf61ea_71c63569","line":1108,"range":{"start_line":1108,"start_character":12,"end_line":1108,"end_character":26},"updated":"2016-08-04 19:57:44.000000000","message":"Is this assignment required?","commit_id":"5292fd6dbec685796cbcead43318dfa38713d461"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"a824ad465ff96715eb9ee55344dd929487079bbf","unresolved":false,"context_lines":[{"line_number":1105,"context_line":"                pass"},{"line_number":1106,"context_line":""},{"line_number":1107,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1108,"context_line":"            fip[\u0027port_id\u0027] \u003d port_id \u003d floatingip_db.fixed_port_id"},{"line_number":1109,"context_line":"            internal_ip_address, router_id \u003d self._get_assoc_data("},{"line_number":1110,"context_line":"                context, fip, floating_network_id)"},{"line_number":1111,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"bacf61ea_7d439faf","line":1108,"range":{"start_line":1108,"start_character":12,"end_line":1108,"end_character":26},"in_reply_to":"bacf61ea_71c63569","updated":"2016-08-05 02:20:16.000000000","message":"This _internal_fip_assoc_data call in _get_assoc_data will use the fip[\u0027port_id\u0027].","commit_id":"5292fd6dbec685796cbcead43318dfa38713d461"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"f06cdf82e4de639b0350a9a92975a369550da30f","unresolved":false,"context_lines":[{"line_number":1106,"context_line":""},{"line_number":1107,"context_line":"        return internal_ip_address, router_id"},{"line_number":1108,"context_line":""},{"line_number":1109,"context_line":"    def _check_and_get_fip_assoc(self, context, fip, floatingip_db):"},{"line_number":1110,"context_line":"        port_id \u003d fip.get(\u0027port_id\u0027)"},{"line_number":1111,"context_line":"        internal_ip_address \u003d router_id \u003d None"},{"line_number":1112,"context_line":"        floating_network_id \u003d floatingip_db[\u0027floating_network_id\u0027]"}],"source_content_type":"text/x-python","patch_set":17,"id":"9ad45d7e_1a03ae0e","line":1109,"updated":"2016-08-10 08:32:40.000000000","message":"It\u0027s difficult for me to tell which patch is fixing what. In order to fix the idempotency issue (allow post with same port_id), allow updating attrs, and maintain backward compat of clearing on empty dict (and port_id\u003dNone), the code should look like the following:\n\nport_id \u003d internal_ip_address \u003d router_id \u003d None\nif fip.get(\u0027fixed_ip_address\u0027) and not fip.get(\u0027port_id\u0027):\n    msg \u003d _(\"fixed_ip_address cannot be specified without a port_id\")\n    raise n_exc.BadRequest(resource\u003d\u0027floatingip\u0027, msg\u003dmsg)\nif \u0027port_id\u0027 in fip:\n    # user has specified a value, honor it\n    port_id \u003d fip[\u0027port_id\u0027]\nelif fip and floatingip_db.fixed_port_id:\n    # other keys are present and it is already associated,\n    # they are updating something so lookup the id.\n    port_id \u003d floatingip_db.fixed_port_id\n\nif port_id:\n    port_id, internal_ip_address, router_id \u003d self._get_assoc_data(\n            context, fip, floatingip_db[\u0027floating_network_id\u0027])\n    fip_qry \u003d context.session.query(FloatingIP).filter(\n        FloatingIP.id !\u003d floatingip_db.id)\n    try:\n        fip_qry.filter_by(\n            fixed_port_id\u003dfip[\u0027port_id\u0027],\n            floating_network_id\u003dfloatingip_db[\u0027floating_network_id\u0027],\n            fixed_ip_address\u003dinternal_ip_address).one()\n        raise l3.FloatingIPPortAlreadyAssociated(\n             port_id\u003dfip[\u0027port_id\u0027],\n             fip_id\u003dfloatingip_db[\u0027id\u0027],\n             floating_ip_address\u003dfloatingip_db[\u0027floating_ip_address\u0027],\n             fixed_ip\u003dinternal_ip_address,\n             net_id\u003dfloatingip_db[\u0027floating_network_id\u0027])\n    except exc.NoResultFound:\n        pass\n\nreturn port_id, internal_ip_address, router_id","commit_id":"03f4d0a9ae88006f6df554e7c870924808c02109"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"67aaa83deaf423f285780ee6a20c74ec530cff60","unresolved":false,"context_lines":[{"line_number":1106,"context_line":""},{"line_number":1107,"context_line":"        return internal_ip_address, router_id"},{"line_number":1108,"context_line":""},{"line_number":1109,"context_line":"    def _check_and_get_fip_assoc(self, context, fip, floatingip_db):"},{"line_number":1110,"context_line":"        port_id \u003d fip.get(\u0027port_id\u0027)"},{"line_number":1111,"context_line":"        internal_ip_address \u003d router_id \u003d None"},{"line_number":1112,"context_line":"        floating_network_id \u003d floatingip_db[\u0027floating_network_id\u0027]"}],"source_content_type":"text/x-python","patch_set":17,"id":"9ad45d7e_faa05aa1","line":1109,"in_reply_to":"9ad45d7e_1a03ae0e","updated":"2016-08-10 08:39:39.000000000","message":"ok, after re-reading this and the dependent patch the logic ultimately is the same.","commit_id":"03f4d0a9ae88006f6df554e7c870924808c02109"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"67aaa83deaf423f285780ee6a20c74ec530cff60","unresolved":false,"context_lines":[{"line_number":1135,"context_line":"            except exc.NoResultFound:"},{"line_number":1136,"context_line":"                pass"},{"line_number":1137,"context_line":""},{"line_number":1138,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1139,"context_line":"            fip[\u0027port_id\u0027] \u003d port_id \u003d floatingip_db.fixed_port_id"},{"line_number":1140,"context_line":"            internal_ip_address, router_id \u003d self._get_assoc_data("},{"line_number":1141,"context_line":"                context, fip, floating_network_id)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9ad45d7e_5a9d2658","line":1138,"updated":"2016-08-10 08:39:39.000000000","message":"please add a comment here that this is to preserve backwards compatibility of disassociating on an empty body with a reference to bug/1610045","commit_id":"03f4d0a9ae88006f6df554e7c870924808c02109"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"202ab824c1cfdd097a9bec2e3f76e93d109037ce","unresolved":false,"context_lines":[{"line_number":1135,"context_line":"            except exc.NoResultFound:"},{"line_number":1136,"context_line":"                pass"},{"line_number":1137,"context_line":""},{"line_number":1138,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1139,"context_line":"            fip[\u0027port_id\u0027] \u003d port_id \u003d floatingip_db.fixed_port_id"},{"line_number":1140,"context_line":"            internal_ip_address, router_id \u003d self._get_assoc_data("},{"line_number":1141,"context_line":"                context, fip, floating_network_id)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9ad45d7e_5a12410a","line":1138,"in_reply_to":"9ad45d7e_5a9d2658","updated":"2016-08-10 09:59:08.000000000","message":"Done","commit_id":"03f4d0a9ae88006f6df554e7c870924808c02109"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"64499347b8fac6d0a9be872001b304a71b4b0e95","unresolved":false,"context_lines":[{"line_number":1130,"context_line":"        internal_ip_address \u003d router_id \u003d None"},{"line_number":1131,"context_line":"        floating_network_id \u003d floatingip_db[\u0027floating_network_id\u0027]"},{"line_number":1132,"context_line":""},{"line_number":1133,"context_line":"        if fip.get(\u0027fixed_ip_address\u0027) and not fip.get(\u0027port_id\u0027):"},{"line_number":1134,"context_line":"            msg \u003d _(\"fixed_ip_address cannot be specified without a port_id\")"},{"line_number":1135,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027floatingip\u0027, msg\u003dmsg)"},{"line_number":1136,"context_line":"        if port_id:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9ad45d7e_f2aea77f","line":1133,"updated":"2016-08-10 16:19:31.000000000","message":"s/fip.get(\u0027port_id\u0027)/port_id from L1129","commit_id":"553304dc83525ce433aeb19d83917a7da2e10fbe"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"18984bf9318b8eb263ad170fd5ce3ce074e0f74f","unresolved":false,"context_lines":[{"line_number":1130,"context_line":"        internal_ip_address \u003d router_id \u003d None"},{"line_number":1131,"context_line":"        floating_network_id \u003d floatingip_db[\u0027floating_network_id\u0027]"},{"line_number":1132,"context_line":""},{"line_number":1133,"context_line":"        if fip.get(\u0027fixed_ip_address\u0027) and not fip.get(\u0027port_id\u0027):"},{"line_number":1134,"context_line":"            msg \u003d _(\"fixed_ip_address cannot be specified without a port_id\")"},{"line_number":1135,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027floatingip\u0027, msg\u003dmsg)"},{"line_number":1136,"context_line":"        if port_id:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9ad45d7e_48dc1773","line":1133,"in_reply_to":"9ad45d7e_f2aea77f","updated":"2016-08-10 22:05:30.000000000","message":"Done","commit_id":"553304dc83525ce433aeb19d83917a7da2e10fbe"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"64499347b8fac6d0a9be872001b304a71b4b0e95","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"            except exc.NoResultFound:"},{"line_number":1154,"context_line":"                pass"},{"line_number":1155,"context_line":""},{"line_number":1156,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1157,"context_line":"            # NOTE(liuyulong): without the fix of bug #1610045 here could"},{"line_number":1158,"context_line":"            # also prevent from dissociating the floating IP from the port"},{"line_number":1159,"context_line":"            # with an empty updating dict data."}],"source_content_type":"text/x-python","patch_set":18,"id":"9ad45d7e_72f11795","line":1156,"updated":"2016-08-10 16:19:31.000000000","message":"This should be up above, right?  That way you have a port_id and can fall-into L1136 if:","commit_id":"553304dc83525ce433aeb19d83917a7da2e10fbe"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"18984bf9318b8eb263ad170fd5ce3ce074e0f74f","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"            except exc.NoResultFound:"},{"line_number":1154,"context_line":"                pass"},{"line_number":1155,"context_line":""},{"line_number":1156,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1157,"context_line":"            # NOTE(liuyulong): without the fix of bug #1610045 here could"},{"line_number":1158,"context_line":"            # also prevent from dissociating the floating IP from the port"},{"line_number":1159,"context_line":"            # with an empty updating dict data."}],"source_content_type":"text/x-python","patch_set":18,"id":"9ad45d7e_08e05ff9","line":1156,"in_reply_to":"9ad45d7e_72f11795","updated":"2016-08-10 22:05:30.000000000","message":"This Line also can be used to dissociate the floating IP with updating dict: {\u0027port_id\u0027: null}. And then you can see, `fip.get(\u0027port_id\u0027)` is None, will not get into Line 1136, but \u0027port_id\u0027 is in the updating dict, then the Line 1164 will return `None, address, None`, then floating IP get dissociated.\n\n\nAnd in patch set 10 I\u0027ve explained this to you: https://review.openstack.org/#/c/312849/10/neutron/db/l3_db.py","commit_id":"553304dc83525ce433aeb19d83917a7da2e10fbe"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"9f783c1b2a3286ef75c29ab909a481f70cfab9c3","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"            except exc.NoResultFound:"},{"line_number":1154,"context_line":"                pass"},{"line_number":1155,"context_line":""},{"line_number":1156,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1157,"context_line":"            # NOTE(liuyulong): without the fix of bug #1610045 here could"},{"line_number":1158,"context_line":"            # also prevent from dissociating the floating IP from the port"},{"line_number":1159,"context_line":"            # with an empty updating dict data."}],"source_content_type":"text/x-python","patch_set":19,"id":"9ad45d7e_615db114","line":1156,"updated":"2016-08-11 02:02:10.000000000","message":"sorry, this isn\u0027t backwards compatible because it will not clear the port ID if they submit an empty dictionary. You need one more part to the conditional\n\nif fip and \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:","commit_id":"4b95de685d7d4097da6c4a9d6a66d3a5bbc366c0"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"404b73e72c30cfc73b930eed5017ba94519e692b","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"            except exc.NoResultFound:"},{"line_number":1154,"context_line":"                pass"},{"line_number":1155,"context_line":""},{"line_number":1156,"context_line":"        if \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1157,"context_line":"            # NOTE(liuyulong): without the fix of bug #1610045 here could"},{"line_number":1158,"context_line":"            # also prevent from dissociating the floating IP from the port"},{"line_number":1159,"context_line":"            # with an empty updating dict data."}],"source_content_type":"text/x-python","patch_set":19,"id":"9ad45d7e_e15c017f","line":1156,"in_reply_to":"9ad45d7e_615db114","updated":"2016-08-11 02:21:58.000000000","message":"Done","commit_id":"4b95de685d7d4097da6c4a9d6a66d3a5bbc366c0"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"445d26d26b8dddec16d656a7caaca02fdffc3ca7","unresolved":false,"context_lines":[{"line_number":1128,"context_line":"    def _check_and_get_fip_assoc(self, context, fip, floatingip_db):"},{"line_number":1129,"context_line":"        port_id \u003d fip.get(\u0027port_id\u0027)"},{"line_number":1130,"context_line":"        internal_ip_address \u003d router_id \u003d None"},{"line_number":1131,"context_line":"        floating_network_id \u003d floatingip_db[\u0027floating_network_id\u0027]"},{"line_number":1132,"context_line":""},{"line_number":1133,"context_line":"        if fip.get(\u0027fixed_ip_address\u0027) and not port_id:"},{"line_number":1134,"context_line":"            msg \u003d _(\"fixed_ip_address cannot be specified without a port_id\")"}],"source_content_type":"text/x-python","patch_set":20,"id":"9ad45d7e_3bb613f9","line":1131,"updated":"2016-08-11 18:35:24.000000000","message":"Please don\u0027t include gratuitous refactoring. It makes the patch harder to review and sometimes causes other issues.","commit_id":"5adb316037b9c6c27078f9d0f08e3e14aa737572"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"9655b75aedc20fa278907bb81b8aa659e265ad7b","unresolved":false,"context_lines":[{"line_number":1128,"context_line":"    def _check_and_get_fip_assoc(self, context, fip, floatingip_db):"},{"line_number":1129,"context_line":"        port_id \u003d fip.get(\u0027port_id\u0027)"},{"line_number":1130,"context_line":"        internal_ip_address \u003d router_id \u003d None"},{"line_number":1131,"context_line":"        floating_network_id \u003d floatingip_db[\u0027floating_network_id\u0027]"},{"line_number":1132,"context_line":""},{"line_number":1133,"context_line":"        if fip.get(\u0027fixed_ip_address\u0027) and not port_id:"},{"line_number":1134,"context_line":"            msg \u003d _(\"fixed_ip_address cannot be specified without a port_id\")"}],"source_content_type":"text/x-python","patch_set":20,"id":"9ad45d7e_9066f6ea","line":1131,"in_reply_to":"9ad45d7e_3bb613f9","updated":"2016-08-11 21:01:30.000000000","message":"Line 1162 used this, and there are 4 times duplicated.","commit_id":"5adb316037b9c6c27078f9d0f08e3e14aa737572"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"965cc130f1447fecf03ad563bce77e16b3324f81","unresolved":false,"context_lines":[{"line_number":1128,"context_line":"    def _check_and_get_fip_assoc(self, context, fip, floatingip_db):"},{"line_number":1129,"context_line":"        port_id \u003d fip.get(\u0027port_id\u0027)"},{"line_number":1130,"context_line":"        internal_ip_address \u003d router_id \u003d None"},{"line_number":1131,"context_line":"        floating_network_id \u003d floatingip_db[\u0027floating_network_id\u0027]"},{"line_number":1132,"context_line":""},{"line_number":1133,"context_line":"        if fip.get(\u0027fixed_ip_address\u0027) and not port_id:"},{"line_number":1134,"context_line":"            msg \u003d _(\"fixed_ip_address cannot be specified without a port_id\")"}],"source_content_type":"text/x-python","patch_set":20,"id":"9ad45d7e_6949d830","line":1131,"in_reply_to":"9ad45d7e_9066f6ea","updated":"2016-08-11 23:47:27.000000000","message":"My point is that it is not necessary for this fix and therefore should be left out of it. Compare the diff how it is now with how it would be if you didn\u0027t replace the 4 existing occurrences and you just dropped in floatingip_db[\u0027floating_network_id\u0027]. You\u0027ll see that it is actually quite a lot easier for a reviewer to understand at a glance. I\u0027m just trying to encourage people to be more aware of the time that reviewers spend on changes. Each code change has to be read and understood by at least two core reviewers and usually a number of other reviewers. Each little unnecessary side change is distracting and can make it more difficult for reviewers to maintain focus.\n\nIt is my opinion that if you were to split this in to two changes, one to fix the bug and then another to refactor this to add a local variable, the two patches would be easier to review collectively than the combination of the two in one patch. We can also consider the value of the refactoring independently from the other part of the fix. To be honest, I\u0027m not sure that it is that compelling, especially for this late in the cycle. It doesn\u0027t provide any kind of performance advantage, it adds a line of code, and it only reduces the existing line lengths a tiny bit. Changes that do refactoring are, in my opinion, more suitable for the beginning of a release cycle.","commit_id":"5adb316037b9c6c27078f9d0f08e3e14aa737572"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"f3f02e05d8a20ba8c3b5f9c60e35229fa9b7a337","unresolved":false,"context_lines":[{"line_number":1144,"context_line":"            # NOTE(liuyulong): without the fix of bug #1610045 here could"},{"line_number":1145,"context_line":"            # also let floating IP can be dissociated with an empty"},{"line_number":1146,"context_line":"            # updating dict."},{"line_number":1147,"context_line":"            fip[\u0027port_id\u0027] \u003d port_id \u003d floatingip_db.fixed_port_id"},{"line_number":1148,"context_line":"            _, internal_ip_address, router_id \u003d self._get_assoc_data("},{"line_number":1149,"context_line":"                context, fip, floatingip_db[\u0027floating_network_id\u0027])"},{"line_number":1150,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"3ac371cc_87416b3c","line":1147,"updated":"2016-08-15 11:12:51.000000000","message":"fip[\u0027port_id\u0027] \u003d floatingip_db.fixed_port_id\nport_id, internal_ip_address, router_id \u003d self._get_assoc_data(...","commit_id":"274a580a3405ee8126aa771e05845da8faa118ca"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"4bfe6340bfe8f266fa9c24d9e18ce6f8afbc40fe","unresolved":false,"context_lines":[{"line_number":1145,"context_line":"            # also let floating IP can be dissociated with an empty"},{"line_number":1146,"context_line":"            # updating dict."},{"line_number":1147,"context_line":"            fip[\u0027port_id\u0027] \u003d port_id \u003d floatingip_db.fixed_port_id"},{"line_number":1148,"context_line":"            _, internal_ip_address, router_id \u003d self._get_assoc_data("},{"line_number":1149,"context_line":"                context, fip, floatingip_db[\u0027floating_network_id\u0027])"},{"line_number":1150,"context_line":""},{"line_number":1151,"context_line":"        # After all upper conditions, if updating API dict is submitted with"}],"source_content_type":"text/x-python","patch_set":23,"id":"3ac371cc_ccaa6a19","line":1148,"updated":"2016-08-15 11:08:28.000000000","message":"nit: you could just assign port_id right here instead of on L1147 to get rid of the \u0027_\u0027","commit_id":"274a580a3405ee8126aa771e05845da8faa118ca"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"6afe8cd0fa707d622f8ee04810421c196e623897","unresolved":false,"context_lines":[{"line_number":1139,"context_line":"                    net_id\u003dfloatingip_db[\u0027floating_network_id\u0027])"},{"line_number":1140,"context_line":"            except exc.NoResultFound:"},{"line_number":1141,"context_line":"                pass"},{"line_number":1142,"context_line":""},{"line_number":1143,"context_line":"        if fip and \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1144,"context_line":"            # NOTE(liuyulong): without the fix of bug #1610045 here could"},{"line_number":1145,"context_line":"            # also let floating IP can be dissociated with an empty"}],"source_content_type":"text/x-python","patch_set":24,"id":"3ac371cc_6b49998b","line":1142,"updated":"2016-08-15 12:50:08.000000000","message":"would this not be the else from line 1123? Can fip be None?","commit_id":"999c9b44c085d39e2b3c8f812993ceb8d1c12c4e"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"a3e6effcb378ef2a5ef33490e92699733baf32e2","unresolved":false,"context_lines":[{"line_number":1139,"context_line":"                    net_id\u003dfloatingip_db[\u0027floating_network_id\u0027])"},{"line_number":1140,"context_line":"            except exc.NoResultFound:"},{"line_number":1141,"context_line":"                pass"},{"line_number":1142,"context_line":""},{"line_number":1143,"context_line":"        if fip and \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1144,"context_line":"            # NOTE(liuyulong): without the fix of bug #1610045 here could"},{"line_number":1145,"context_line":"            # also let floating IP can be dissociated with an empty"}],"source_content_type":"text/x-python","patch_set":24,"id":"3ac371cc_0e82b394","line":1142,"in_reply_to":"3ac371cc_6b49998b","updated":"2016-08-15 13:25:10.000000000","message":"Yes, it can be a empty dict.  Some related bug #1610045.\n\nAnd someting about the extra attrs updating, please see the comments of Line 1144-1146 and Line 1151-1152. And this patch aim to fix the floating IP extra attributes updating issue.","commit_id":"999c9b44c085d39e2b3c8f812993ceb8d1c12c4e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"6afe8cd0fa707d622f8ee04810421c196e623897","unresolved":false,"context_lines":[{"line_number":1140,"context_line":"            except exc.NoResultFound:"},{"line_number":1141,"context_line":"                pass"},{"line_number":1142,"context_line":""},{"line_number":1143,"context_line":"        if fip and \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1144,"context_line":"            # NOTE(liuyulong): without the fix of bug #1610045 here could"},{"line_number":1145,"context_line":"            # also let floating IP can be dissociated with an empty"},{"line_number":1146,"context_line":"            # updating dict."}],"source_content_type":"text/x-python","patch_set":24,"id":"3ac371cc_6bbb5973","line":1143,"updated":"2016-08-15 12:50:08.000000000","message":"can we please add a unit test to check this?","commit_id":"999c9b44c085d39e2b3c8f812993ceb8d1c12c4e"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"a3e6effcb378ef2a5ef33490e92699733baf32e2","unresolved":false,"context_lines":[{"line_number":1140,"context_line":"            except exc.NoResultFound:"},{"line_number":1141,"context_line":"                pass"},{"line_number":1142,"context_line":""},{"line_number":1143,"context_line":"        if fip and \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1144,"context_line":"            # NOTE(liuyulong): without the fix of bug #1610045 here could"},{"line_number":1145,"context_line":"            # also let floating IP can be dissociated with an empty"},{"line_number":1146,"context_line":"            # updating dict."}],"source_content_type":"text/x-python","patch_set":24,"id":"3ac371cc_ce253bc3","line":1143,"in_reply_to":"3ac371cc_6bbb5973","updated":"2016-08-15 13:25:10.000000000","message":"Unit tests has no \u0027standard-attr-description\u0027 extension now.\nIs the current test not enough?","commit_id":"999c9b44c085d39e2b3c8f812993ceb8d1c12c4e"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"842e4c343499f5c1cc5e8cf23a155df5884b6790","unresolved":false,"context_lines":[{"line_number":1129,"context_line":"            except exc.NoResultFound:"},{"line_number":1130,"context_line":"                pass"},{"line_number":1131,"context_line":""},{"line_number":1132,"context_line":"        if fip and \u0027port_id\u0027 not in fip and floatingip_db.fixed_port_id:"},{"line_number":1133,"context_line":"            # NOTE(liuyulong): without the fix of bug #1610045 here could"},{"line_number":1134,"context_line":"            # also let floating IP can be dissociated with an empty"},{"line_number":1135,"context_line":"            # updating dict."}],"source_content_type":"text/x-python","patch_set":25,"id":"3ac371cc_4aa8ac8d","line":1132,"range":{"start_line":1132,"start_character":11,"end_line":1132,"end_character":14},"updated":"2016-08-17 07:21:58.000000000","message":"This `fip` dict here may stay in following state:\nfip \u003d {\u0027floating_network_id\u0027} # create\n\nfip \u003d {\u0027id\u0027: id, \u0027tenant_id\u0027: t_id}  # update  (disassociate, or change nothing when fip is not associated)\nfip \u003d {\u0027id\u0027: id, \u0027tenant_id\u0027: t_id, \u0027port_id\u0027: null} #update (disassociate)\nfip \u003d {\u0027id\u0027: id, \u0027tenant_id\u0027: t_id, \u0027port_id\u0027: port_id} #update (associate) \nfip \u003d {\u0027id\u0027: id, \u0027tenant_id\u0027: t_id, \u0027port_id\u0027: new_port_id} #update (re-associate) \nfip \u003d {\u0027id\u0027: id, \u0027tenant_id\u0027: t_id, \u0027description\u0027: desp} #update extra\n\nBoth create and update floating IP API can go in this function.\nSo, some alternative change may be, reset this `fip` to the following function:\n\n    def _should_remain_fip_association(self, fip):\n        api_fip \u003d copy.deepcopy(fip)\n        for key in [\u0027id\u0027, \u0027tenant_id\u0027, \u0027floating_network_id\u0027]:\n            api_fip.pop(key, None)\n        if not api_fip:\n            return False\n        return True","commit_id":"9d3dfebd3400e9ef7e04c7634f721f0d18487b3c"}],"neutron/tests/tempest/api/test_floating_ips.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"43d6d4fc1b8ca08f3dda4153612e6bf777ddc714","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        self.assertEqual(\u0027d2\u0027, body[\u0027floatingip\u0027][\u0027description\u0027])"},{"line_number":72,"context_line":"        body \u003d self.client.show_floatingip(body[\u0027floatingip\u0027][\u0027id\u0027])"},{"line_number":73,"context_line":"        self.assertEqual(\u0027d2\u0027, body[\u0027floatingip\u0027][\u0027description\u0027])"},{"line_number":74,"context_line":"        # disassociate"},{"line_number":75,"context_line":"        body \u003d self.client.update_floatingip(body[\u0027floatingip\u0027][\u0027id\u0027],"},{"line_number":76,"context_line":"                                             port_id\u003dNone)"},{"line_number":77,"context_line":"        self.assertEqual(None, body[\u0027floatingip\u0027][\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a8ec9b2_21ddd242","line":74,"updated":"2016-09-14 05:02:11.000000000","message":"why is this added to this test? It doesn\u0027t have anything to do with descriptions.","commit_id":"8e24e8dd995fe9a453807449e5fd331eb23552f1"}]}
