)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"053f39d349a8eea58f21d9798bc5911758c647fc","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Remove gateway interface ip from used ips"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"\u0027used_ips\u0027 field of \u0027net-ip-availability-list\u0027 command increased by 1 when subnet added into router,In fact, Before subnet added into the router ,\u0027total_ips\u0027 of network does not contain \u0027gateway_ip\u0027."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: Iea7445c226a15c3e5a8ce1f22cd6d88bd1e1eac6"},{"line_number":12,"context_line":"Closes-Bug: #1585907"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9abb7d3a_e95bc652","line":9,"updated":"2016-05-29 05:15:42.000000000","message":"Try to follow this guide to organize your commit message","commit_id":"9598702b4c04e6ce48d38311e50fb6b7235c9f02"},{"author":{"_account_id":20146,"name":"yuyafei","email":"yu.yafei@foxmail.com","username":"yuyafei"},"change_message_id":"a11417dcc93b8caebd5d3a0cfb0f5cfad12174c1","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Remove gateway interface ip from used ips"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"\u0027used_ips\u0027 field of \u0027net-ip-availability-list\u0027 command increased by 1 when subnet added into router,In fact, Before subnet added into the router ,\u0027total_ips\u0027 of network does not contain \u0027gateway_ip\u0027."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: Iea7445c226a15c3e5a8ce1f22cd6d88bd1e1eac6"},{"line_number":12,"context_line":"Closes-Bug: #1585907"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9abb7d3a_90c4d25f","line":9,"in_reply_to":"9abb7d3a_d02f7a3c","updated":"2016-05-30 02:07:54.000000000","message":"lines should be wrapped at 72 characters.","commit_id":"9598702b4c04e6ce48d38311e50fb6b7235c9f02"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"13a8cd35eab41bf5d377fba72bc640257aa87532","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Remove gateway interface ip from used ips"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"\u0027used_ips\u0027 field of \u0027net-ip-availability-list\u0027 command increased by 1 when subnet added into router,In fact, Before subnet added into the router ,\u0027total_ips\u0027 of network does not contain \u0027gateway_ip\u0027."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: Iea7445c226a15c3e5a8ce1f22cd6d88bd1e1eac6"},{"line_number":12,"context_line":"Closes-Bug: #1585907"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9abb7d3a_fa02623d","line":9,"in_reply_to":"9abb7d3a_e95bc652","updated":"2016-05-29 12:20:21.000000000","message":"link for hints - https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines","commit_id":"9598702b4c04e6ce48d38311e50fb6b7235c9f02"},{"author":{"_account_id":20000,"name":"Songming Yan","email":"yan.songming@zte.com.cn","username":"SonmingYan.zte"},"change_message_id":"542348758b83de0b3815144adaa3654d50ecf658","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Remove gateway interface ip from used ips"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"\u0027used_ips\u0027 field of \u0027net-ip-availability-list\u0027 command increased by 1 when subnet added into router,In fact, Before subnet added into the router ,\u0027total_ips\u0027 of network does not contain \u0027gateway_ip\u0027."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: Iea7445c226a15c3e5a8ce1f22cd6d88bd1e1eac6"},{"line_number":12,"context_line":"Closes-Bug: #1585907"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9abb7d3a_d02f7a3c","line":9,"in_reply_to":"9abb7d3a_fa02623d","updated":"2016-05-30 02:05:43.000000000","message":"This is too long","commit_id":"9598702b4c04e6ce48d38311e50fb6b7235c9f02"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"effbfa1c1ce44b9b8619b63b2757ec3b0e9b6817","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Remove used ip which not in subnet pool from network used ip statistics"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"\u0027used_ips\u0027 field of \u0027net-ip-availability-list\u0027 command increased by 1 when"},{"line_number":10,"context_line":"subnet added into router,In fact, Before subnet added into the router,"},{"line_number":11,"context_line":"\u0027total_ips\u0027 of network does not contain \u0027gateway_ip\u0027.so we will remove ip"},{"line_number":12,"context_line":"which not in subnet pool"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"1aa78d24_f14c57ca","line":9,"range":{"start_line":9,"start_character":68,"end_line":9,"end_character":74},"updated":"2016-07-14 12:30:29.000000000","message":"Please limit the length of Commit Body to 79 characters.\n\"when\" can be brought to the next line","commit_id":"8d10f23aa7285898b29d51e1b1ccbd6031670139"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"effbfa1c1ce44b9b8619b63b2757ec3b0e9b6817","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Remove used ip which not in subnet pool from network used ip statistics"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"\u0027used_ips\u0027 field of \u0027net-ip-availability-list\u0027 command increased by 1 when"},{"line_number":10,"context_line":"subnet added into router,In fact, Before subnet added into the router,"},{"line_number":11,"context_line":"\u0027total_ips\u0027 of network does not contain \u0027gateway_ip\u0027.so we will remove ip"},{"line_number":12,"context_line":"which not in subnet pool"},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"1aa78d24_710a277b","line":10,"range":{"start_line":10,"start_character":24,"end_line":10,"end_character":40},"updated":"2016-07-14 12:30:29.000000000","message":"nit: , infact, before subnet is added into the router","commit_id":"8d10f23aa7285898b29d51e1b1ccbd6031670139"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"a87de3f99505ae8956783f28ff9761405fb886ee","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     QunyingRan \u003cran.qunying@zte.com.cn\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-12-12 10:49:28 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Remove used ip which not in subnet pool from network used ip"},{"line_number":8,"context_line":"statistics"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"\u0027used_ips\u0027 field of \u0027net-ip-availability-list\u0027 command increased"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":47,"id":"3a71b18c_0ee311da","line":7,"updated":"2016-12-12 12:54:51.000000000","message":"please see https://wiki.openstack.org/wiki/GitCommitMessages","commit_id":"dea5f48072bae3a72e63e9699f14fab381882fb5"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"bed57865cee828751319a34d0ebc6088520ed750","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     QunyingRan \u003cran.qunying@zte.com.cn\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-12-13 15:38:39 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Remove used ip which not in subnet pools from responses in command"},{"line_number":8,"context_line":"\u0027net-ip-availability-list\u0027 or \u0027net-ip-availability-show\u0027"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"\u0027used_ips\u0027 field of \u0027net-ip-availability-list\u0027 command increased"},{"line_number":11,"context_line":"by 1 when subnet added into router,In fact, Before subnet added"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":49,"id":"1a6eadb0_4ca11fa9","line":8,"range":{"start_line":7,"start_character":0,"end_line":8,"end_character":56},"updated":"2016-12-13 09:45:06.000000000","message":"The first line should be limited to 50 characters and should not end with a period[1].\n\n[1]: https://wiki.openstack.org/wiki/GitCommitMessages","commit_id":"e5a6631aa9d363288e7dec991c39c5b83b6c584f"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"9e841f9e3981e8267941ff1e4addedf47928599d","unresolved":false,"context_lines":[{"line_number":10,"context_line":"by 1 when subnet added into router,In fact, Before subnet added"},{"line_number":11,"context_line":"into the router,\u0027total_ips\u0027 of network does not contain"},{"line_number":12,"context_line":"\u0027gateway_ip\u0027.so we will remove ip which not in subnet pool"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Iea7445c226a15c3e5a8ce1f22cd6d88bd1e1eac6"},{"line_number":15,"context_line":"Closes-Bug: #1585907"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":59,"id":"bff0334d_d3ab1dd3","line":13,"updated":"2017-04-12 19:20:01.000000000","message":"Please include more info in the commit message about how this change is accomplishing the goal above. Many of these changes are not obviously related to the goal (moved queries around, switched to iterating queries instead of dicts, etc). All of these are presumably to exclude non-allocation pool IPs but it\u0027s not obvious how.\n\nIf the patch required refactors to fix the bug, move the refactors to a separate patch so we have one patch that re-organizes code then the follow-up one to change the behavior/fix the bug.","commit_id":"298bdb2f4887c16f636cbb87de4174adbf6f222a"}],"neutron/db/network_ip_availability_db.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"13a8cd35eab41bf5d377fba72bc640257aa87532","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                                mod.Network.id \u003d\u003d mod.Subnet.network_id)"},{"line_number":97,"context_line":"        query \u003d query.outerjoin(mod.IPAllocation,"},{"line_number":98,"context_line":"                                mod.Subnet.id \u003d\u003d mod.IPAllocation.subnet_id)"},{"line_number":99,"context_line":"        "},{"line_number":100,"context_line":"        query \u003d query.outerjoin(mod.Port,"},{"line_number":101,"context_line":"                                mod.IPAllocation.port_id \u003d\u003d mod.Port.id)"},{"line_number":102,"context_line":"         "}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_daff9e32","line":99,"updated":"2016-05-29 12:20:21.000000000","message":"whitespace","commit_id":"9598702b4c04e6ce48d38311e50fb6b7235c9f02"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"13a8cd35eab41bf5d377fba72bc640257aa87532","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        query \u003d query.outerjoin(mod.IPAllocation,"},{"line_number":98,"context_line":"                                mod.Subnet.id \u003d\u003d mod.IPAllocation.subnet_id)"},{"line_number":99,"context_line":"        "},{"line_number":100,"context_line":"        query \u003d query.outerjoin(mod.Port,"},{"line_number":101,"context_line":"                                mod.IPAllocation.port_id \u003d\u003d mod.Port.id)"},{"line_number":102,"context_line":"         "},{"line_number":103,"context_line":"        query \u003d query.group_by(*cls.network_used_ips_columns)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_7a95d2e2","line":100,"updated":"2016-05-29 12:20:21.000000000","message":"please provide a unit test to check this","commit_id":"9598702b4c04e6ce48d38311e50fb6b7235c9f02"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"13a8cd35eab41bf5d377fba72bc640257aa87532","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        "},{"line_number":100,"context_line":"        query \u003d query.outerjoin(mod.Port,"},{"line_number":101,"context_line":"                                mod.IPAllocation.port_id \u003d\u003d mod.Port.id)"},{"line_number":102,"context_line":"         "},{"line_number":103,"context_line":"        query \u003d query.group_by(*cls.network_used_ips_columns)"},{"line_number":104,"context_line":"        query \u003d cls._adjust_query_for_filters(query, filters)"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_3afd0a3b","line":102,"updated":"2016-05-29 12:20:21.000000000","message":"ditto","commit_id":"9598702b4c04e6ce48d38311e50fb6b7235c9f02"},{"author":{"_account_id":20256,"name":"Zhigang Li","email":"li.zhigang3@zte.com.cn","username":"lizhigang"},"change_message_id":"835a46d243f87ba8ca505d5062d2e1e2e7e24ec6","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        network_dict[\u0027used_ips\u0027] +\u003d subnet[\u0027used_ips\u0027]"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    @classmethod"},{"line_number":188,"context_line":"    def _filter_gateway_interface(cls, query):"},{"line_number":189,"context_line":"        query \u003d query.filter(not_(mod.Port.device_owner.contains("},{"line_number":190,"context_line":"            \u0027network:router_interface\u0027)))"},{"line_number":191,"context_line":"        return query"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_a11cf713","line":188,"range":{"start_line":188,"start_character":3,"end_line":188,"end_character":46},"updated":"2016-05-31 07:07:45.000000000","message":"maybe a unit testing is necessary","commit_id":"9598702b4c04e6ce48d38311e50fb6b7235c9f02"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"9196b4bfc07f698829aae786c53829362c6d236b","unresolved":false,"context_lines":[{"line_number":187,"context_line":"    @classmethod"},{"line_number":188,"context_line":"    def _filter_gateway_interface(cls, query):"},{"line_number":189,"context_line":"        query \u003d query.filter(not_(mod.Port.device_owner.contains("},{"line_number":190,"context_line":"            \u0027network:router_interface\u0027)))"},{"line_number":191,"context_line":"        return query"}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_37166ef1","line":190,"updated":"2016-05-31 13:39:24.000000000","message":"You should be using the constant defined in neutron_lib for this.  Plus there might be other interface types (HA replicated?) that you want to filter.","commit_id":"9598702b4c04e6ce48d38311e50fb6b7235c9f02"},{"author":{"_account_id":20787,"name":"Bin Lu","email":"369283883@qq.com","username":"LuBin"},"change_message_id":"1687900bb98ae9d12aef3b6afdfddb8ee425c705","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                      \u0027ip_version\u0027: row.ip_version,"},{"line_number":97,"context_line":"                      \u0027cidr\u0027: row.cidr,"},{"line_number":98,"context_line":"                      SUBNET_NAME: row.subnet_name,"},{"line_number":99,"context_line":"                      \u0027used_ips\u0027: 0, \u0027total_ips\u0027: 0}"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"            subnet_info_dict[row.subnet_id] \u003d subnet"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3aaa91ec_0ef3799f","line":99,"range":{"start_line":99,"start_character":36,"end_line":99,"end_character":51},"updated":"2016-06-29 08:55:54.000000000","message":"\u0027total_ips\u0027 shall be in newline better","commit_id":"aa343ec147db1c1612273490857bfe37bab081ba"},{"author":{"_account_id":20787,"name":"Bin Lu","email":"369283883@qq.com","username":"LuBin"},"change_message_id":"1687900bb98ae9d12aef3b6afdfddb8ee425c705","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                           NETWORK_NAME: row.network_name,"},{"line_number":118,"context_line":"                           \u0027tenant_id\u0027: row.tenant_id,"},{"line_number":119,"context_line":"                           \u0027subnet_ip_availability\u0027: [],"},{"line_number":120,"context_line":"                           \u0027used_ips\u0027: 0, \u0027total_ips\u0027: 0}"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"                network_info_dict[row.network_id] \u003d network"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3aaa91ec_4e60e135","line":120,"range":{"start_line":120,"start_character":42,"end_line":120,"end_character":52},"updated":"2016-06-29 08:55:54.000000000","message":"It shall be in newline better","commit_id":"aa343ec147db1c1612273490857bfe37bab081ba"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"a7ea0c970a7e804daaa9a8d47d4e67c782780a36","unresolved":false,"context_lines":[{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        # update subnet info in network info"},{"line_number":130,"context_line":"        for subnet in subnet_info_dict.values():"},{"line_number":131,"context_line":"            network_info_dict[subnet[NETWORK_ID]][\u0027total_ips\u0027] \\"},{"line_number":132,"context_line":"                +\u003d subnet[\u0027total_ips\u0027]"},{"line_number":133,"context_line":"            network_info_dict[subnet[NETWORK_ID]][\u0027used_ips\u0027] \\"},{"line_number":134,"context_line":"                +\u003d subnet[\u0027used_ips\u0027]"}],"source_content_type":"text/x-python","patch_set":20,"id":"1aa78d24_f7e71044","line":131,"range":{"start_line":131,"start_character":63,"end_line":131,"end_character":64},"updated":"2016-07-14 20:47:48.000000000","message":"nit:  Line continuation using parens is preferred","commit_id":"8d10f23aa7285898b29d51e1b1ccbd6031670139"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"77e5a9789d28a4bf226f77eb430225da7531b8fb","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        mod.Subnet.ip_version"},{"line_number":44,"context_line":"    ]"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    used_columns \u003d ["},{"line_number":47,"context_line":"        mod.Subnet.name.label(SUBNET_NAME),"},{"line_number":48,"context_line":"        mod.Network.tenant_id,"},{"line_number":49,"context_line":"        mod.Network.name.label(NETWORK_NAME),"}],"source_content_type":"text/x-python","patch_set":25,"id":"bacf61ea_4d2cad4a","line":46,"updated":"2016-07-28 04:25:01.000000000","message":"this looks like a refactor, not a bug fix. save it for a different patch.","commit_id":"ec958b336e83306e0dae0547ac40d1a352574c56"},{"author":{"_account_id":20076,"name":"QunyingRan","email":"ran.qunying@zte.com.cn","username":"QunyingRan"},"change_message_id":"b577af9de41727c7ce3ee2444220d6feb1b6ccb7","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        mod.Subnet.ip_version"},{"line_number":44,"context_line":"    ]"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    used_columns \u003d ["},{"line_number":47,"context_line":"        mod.Subnet.name.label(SUBNET_NAME),"},{"line_number":48,"context_line":"        mod.Network.tenant_id,"},{"line_number":49,"context_line":"        mod.Network.name.label(NETWORK_NAME),"}],"source_content_type":"text/x-python","patch_set":25,"id":"9ad45d7e_70100b02","line":46,"in_reply_to":"bacf61ea_4d2cad4a","updated":"2016-08-10 09:18:48.000000000","message":"these will be fix by your suggestions,thanks","commit_id":"ec958b336e83306e0dae0547ac40d1a352574c56"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"77e5a9789d28a4bf226f77eb430225da7531b8fb","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                       \u0027used_ips\u0027: 0, \u0027total_ips\u0027: 0}"},{"line_number":180,"context_line":"            result_dict[db_row.network_id] \u003d network"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        if not cls.used_ip_in_pool(db_row):"},{"line_number":183,"context_line":"            return"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        # Only add subnet data if outerjoin rows have it"}],"source_content_type":"text/x-python","patch_set":25,"id":"bacf61ea_2d3179a3","line":182,"updated":"2016-07-28 04:25:01.000000000","message":"don\u0027t you want this above L172? If an IP is ignored here it will have different behavior between when the network has no IPs and the network has only ignored IPs (the presence in the network dict).","commit_id":"ec958b336e83306e0dae0547ac40d1a352574c56"},{"author":{"_account_id":20076,"name":"QunyingRan","email":"ran.qunying@zte.com.cn","username":"QunyingRan"},"change_message_id":"b577af9de41727c7ce3ee2444220d6feb1b6ccb7","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                       \u0027used_ips\u0027: 0, \u0027total_ips\u0027: 0}"},{"line_number":180,"context_line":"            result_dict[db_row.network_id] \u003d network"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        if not cls.used_ip_in_pool(db_row):"},{"line_number":183,"context_line":"            return"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        # Only add subnet data if outerjoin rows have it"}],"source_content_type":"text/x-python","patch_set":25,"id":"9ad45d7e_50e187fd","line":182,"in_reply_to":"bacf61ea_2d3179a3","updated":"2016-08-10 09:18:48.000000000","message":"I think it can\u0027t be move to line 172, the nerwork who has no used ips will disappear in command if I do that","commit_id":"ec958b336e83306e0dae0547ac40d1a352574c56"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"77e5a9789d28a4bf226f77eb430225da7531b8fb","unresolved":false,"context_lines":[{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    @classmethod"},{"line_number":190,"context_line":"    def _add_subnet_data_to_net(cls, db_row, network_dict, subnet_total_ips):"},{"line_number":191,"context_line":"        if db_row.subnet_id in network_dict[\u0027subnet_ip_availability\u0027]:"},{"line_number":192,"context_line":"            subnet \u003d network_dict[\u0027subnet_ip_availability\u0027][db_row.subnet_id]"},{"line_number":193,"context_line":"            subnet[\u0027used_ips\u0027] +\u003d 1"},{"line_number":194,"context_line":"            network_dict[\u0027used_ips\u0027] +\u003d 1"}],"source_content_type":"text/x-python","patch_set":25,"id":"bacf61ea_8d26a566","line":191,"updated":"2016-07-28 04:25:01.000000000","message":"what is this change? it seems completely unrelated to skipping IPs...","commit_id":"ec958b336e83306e0dae0547ac40d1a352574c56"},{"author":{"_account_id":20076,"name":"QunyingRan","email":"ran.qunying@zte.com.cn","username":"QunyingRan"},"change_message_id":"b577af9de41727c7ce3ee2444220d6feb1b6ccb7","unresolved":false,"context_lines":[{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    @classmethod"},{"line_number":190,"context_line":"    def _add_subnet_data_to_net(cls, db_row, network_dict, subnet_total_ips):"},{"line_number":191,"context_line":"        if db_row.subnet_id in network_dict[\u0027subnet_ip_availability\u0027]:"},{"line_number":192,"context_line":"            subnet \u003d network_dict[\u0027subnet_ip_availability\u0027][db_row.subnet_id]"},{"line_number":193,"context_line":"            subnet[\u0027used_ips\u0027] +\u003d 1"},{"line_number":194,"context_line":"            network_dict[\u0027used_ips\u0027] +\u003d 1"}],"source_content_type":"text/x-python","patch_set":25,"id":"9ad45d7e_10ba6fc0","line":191,"in_reply_to":"bacf61ea_8d26a566","updated":"2016-08-10 09:18:48.000000000","message":"Yes, I can\u0027t list all port types which  will not belong to subnet pool, and the types may be added in future","commit_id":"ec958b336e83306e0dae0547ac40d1a352574c56"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"e0eea3cb8b5c2ff3417097515740882d80e1e1b3","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            network \u003d {NETWORK_ID: db_row.network_id,"},{"line_number":174,"context_line":"                       NETWORK_NAME: db_row.network_name,"},{"line_number":175,"context_line":"                       \u0027tenant_id\u0027: db_row.tenant_id,"},{"line_number":176,"context_line":"                       \u0027subnet_ip_availability\u0027: {},"},{"line_number":177,"context_line":"                       \u0027used_ips\u0027: 0, \u0027total_ips\u0027: 0}"},{"line_number":178,"context_line":"            result_dict[db_row.network_id] \u003d network"},{"line_number":179,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"1ac06dbe_42d8ee1d","line":176,"range":{"start_line":176,"start_character":49,"end_line":176,"end_character":52},"updated":"2016-08-25 02:01:58.000000000","message":"The whole code is OK, but I still feel strange why you modify this to dict? Is there problem the list ?","commit_id":"37bc62567fba6c2e45c5b5bf5a7ce72f75ce6357"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"07b690c4eac4d6dae2f559257e16c281c81f5b66","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    total_ips_columns.append(mod.IPAllocationPool.last_ip)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    @classmethod"},{"line_number":63,"context_line":"    def get_network_ip_availabilities(cls, context, filters\u003dNone):"},{"line_number":64,"context_line":"        \"\"\"Get IP availability stats on a per subnet basis."},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        Returns a list of network summaries which internally contains a list"}],"source_content_type":"text/x-python","patch_set":43,"id":"9a89bdaa_7b971a3a","line":63,"updated":"2016-09-07 03:19:34.000000000","message":"Here\u0027s how I wished this method would go.\n\n  1. Generate the pool of available IPs with one query as a single IPSet called pool.\n  2. Generate an IPSet of allocations as a second query.\n  3. for each subnet in the network:\n        subnet_pool \u003d subnet \u0026 pool\n        subnet_allocations \u003d subnet \u0026 allocations\n        subnet_available \u003d subnet_pool - subnet_allocations\n        subnet_used \u003d subnet_pool \u0026 subnet_allocations\n        # I think this is enough data to construct the results.\n\nIt might be one extra query but I really don\u0027t think it matters much for this particular API end-point.","commit_id":"87c6276534137de98ee45e271822518e358f8204"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"07b690c4eac4d6dae2f559257e16c281c81f5b66","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        query \u003d query.outerjoin(mod.Subnet,"},{"line_number":95,"context_line":"                                mod.Network.id \u003d\u003d mod.Subnet.network_id)"},{"line_number":96,"context_line":"        query \u003d query.outerjoin(mod.IPAllocation,"},{"line_number":97,"context_line":"                                mod.IPAllocation.subnet_id \u003d\u003d mod.Subnet.id)"},{"line_number":98,"context_line":"        query \u003d query.outerjoin(mod.IPAllocationPool,"},{"line_number":99,"context_line":"                                mod.IPAllocationPool.subnet_id \u003d\u003d"},{"line_number":100,"context_line":"                                mod.IPAllocation.subnet_id)"}],"source_content_type":"text/x-python","patch_set":43,"id":"9a89bdaa_3554c8fd","line":97,"range":{"start_line":97,"start_character":32,"end_line":97,"end_character":76},"updated":"2016-09-07 03:19:34.000000000","message":"nit: Why is this condition being flipped around in this patch set?\n\nGiven that IPAllocation has a foreign key constrain on Subnet, I would think that explicitly stating this condition is unnecessary. I think it would look cleaner to eliminate it:\n\n  query \u003d query.outerjoin(mod.IPAllocation)\n\nI think that works.","commit_id":"87c6276534137de98ee45e271822518e358f8204"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"07b690c4eac4d6dae2f559257e16c281c81f5b66","unresolved":false,"context_lines":[{"line_number":97,"context_line":"                                mod.IPAllocation.subnet_id \u003d\u003d mod.Subnet.id)"},{"line_number":98,"context_line":"        query \u003d query.outerjoin(mod.IPAllocationPool,"},{"line_number":99,"context_line":"                                mod.IPAllocationPool.subnet_id \u003d\u003d"},{"line_number":100,"context_line":"                                mod.IPAllocation.subnet_id)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        query \u003d query.group_by(*cls.network_used_ips_columns)"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"9a89bdaa_755ad02b","line":100,"updated":"2016-09-07 03:19:34.000000000","message":"Given that IPAllocationPool has a FK constraint on Subnet and you already have a constraint that IPAllocation.subnet_id \u003d\u003d Subnet.id above, I think you can also eliminate this constraint to clean things up a little bit.\n\n  query \u003d query.outerjoin(mod.IPAllocationPool)\n\nThe above should use an implicit condition, IPAllocationPool.subnet_id \u003d\u003d Subnet.id which, in this context, is effectively the same as the condition here.","commit_id":"87c6276534137de98ee45e271822518e358f8204"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"07b690c4eac4d6dae2f559257e16c281c81f5b66","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        query \u003d query.outerjoin(mod.IPAllocationPool,"},{"line_number":99,"context_line":"                                mod.IPAllocationPool.subnet_id \u003d\u003d"},{"line_number":100,"context_line":"                                mod.IPAllocation.subnet_id)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        query \u003d query.group_by(*cls.network_used_ips_columns)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        return cls._adjust_query_for_filters(query, filters)"}],"source_content_type":"text/x-python","patch_set":43,"id":"9a89bdaa_95faf473","line":101,"updated":"2016-09-07 03:19:34.000000000","message":"The number of results from this query is O(NM). With N matching allocation pool records, and M IP allocations on a subnet. It could be selecting a lot more rows than needed.","commit_id":"87c6276534137de98ee45e271822518e358f8204"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"07b690c4eac4d6dae2f559257e16c281c81f5b66","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        \"\"\"Generates a dict whose key\u003dsubnet_id, value\u003dtotal_ips in subnet\"\"\""},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        # Query to get total_ips counts"},{"line_number":122,"context_line":"        total_ips_query \u003d cls._build_total_ips_query(context, filters)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        subnet_totals_dict \u003d {}"},{"line_number":125,"context_line":"        for row in total_ips_query:"}],"source_content_type":"text/x-python","patch_set":43,"id":"9a89bdaa_78b48081","line":122,"updated":"2016-09-07 03:19:34.000000000","message":"I\u0027m noticing here now that we\u0027re already selecting the whole pool here. This makes me think there is no reason to do the clever join on L101. Couldn\u0027t we create an IPSet from the results of this query and use it later to calculate usage?  In fact, I think this method ought to return an IPSet instead of this dict thing.","commit_id":"87c6276534137de98ee45e271822518e358f8204"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"07b690c4eac4d6dae2f559257e16c281c81f5b66","unresolved":false,"context_lines":[{"line_number":153,"context_line":"    @classmethod"},{"line_number":154,"context_line":"    def used_ip_in_pool(cls, row):"},{"line_number":155,"context_line":"        if row.last_ip:"},{"line_number":156,"context_line":"            if row.ip and row.ip not in netaddr.IPRange("},{"line_number":157,"context_line":"                    netaddr.IPAddress(row.first_ip),"},{"line_number":158,"context_line":"                    netaddr.IPAddress(row.last_ip)):"},{"line_number":159,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":43,"id":"9a89bdaa_f8bc1008","line":156,"updated":"2016-09-07 03:19:34.000000000","message":"I think this check nullifies the fact that every combination of IPAllocation / IPAllocationPool on a subnet comes out of the join (see comment L101). Only the combination of IPAllocation / IPAllocationPool that matches will be true effectively filtering out non-matching results. I still think it\u0027d be a little cleaner to select a little more cleanly.\n\nIt is clever to be able to select these results in one query. But, I wouldn\u0027t mind doing two queries: 1 to select the pools and created an IPSet from them and another to select the IPAllocations and filter them by the IPSet. I don\u0027t think this is a query we really need to optimize in such a clever way. \n\nIf you did this, this code would get cleaned up a little and I think it\u0027d be easier to reason about. For example, if you construct an IPSet ahead of time, this whole method would essentially become this:\n\n  return row.ip in pool\n\nActually, you could go further by constring IPsets for the pool and for the allocations and just do a set intersection to find the results. Then, given the results, you could probably generate the subnet-by-subnet results more easily.","commit_id":"87c6276534137de98ee45e271822518e358f8204"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"07b690c4eac4d6dae2f559257e16c281c81f5b66","unresolved":false,"context_lines":[{"line_number":156,"context_line":"            if row.ip and row.ip not in netaddr.IPRange("},{"line_number":157,"context_line":"                    netaddr.IPAddress(row.first_ip),"},{"line_number":158,"context_line":"                    netaddr.IPAddress(row.last_ip)):"},{"line_number":159,"context_line":"                return False"},{"line_number":160,"context_line":"        else:"},{"line_number":161,"context_line":"            if row.ip and row.ip not in netaddr.IPNetwork("},{"line_number":162,"context_line":"                    row.cidr, version\u003drow.ip_version):"}],"source_content_type":"text/x-python","patch_set":43,"id":"9a89bdaa_78fc8072","line":159,"updated":"2016-09-07 03:19:34.000000000","message":"Why not just return the boolean condition?\n\n  return row.ip and row.ip not in netaddr.IPRange()","commit_id":"87c6276534137de98ee45e271822518e358f8204"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"07b690c4eac4d6dae2f559257e16c281c81f5b66","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            network \u003d {NETWORK_ID: db_row.network_id,"},{"line_number":174,"context_line":"                       NETWORK_NAME: db_row.network_name,"},{"line_number":175,"context_line":"                       \u0027tenant_id\u0027: db_row.tenant_id,"},{"line_number":176,"context_line":"                       \u0027subnet_ip_availability\u0027: {},"},{"line_number":177,"context_line":"                       \u0027used_ips\u0027: 0, \u0027total_ips\u0027: 0}"},{"line_number":178,"context_line":"            result_dict[db_row.network_id] \u003d network"},{"line_number":179,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"9a89bdaa_d8258c09","line":176,"range":{"start_line":176,"start_character":49,"end_line":176,"end_character":51},"updated":"2016-09-07 03:19:34.000000000","message":"Doesn\u0027t this change the API? We can\u0027t change the API.","commit_id":"87c6276534137de98ee45e271822518e358f8204"}],"neutron/tests/unit/extensions/test_network_ip_availability.py":[{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"bed57865cee828751319a34d0ebc6088520ed750","unresolved":false,"context_lines":[{"line_number":367,"context_line":"                    self._validate_from_availabilities(response[IP_AVAILS_KEY],"},{"line_number":368,"context_line":"                                                       net, 2)"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":"    def test_usages_gateway_port_consumed_v6(self):"},{"line_number":371,"context_line":"        with self.network() as net:"},{"line_number":372,"context_line":"            with self.subnet(network\u003dnet, cidr\u003d\u0027fe80::/64\u0027,"},{"line_number":373,"context_line":"                             gateway_ip\u003d\u0027fe80::1\u0027, ip_version\u003d6) as subnet:"}],"source_content_type":"text/x-python","patch_set":49,"id":"1a6eadb0_2cf06390","line":370,"range":{"start_line":370,"start_character":8,"end_line":370,"end_character":44},"updated":"2016-12-13 09:45:06.000000000","message":"This is almost duplicate to test_usages_gateway_port_consumed_v4(). How about the following?\n\n\n def _test_usages_gateway_port_consumed(ip_version, cidr, gateway_ip, expected_total_ips):\n\n\n def test_usages_gateway_port_consumed_v4(self):\n     _test_usages_gateway_port_consumed(ip_version\u003d4, cidr\u003d\u0027192.168.200.0/24\u0027, gateway_ip\u003d\u0027192.168.200.100\u0027, expected_total_ips\u003d253)\n\n\n def test_usages_gateway_port_consumed_v6(self):\n     _test_usages_gateway_port_consumed(ip_version\u003d6, cidr\u003d\u0027fe80::/64\u0027, gateway_ip\u003d\u0027fe80::1\u0027, expected_total_ips\u003d18446744073709551614)","commit_id":"e5a6631aa9d363288e7dec991c39c5b83b6c584f"}]}
