)]}'
{"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c9c52967680bff8e9804287d5b7248e5277ca924","unresolved":false,"context_lines":[{"line_number":1198,"context_line":"                db_port \u003d self._create_port_with_mac("},{"line_number":1199,"context_line":"                    context, network_id, port_data, p[\u0027mac_address\u0027])"},{"line_number":1200,"context_line":""},{"line_number":1201,"context_line":"            ips \u003d self.ipam.allocate_ips_for_port_and_store(context, port,"},{"line_number":1202,"context_line":"                                                            port_id)"},{"line_number":1203,"context_line":"            if \u0027dns_name\u0027 in p:"},{"line_number":1204,"context_line":"                dns_assignment \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa69d971_fe13e262","line":1201,"updated":"2016-01-06 23:24:08.000000000","message":"I think the appropriate fix would be to pass in port_data here instead of modifying the passed in dictionary.","commit_id":"76b172089c5908e337bc6c2f5a10c5ed29b0ecc3"},{"author":{"_account_id":13768,"name":"Pavel Bondar","email":"pbondar@infoblox.com","username":"pavel_bondar"},"change_message_id":"357987331f34b3beac2fc021e5c32d53d412991d","unresolved":false,"context_lines":[{"line_number":1198,"context_line":"                db_port \u003d self._create_port_with_mac("},{"line_number":1199,"context_line":"                    context, network_id, port_data, p[\u0027mac_address\u0027])"},{"line_number":1200,"context_line":""},{"line_number":1201,"context_line":"            ips \u003d self.ipam.allocate_ips_for_port_and_store(context, port,"},{"line_number":1202,"context_line":"                                                            port_id)"},{"line_number":1203,"context_line":"            if \u0027dns_name\u0027 in p:"},{"line_number":1204,"context_line":"                dns_assignment \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_81e9ae82","line":1201,"in_reply_to":"da6ed579_276e0430","updated":"2016-01-13 13:28:15.000000000","message":"Yes, fix can be moved to ipam allocate_ips_for_port_and_store.\nCopy of port dict can be created there and port_id populated into it.\nThis way unpluggable ipam implementation is not affected (desired effect).","commit_id":"76b172089c5908e337bc6c2f5a10c5ed29b0ecc3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d538619698ba8189483dda93bd12f2b8b9893856","unresolved":false,"context_lines":[{"line_number":1198,"context_line":"                db_port \u003d self._create_port_with_mac("},{"line_number":1199,"context_line":"                    context, network_id, port_data, p[\u0027mac_address\u0027])"},{"line_number":1200,"context_line":""},{"line_number":1201,"context_line":"            ips \u003d self.ipam.allocate_ips_for_port_and_store(context, port,"},{"line_number":1202,"context_line":"                                                            port_id)"},{"line_number":1203,"context_line":"            if \u0027dns_name\u0027 in p:"},{"line_number":1204,"context_line":"                dns_assignment \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_96d49120","line":1201,"in_reply_to":"da6ed579_81e9ae82","updated":"2016-01-13 14:26:11.000000000","message":"I agree that is the correct place for this and not the changes above","commit_id":"76b172089c5908e337bc6c2f5a10c5ed29b0ecc3"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"364fbf51a6f97205e5e830736d04b7a348fb9e39","unresolved":false,"context_lines":[{"line_number":1198,"context_line":"                db_port \u003d self._create_port_with_mac("},{"line_number":1199,"context_line":"                    context, network_id, port_data, p[\u0027mac_address\u0027])"},{"line_number":1200,"context_line":""},{"line_number":1201,"context_line":"            ips \u003d self.ipam.allocate_ips_for_port_and_store(context, port,"},{"line_number":1202,"context_line":"                                                            port_id)"},{"line_number":1203,"context_line":"            if \u0027dns_name\u0027 in p:"},{"line_number":1204,"context_line":"                dns_assignment \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_276e0430","line":1201,"in_reply_to":"fa69d971_47effa86","updated":"2016-01-12 17:41:11.000000000","message":"We are already passing port_id to this method as the third argument.  Why would we need to pass port_data?  Could this fix be pushed down in to IPAM since we are already passing it the port_id?","commit_id":"76b172089c5908e337bc6c2f5a10c5ed29b0ecc3"},{"author":{"_account_id":13768,"name":"Pavel Bondar","email":"pbondar@infoblox.com","username":"pavel_bondar"},"change_message_id":"b581e0883f17e5f31d361299e1ca91297f995ca7","unresolved":false,"context_lines":[{"line_number":1198,"context_line":"                db_port \u003d self._create_port_with_mac("},{"line_number":1199,"context_line":"                    context, network_id, port_data, p[\u0027mac_address\u0027])"},{"line_number":1200,"context_line":""},{"line_number":1201,"context_line":"            ips \u003d self.ipam.allocate_ips_for_port_and_store(context, port,"},{"line_number":1202,"context_line":"                                                            port_id)"},{"line_number":1203,"context_line":"            if \u0027dns_name\u0027 in p:"},{"line_number":1204,"context_line":"                dns_assignment \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa69d971_47effa86","line":1201,"in_reply_to":"fa69d971_fe13e262","updated":"2016-01-11 15:35:08.000000000","message":"There is an issue with passing port_data instead of port dict.\nFor example port_data does not contain some fields like \u0027mac_address\u0027, that may be used in custom address factory request.\nProbably some other fields that present in port dict might be missed from db_port.\n\nI\u0027ll try to switch to pass port_data and add \u0027mac_address\u0027 to it.","commit_id":"76b172089c5908e337bc6c2f5a10c5ed29b0ecc3"}],"neutron/db/ipam_pluggable_backend.py":[{"author":{"_account_id":17609,"name":"steve","email":"ruansx@cn.ibm.com","username":"steve.ruan"},"change_message_id":"bf1cc5734886fb36f2568597f6e92215f9c72b30","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        ipam_driver \u003d driver.Pool.get_instance(None, context)"},{"line_number":150,"context_line":"        ipam_driver.remove_subnet(subnet_id)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def allocate_ips_for_port_and_store(self, context, port_dict, port_id):"},{"line_number":153,"context_line":"        # Make a copy of port dict to prevent changing"},{"line_number":154,"context_line":"        # incoming dict by adding \u0027id\u0027 to it."},{"line_number":155,"context_line":"        port \u003d {\u0027port\u0027: port_dict[\u0027port\u0027].copy()}"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_59272264","line":152,"range":{"start_line":152,"start_character":55,"end_line":152,"end_character":64},"updated":"2016-01-22 04:17:59.000000000","message":"same API in ipam_non_pluggable_backend.py does not need port id?","commit_id":"c2a5f89c4157869630e9b712bed70c6fc98e3d2e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"8ccf15832bf290b09bc69ab43bd62c87cc218a96","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        ipam_driver \u003d driver.Pool.get_instance(None, context)"},{"line_number":150,"context_line":"        ipam_driver.remove_subnet(subnet_id)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def allocate_ips_for_port_and_store(self, context, port_dict, port_id):"},{"line_number":153,"context_line":"        # Make a copy of port dict to prevent changing"},{"line_number":154,"context_line":"        # incoming dict by adding \u0027id\u0027 to it."},{"line_number":155,"context_line":"        port \u003d {\u0027port\u0027: port_dict[\u0027port\u0027].copy()}"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_435e2c45","line":152,"range":{"start_line":152,"start_character":55,"end_line":152,"end_character":64},"in_reply_to":"9a68dd71_59272264","updated":"2016-01-22 18:09:54.000000000","message":"The name of this argument should match the same method in the non-pluggable version.  It is called port there and should be called port here since they both are aiming at supporting the same interface.  I\u0027ll fix it up and +2.","commit_id":"c2a5f89c4157869630e9b712bed70c6fc98e3d2e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"73a5b93f87bdc230a7bad589d12a7a6612a1da42","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    def allocate_ips_for_port_and_store(self, context, port, port_id):"},{"line_number":153,"context_line":"        # Make a copy of port dict to prevent changing"},{"line_number":154,"context_line":"        # incoming dict by adding \u0027id\u0027 to it."},{"line_number":155,"context_line":"        port_copy \u003d {\u0027port\u0027: port[\u0027port\u0027].copy()}"},{"line_number":156,"context_line":"        port_copy[\u0027port\u0027][\u0027id\u0027] \u003d port_id"},{"line_number":157,"context_line":"        network_id \u003d port_copy[\u0027port\u0027][\u0027network_id\u0027]"},{"line_number":158,"context_line":"        ips \u003d []"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a68dd71_39c23b35","line":155,"updated":"2016-01-22 22:59:10.000000000","message":"should we not consider a deep copy here?","commit_id":"721077cdda39899a38baaa73f59b1e0746106355"},{"author":{"_account_id":13768,"name":"Pavel Bondar","email":"pbondar@infoblox.com","username":"pavel_bondar"},"change_message_id":"ef67737d2f1d7539b3d6ded5a0cdfdd4f790a161","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    def allocate_ips_for_port_and_store(self, context, port, port_id):"},{"line_number":153,"context_line":"        # Make a copy of port dict to prevent changing"},{"line_number":154,"context_line":"        # incoming dict by adding \u0027id\u0027 to it."},{"line_number":155,"context_line":"        port_copy \u003d {\u0027port\u0027: port[\u0027port\u0027].copy()}"},{"line_number":156,"context_line":"        port_copy[\u0027port\u0027][\u0027id\u0027] \u003d port_id"},{"line_number":157,"context_line":"        network_id \u003d port_copy[\u0027port\u0027][\u0027network_id\u0027]"},{"line_number":158,"context_line":"        ips \u003d []"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a68dd71_4de1402c","line":155,"in_reply_to":"9a68dd71_39c23b35","updated":"2016-01-25 09:37:23.000000000","message":"as I recall I saw some UT failures with deep copy,\nbut I\u0027ll try it one more time and at least post the exact root cause (if deepcopy don\u0027t work out)","commit_id":"721077cdda39899a38baaa73f59b1e0746106355"},{"author":{"_account_id":13768,"name":"Pavel Bondar","email":"pbondar@infoblox.com","username":"pavel_bondar"},"change_message_id":"8b9eaaf1c49afdc1afa58f0f38e35453763de4d8","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    def allocate_ips_for_port_and_store(self, context, port, port_id):"},{"line_number":153,"context_line":"        # Make a copy of port dict to prevent changing"},{"line_number":154,"context_line":"        # incoming dict by adding \u0027id\u0027 to it."},{"line_number":155,"context_line":"        port_copy \u003d {\u0027port\u0027: port[\u0027port\u0027].copy()}"},{"line_number":156,"context_line":"        port_copy[\u0027port\u0027][\u0027id\u0027] \u003d port_id"},{"line_number":157,"context_line":"        network_id \u003d port_copy[\u0027port\u0027][\u0027network_id\u0027]"},{"line_number":158,"context_line":"        ips \u003d []"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a68dd71_1d060c52","line":155,"in_reply_to":"9a68dd71_4de1402c","updated":"2016-01-25 13:09:23.000000000","message":"Yep, UT fails with deepcopy.\n\n      File \"neutron/db/ipam_pluggable_backend.py\", line 162, in allocate_ips_for_port_and_store\n        ips \u003d self._allocate_ips_for_port(context, port)\n      File \"neutron/db/ipam_pluggable_backend.py\", line 200, in _allocate_ips_for_port\n        p[\u0027device_owner\u0027])\n      File \"neutron/db/ipam_pluggable_backend.py\", line 248, in _test_fixed_ips_for_port\n        for fixed in fixed_ips:\n    TypeError: \u0027object\u0027 object is not iterable\n\nAnd the reason is next:\nport[\u0027fixed_ips\u0027] can be set to attributes.ATTR_NOT_SPECIFIED, which is instance of object.\nBut after making deepcopy, copy of that instance is created (with new address), and check [1] no longer detects attributes.ATTR_NOT_SPECIFIED.\n\nSo using shallow copy works fine for this case:\n- prevents from changing incoming dict on \u0027id\u0027 adding;\n- doesn\u0027t change object address for attributes.ATTR_NOT_SPECIFIED case\n\nI\u0027ll add more coments to clarify that.\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/db/ipam_pluggable_backend.py#L189","commit_id":"721077cdda39899a38baaa73f59b1e0746106355"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"d82a014bba79436113f5a8b613316b3b08275a78","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        ipam_driver \u003d driver.Pool.get_instance(None, context)"},{"line_number":150,"context_line":"        ipam_driver.remove_subnet(subnet_id)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def allocate_ips_for_port_and_store(self, context, port_dict, port_id):"},{"line_number":153,"context_line":"        # Make a copy of port dict to prevent changing"},{"line_number":154,"context_line":"        # incoming dict by adding \u0027id\u0027 to it."},{"line_number":155,"context_line":"        # Deepcopy doesn\u0027t work correctly in this case, because copy of"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a5de9d1_60d16efb","line":152,"range":{"start_line":152,"start_character":55,"end_line":152,"end_character":64},"updated":"2016-01-27 11:40:41.000000000","message":"See my comment on PS3.","commit_id":"a6da58f0e40cdd9449e6c384b3dbeef234acc3de"},{"author":{"_account_id":13768,"name":"Pavel Bondar","email":"pbondar@infoblox.com","username":"pavel_bondar"},"change_message_id":"90e6d72d80d892639f97b505ca80079539a34c1f","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        ipam_driver \u003d driver.Pool.get_instance(None, context)"},{"line_number":150,"context_line":"        ipam_driver.remove_subnet(subnet_id)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def allocate_ips_for_port_and_store(self, context, port_dict, port_id):"},{"line_number":153,"context_line":"        # Make a copy of port dict to prevent changing"},{"line_number":154,"context_line":"        # incoming dict by adding \u0027id\u0027 to it."},{"line_number":155,"context_line":"        # Deepcopy doesn\u0027t work correctly in this case, because copy of"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a5de9d1_3b1debbd","line":152,"range":{"start_line":152,"start_character":55,"end_line":152,"end_character":64},"in_reply_to":"7a5de9d1_60d16efb","updated":"2016-01-27 11:59:14.000000000","message":"Ah, sorry, picked up older version as a base, so changes from PS4 got lost.","commit_id":"a6da58f0e40cdd9449e6c384b3dbeef234acc3de"}],"neutron/tests/unit/db/test_ipam_pluggable_backend.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"73a5b93f87bdc230a7bad589d12a7a6612a1da42","unresolved":false,"context_lines":[{"line_number":581,"context_line":"                                                            port_dict_with_id,"},{"line_number":582,"context_line":"                                                            ip_dict)"},{"line_number":583,"context_line":"        # Verify incoming port dict is not changed (\u0027id\u0027 is not added to it)"},{"line_number":584,"context_line":"        self.assertEqual(None, port_dict[\u0027port\u0027].get(\u0027id\u0027))"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a68dd71_39d9db22","line":584,"updated":"2016-01-22 22:59:10.000000000","message":"please use assertIsNone","commit_id":"721077cdda39899a38baaa73f59b1e0746106355"},{"author":{"_account_id":13768,"name":"Pavel Bondar","email":"pbondar@infoblox.com","username":"pavel_bondar"},"change_message_id":"ef67737d2f1d7539b3d6ded5a0cdfdd4f790a161","unresolved":false,"context_lines":[{"line_number":581,"context_line":"                                                            port_dict_with_id,"},{"line_number":582,"context_line":"                                                            ip_dict)"},{"line_number":583,"context_line":"        # Verify incoming port dict is not changed (\u0027id\u0027 is not added to it)"},{"line_number":584,"context_line":"        self.assertEqual(None, port_dict[\u0027port\u0027].get(\u0027id\u0027))"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a68dd71_32a54946","line":584,"in_reply_to":"9a68dd71_39d9db22","updated":"2016-01-25 09:37:23.000000000","message":"will do","commit_id":"721077cdda39899a38baaa73f59b1e0746106355"}]}
