)]}'
{"neutron/db/ipam_backend_mixin.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c0d5d616b655766acd94aae4f32aa3138a505abe","unresolved":false,"context_lines":[{"line_number":167,"context_line":"    def _update_subnet_allocation_pools(self, context, subnet_id, s):"},{"line_number":168,"context_line":"        obj_pools \u003d subnet_obj.IPAllocationPool.get_objects("},{"line_number":169,"context_line":"            context, subnet_id\u003dsubnet_id)"},{"line_number":170,"context_line":"        # TODO(electrocucaracha) Replace with delete_objecs method once it is"},{"line_number":171,"context_line":"        # able"},{"line_number":172,"context_line":"        for obj_pool in obj_pools:"},{"line_number":173,"context_line":"            obj_pool.delete()"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a71b18c_c292579f","line":170,"range":{"start_line":170,"start_character":46,"end_line":170,"end_character":59},"updated":"2016-12-08 06:29:28.000000000","message":"delete_objects","commit_id":"407e1ab7a939b53e02fa0338e54f5e91a0980ce6"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"7ac7f0e36365f79d38d39064dda88473ee257083","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        obj_pools \u003d subnet_obj.IPAllocationPool.get_objects("},{"line_number":169,"context_line":"            context, subnet_id\u003dsubnet_id)"},{"line_number":170,"context_line":"        # TODO(electrocucaracha) Replace with delete_objecs method once it is"},{"line_number":171,"context_line":"        # able"},{"line_number":172,"context_line":"        for obj_pool in obj_pools:"},{"line_number":173,"context_line":"            obj_pool.delete()"},{"line_number":174,"context_line":"        pools \u003d [(netaddr.IPAddress(p.first, p.version).format(),"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a71b18c_1fac99ec","line":171,"range":{"start_line":171,"start_character":10,"end_line":171,"end_character":14},"updated":"2016-12-08 11:52:13.000000000","message":"enabled?","commit_id":"407e1ab7a939b53e02fa0338e54f5e91a0980ce6"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"7ac7f0e36365f79d38d39064dda88473ee257083","unresolved":false,"context_lines":[{"line_number":174,"context_line":"        pools \u003d [(netaddr.IPAddress(p.first, p.version).format(),"},{"line_number":175,"context_line":"                  netaddr.IPAddress(p.last, p.version).format())"},{"line_number":176,"context_line":"                 for p in s[\u0027allocation_pools\u0027]]"},{"line_number":177,"context_line":"        for p in pools:"},{"line_number":178,"context_line":"            subnet_obj.IPAllocationPool(context, start\u003dp[0], end\u003dp[1],"},{"line_number":179,"context_line":"                                        subnet_id\u003dsubnet_id).create()"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        # Gather new pools for result"},{"line_number":182,"context_line":"        result_pools \u003d [{\u0027start\u0027: p[0], \u0027end\u0027: p[1]} for p in pools]"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a71b18c_3f0315ba","line":179,"range":{"start_line":177,"start_character":8,"end_line":179,"end_character":69},"updated":"2016-12-08 11:52:13.000000000","message":"maybe transaction here would be good?","commit_id":"407e1ab7a939b53e02fa0338e54f5e91a0980ce6"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"ec432766e8f17c3fa07db3583ab4867eddd9a8c6","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":170,"context_line":"            obj_pools \u003d subnet_obj.IPAllocationPool.get_objects("},{"line_number":171,"context_line":"                context, subnet_id\u003dsubnet_id)"},{"line_number":172,"context_line":"            # TODO(electrocucaracha) Replace with delete_objects method once it"},{"line_number":173,"context_line":"            # is enabled"},{"line_number":174,"context_line":"            for obj_pool in obj_pools:"},{"line_number":175,"context_line":"                obj_pool.delete()"},{"line_number":176,"context_line":"            pools \u003d [(netaddr.IPAddress(p.first, p.version).format(),"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a6eadb0_df0321bd","line":173,"range":{"start_line":172,"start_character":12,"end_line":173,"end_character":24},"updated":"2016-12-19 08:04:20.000000000","message":"It is already merged.","commit_id":"38a5cd4319e04800c71ad1118427458a35bcfb6d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e72fe19a0afdd4b7d4928b92ab71b8c36379c2b6","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        return new_dns_addr_list"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def _update_subnet_allocation_pools(self, context, subnet_id, s):"},{"line_number":167,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":168,"context_line":"            subnet_obj.IPAllocationPool.delete_objects(context,"},{"line_number":169,"context_line":"                                                       subnet_id\u003dsubnet_id)"},{"line_number":170,"context_line":"            pools \u003d [(netaddr.IPAddress(p.first, p.version).format(),"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_794adbad","line":167,"updated":"2016-12-20 15:20:44.000000000","message":"can you please add a comment here explaining why we do this under a database session","commit_id":"75af4fa817ff43d6a749c04cf5358ada9693306c"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"d54e9f4cfcba36aa503fd1d07385f3a25c511284","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        return new_dns_addr_list"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def _update_subnet_allocation_pools(self, context, subnet_id, s):"},{"line_number":167,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":168,"context_line":"            subnet_obj.IPAllocationPool.delete_objects(context,"},{"line_number":169,"context_line":"                                                       subnet_id\u003dsubnet_id)"},{"line_number":170,"context_line":"            pools \u003d [(netaddr.IPAddress(p.first, p.version).format(),"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba5201f7_e230480a","line":167,"in_reply_to":"1a6eadb0_794adbad","updated":"2016-12-29 20:44:09.000000000","message":"Do we need a database session here as delete_objects has the context.session.begin [1]?\n\n[1]https://github.com/openstack/neutron/blob/master/neutron/objects/db/api.py#L99","commit_id":"75af4fa817ff43d6a749c04cf5358ada9693306c"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"4e623e32fe9ad8668b9d2063903b48b61e1f2f04","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        return new_dns_addr_list"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def _update_subnet_allocation_pools(self, context, subnet_id, s):"},{"line_number":167,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":168,"context_line":"            subnet_obj.IPAllocationPool.delete_objects(context,"},{"line_number":169,"context_line":"                                                       subnet_id\u003dsubnet_id)"},{"line_number":170,"context_line":"            pools \u003d [(netaddr.IPAddress(p.first, p.version).format(),"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba5201f7_6c320912","line":167,"in_reply_to":"1a6eadb0_794adbad","updated":"2017-01-11 21:17:14.000000000","message":"Done","commit_id":"75af4fa817ff43d6a749c04cf5358ada9693306c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"805bb76c04216e444ac8165b71d281c20666fc88","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        # NOTE(electrocucaracha) Given that this update process is made in two"},{"line_number":169,"context_line":"        # sql instructions(create and insert), it\u0027s necessary to warranty the"},{"line_number":170,"context_line":"        # atomicity of this action using an explicit transaction"},{"line_number":171,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":172,"context_line":"            subnet_obj.IPAllocationPool.delete_objects(context,"},{"line_number":173,"context_line":"                                                       subnet_id\u003dsubnet_id)"},{"line_number":174,"context_line":"            pools \u003d [(netaddr.IPAddress(p.first, p.version).format(),"}],"source_content_type":"text/x-python","patch_set":13,"id":"7ffa3b31_6b078d1e","line":171,"updated":"2017-04-16 03:22:22.000000000","message":"The decorator above this function already does this.","commit_id":"b84336b340fe8a78882f5f8cfe86cba394ae1593"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"f5a3e6f2fd6f97e41f996583c7345a6c712b6c6e","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    @db_api.context_manager.writer"},{"line_number":167,"context_line":"    def _update_subnet_allocation_pools(self, context, subnet_id, s):"},{"line_number":168,"context_line":"        # NOTE(electrocucaracha) Given that this update process is made in two"},{"line_number":169,"context_line":"        # sql instructions(create and insert), it\u0027s necessary to warranty the"},{"line_number":170,"context_line":"        # atomicity of this action using an explicit transaction"},{"line_number":171,"context_line":"        subnet_obj.IPAllocationPool.delete_objects(context,"},{"line_number":172,"context_line":"                                                   subnet_id\u003dsubnet_id)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7f231b9d_4af2a308","line":169,"range":{"start_line":169,"start_character":27,"end_line":169,"end_character":33},"updated":"2017-06-09 18:13:16.000000000","message":"delete?","commit_id":"26c195c9875dfd4314919782dd9108216b98e56f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"f5a3e6f2fd6f97e41f996583c7345a6c712b6c6e","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    @db_api.context_manager.writer"},{"line_number":167,"context_line":"    def _update_subnet_allocation_pools(self, context, subnet_id, s):"},{"line_number":168,"context_line":"        # NOTE(electrocucaracha) Given that this update process is made in two"},{"line_number":169,"context_line":"        # sql instructions(create and insert), it\u0027s necessary to warranty the"},{"line_number":170,"context_line":"        # atomicity of this action using an explicit transaction"},{"line_number":171,"context_line":"        subnet_obj.IPAllocationPool.delete_objects(context,"},{"line_number":172,"context_line":"                                                   subnet_id\u003dsubnet_id)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7f231b9d_aae2572e","line":169,"range":{"start_line":169,"start_character":65,"end_line":169,"end_character":73},"updated":"2017-06-09 18:13:16.000000000","message":"guarantee","commit_id":"26c195c9875dfd4314919782dd9108216b98e56f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"f5a3e6f2fd6f97e41f996583c7345a6c712b6c6e","unresolved":false,"context_lines":[{"line_number":167,"context_line":"    def _update_subnet_allocation_pools(self, context, subnet_id, s):"},{"line_number":168,"context_line":"        # NOTE(electrocucaracha) Given that this update process is made in two"},{"line_number":169,"context_line":"        # sql instructions(create and insert), it\u0027s necessary to warranty the"},{"line_number":170,"context_line":"        # atomicity of this action using an explicit transaction"},{"line_number":171,"context_line":"        subnet_obj.IPAllocationPool.delete_objects(context,"},{"line_number":172,"context_line":"                                                   subnet_id\u003dsubnet_id)"},{"line_number":173,"context_line":"        pools \u003d [(netaddr.IPAddress(p.first, p.version).format(),"}],"source_content_type":"text/x-python","patch_set":14,"id":"7f231b9d_2ad08750","line":170,"updated":"2017-06-09 18:13:16.000000000","message":"not sure what this comment explains. the line 166? well, it\u0027s already there, not related to this patch.","commit_id":"26c195c9875dfd4314919782dd9108216b98e56f"}],"neutron/db/ipam_pluggable_backend.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e72fe19a0afdd4b7d4928b92ab71b8c36379c2b6","unresolved":false,"context_lines":[{"line_number":313,"context_line":"            first_ip \u003d str(netaddr.IPAddress(pool.first, pool.version))"},{"line_number":314,"context_line":"            last_ip \u003d str(netaddr.IPAddress(pool.last, pool.version))"},{"line_number":315,"context_line":"            obj_subnet.IPAllocationPool("},{"line_number":316,"context_line":"                context, subnet_id\u003dsubnet[\u0027id\u0027], start\u003dfirst_ip,"},{"line_number":317,"context_line":"                end\u003dlast_ip).create()"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"    def update_port_with_ips(self, context, host, db_port, new_port, new_mac):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_d93befe9","line":316,"range":{"start_line":316,"start_character":49,"end_line":316,"end_character":54},"updated":"2016-12-20 15:20:44.000000000","message":"unrelated to this patch - why do we have start and end and prior to that it was first_ip and last_ip.\nplease consider changing the names of the variables above","commit_id":"75af4fa817ff43d6a749c04cf5358ada9693306c"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"4e623e32fe9ad8668b9d2063903b48b61e1f2f04","unresolved":false,"context_lines":[{"line_number":313,"context_line":"            first_ip \u003d str(netaddr.IPAddress(pool.first, pool.version))"},{"line_number":314,"context_line":"            last_ip \u003d str(netaddr.IPAddress(pool.last, pool.version))"},{"line_number":315,"context_line":"            obj_subnet.IPAllocationPool("},{"line_number":316,"context_line":"                context, subnet_id\u003dsubnet[\u0027id\u0027], start\u003dfirst_ip,"},{"line_number":317,"context_line":"                end\u003dlast_ip).create()"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"    def update_port_with_ips(self, context, host, db_port, new_port, new_mac):"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba5201f7_0c533d6c","line":316,"range":{"start_line":316,"start_character":49,"end_line":316,"end_character":54},"in_reply_to":"1a6eadb0_d93befe9","updated":"2017-01-11 21:17:14.000000000","message":"These fields are translated by the OVO class[1], once this patch replaces the model class these needs to be replaced as well.\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/objects/subnet.py#L107-L110","commit_id":"75af4fa817ff43d6a749c04cf5358ada9693306c"}],"neutron/db/network_ip_availability_db.py":[{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"d54e9f4cfcba36aa503fd1d07385f3a25c511284","unresolved":false,"context_lines":[{"line_number":114,"context_line":"    def _generate_subnet_total_ips_dict(cls, context, filters):"},{"line_number":115,"context_line":"        \"\"\"Generates a dict whose key\u003dsubnet_id, value\u003dtotal_ips in subnet\"\"\""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        # TODO(electrocucaracha) This method is only called by"},{"line_number":118,"context_line":"        # get_network_ip_availabilities and could be perfect candidate to be"},{"line_number":119,"context_line":"        # included as class method for Subnet OVO class"},{"line_number":120,"context_line":"        # Query to get total_ips counts"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba5201f7_42403457","line":117,"range":{"start_line":117,"start_character":32,"end_line":117,"end_character":33},"updated":"2016-12-29 20:44:09.000000000","message":"nit: semicolon after the name","commit_id":"75af4fa817ff43d6a749c04cf5358ada9693306c"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"4e623e32fe9ad8668b9d2063903b48b61e1f2f04","unresolved":false,"context_lines":[{"line_number":114,"context_line":"    def _generate_subnet_total_ips_dict(cls, context, filters):"},{"line_number":115,"context_line":"        \"\"\"Generates a dict whose key\u003dsubnet_id, value\u003dtotal_ips in subnet\"\"\""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        # TODO(electrocucaracha) This method is only called by"},{"line_number":118,"context_line":"        # get_network_ip_availabilities and could be perfect candidate to be"},{"line_number":119,"context_line":"        # included as class method for Subnet OVO class"},{"line_number":120,"context_line":"        # Query to get total_ips counts"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba5201f7_ec26f9cc","line":117,"range":{"start_line":117,"start_character":32,"end_line":117,"end_character":33},"in_reply_to":"ba5201f7_42403457","updated":"2017-01-11 21:17:14.000000000","message":"Done","commit_id":"75af4fa817ff43d6a749c04cf5358ada9693306c"}],"neutron/tests/functional/db/test_ipam.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2c8bcdc91b09a5b6fe745ee3df589d561da66c3c","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                              \u0027ip_address\u0027: fixed_ip[0].get(\u0027ip_address\u0027),"},{"line_number":122,"context_line":"                              \u0027subnet_id\u0027: self.subnet_id,"},{"line_number":123,"context_line":"                              \u0027network_id\u0027: self.network_id}]"},{"line_number":124,"context_line":"        ip_alloc_pool_expected \u003d [{\u0027start\u0027: netaddr.IPAddress(\u002710.10.10.2\u0027),"},{"line_number":125,"context_line":"                                   \u0027end\u0027: netaddr.IPAddress(\u002710.10.10.6\u0027),"},{"line_number":126,"context_line":"                                   \u0027subnet_id\u0027: self.subnet_id}]"},{"line_number":127,"context_line":"        self.assert_ip_alloc_matches(ip_alloc_expected)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a6eadb0_a7bdf669","line":124,"range":{"start_line":124,"start_character":44,"end_line":124,"end_character":75},"updated":"2016-12-15 10:56:36.000000000","message":"I think you need to convert to string this value:\n    str(netaddr.IPAddress(\u002710.10.10.2\u0027))","commit_id":"38a5cd4319e04800c71ad1118427458a35bcfb6d"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"ec432766e8f17c3fa07db3583ab4867eddd9a8c6","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                              \u0027ip_address\u0027: fixed_ip[0].get(\u0027ip_address\u0027),"},{"line_number":122,"context_line":"                              \u0027subnet_id\u0027: self.subnet_id,"},{"line_number":123,"context_line":"                              \u0027network_id\u0027: self.network_id}]"},{"line_number":124,"context_line":"        ip_alloc_pool_expected \u003d [{\u0027start\u0027: netaddr.IPAddress(\u002710.10.10.2\u0027),"},{"line_number":125,"context_line":"                                   \u0027end\u0027: netaddr.IPAddress(\u002710.10.10.6\u0027),"},{"line_number":126,"context_line":"                                   \u0027subnet_id\u0027: self.subnet_id}]"},{"line_number":127,"context_line":"        self.assert_ip_alloc_matches(ip_alloc_expected)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a6eadb0_7f1ccd13","line":124,"range":{"start_line":124,"start_character":44,"end_line":124,"end_character":75},"in_reply_to":"1a6eadb0_a7bdf669","updated":"2016-12-19 08:04:20.000000000","message":"IpAllocationPool OVO is operating on IPAddress not string. So this change is required to pass the tests. The \u0027start\u0027 and \u0027end\u0027 is IPAddress type now.","commit_id":"38a5cd4319e04800c71ad1118427458a35bcfb6d"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2c8bcdc91b09a5b6fe745ee3df589d561da66c3c","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                              \u0027subnet_id\u0027: self.subnet_id,"},{"line_number":123,"context_line":"                              \u0027network_id\u0027: self.network_id}]"},{"line_number":124,"context_line":"        ip_alloc_pool_expected \u003d [{\u0027start\u0027: netaddr.IPAddress(\u002710.10.10.2\u0027),"},{"line_number":125,"context_line":"                                   \u0027end\u0027: netaddr.IPAddress(\u002710.10.10.6\u0027),"},{"line_number":126,"context_line":"                                   \u0027subnet_id\u0027: self.subnet_id}]"},{"line_number":127,"context_line":"        self.assert_ip_alloc_matches(ip_alloc_expected)"},{"line_number":128,"context_line":"        self.assert_ip_alloc_pool_matches(ip_alloc_pool_expected)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a6eadb0_07b94a79","line":125,"range":{"start_line":125,"start_character":42,"end_line":125,"end_character":73},"updated":"2016-12-15 10:56:36.000000000","message":"ditto","commit_id":"38a5cd4319e04800c71ad1118427458a35bcfb6d"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2c8bcdc91b09a5b6fe745ee3df589d561da66c3c","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        for i in range(1, 6):"},{"line_number":133,"context_line":"            self._create_port(self.port_id + str(i))"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        ip_alloc_pool_expected \u003d [{\u0027start\u0027: netaddr.IPAddress(\u002710.10.10.2\u0027),"},{"line_number":136,"context_line":"                                   \u0027end\u0027: netaddr.IPAddress(\u002710.10.10.6\u0027),"},{"line_number":137,"context_line":"                                   \u0027subnet_id\u0027: self.subnet_id}]"},{"line_number":138,"context_line":"        self.assert_ip_alloc_pool_matches(ip_alloc_pool_expected)"},{"line_number":139,"context_line":"        with testtools.ExpectedException(n_exc.IpAddressGenerationFailure):"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a6eadb0_67a83e21","line":136,"range":{"start_line":135,"start_character":36,"end_line":136,"end_character":74},"updated":"2016-12-15 10:56:36.000000000","message":"ditto","commit_id":"38a5cd4319e04800c71ad1118427458a35bcfb6d"}],"neutron/tests/unit/db/test_ipam_pluggable_backend.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"2611e9d4e95a08c24d03a96974fd020c1fce6d73","unresolved":false,"context_lines":[{"line_number":715,"context_line":"            pool_mock, subnet_factory\u003dsubnet_factory)"},{"line_number":716,"context_line":""},{"line_number":717,"context_line":"        mocks[\u0027ipam\u0027] \u003d ipam_pluggable_backend.IpamPluggableBackend()"},{"line_number":718,"context_line":"        with mock.patch.object(ipam_backend_mixin.IpamBackendMixin,"},{"line_number":719,"context_line":"                               \u0027_update_subnet_allocation_pools\u0027):"},{"line_number":720,"context_line":"            mocks[\u0027ipam\u0027].update_db_subnet(context, id, subnet, old_pools)"},{"line_number":721,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7a77a97e_796d0acb","line":718,"updated":"2016-11-18 16:36:10.000000000","message":"I don\u0027t like to mock the whole method. Why is this mock needed? Even if we are using objects now, under the hood the same queries to the db should be executed. If it worked before it should work now. If a mock is need then it should probably go into _prepare_mocks_with_pool_mock","commit_id":"d738792fd7f139eab8b293cd1099e71a9b7d7455"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"6eaf09d7c8ab64980f11d930b7c8d4fa16d795a6","unresolved":false,"context_lines":[{"line_number":715,"context_line":"            pool_mock, subnet_factory\u003dsubnet_factory)"},{"line_number":716,"context_line":""},{"line_number":717,"context_line":"        mocks[\u0027ipam\u0027] \u003d ipam_pluggable_backend.IpamPluggableBackend()"},{"line_number":718,"context_line":"        with mock.patch.object(ipam_backend_mixin.IpamBackendMixin,"},{"line_number":719,"context_line":"                               \u0027_update_subnet_allocation_pools\u0027):"},{"line_number":720,"context_line":"            mocks[\u0027ipam\u0027].update_db_subnet(context, id, subnet, old_pools)"},{"line_number":721,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5a74a57a_ecaae218","line":718,"in_reply_to":"7a77a97e_796d0acb","updated":"2016-11-23 18:50:34.000000000","message":"Initially, I had some issues using a mocking context.  But even if I\u0027m use a valid context and change the id argument for a valid value, I\u0027m getting IntegrityError when it tries to recreate the ipallocations[1].  I\u0027m going to explore more alternatives but any suggestion is welcome.\n\n[1] https://review.openstack.org/#/c/396711/6/neutron/db/ipam_backend_mixin.py@176","commit_id":"d738792fd7f139eab8b293cd1099e71a9b7d7455"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"d54e9f4cfcba36aa503fd1d07385f3a25c511284","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        super(TestDbBasePluginIpam, self).setUp()"},{"line_number":69,"context_line":"        self.tenant_id \u003d uuidutils.generate_uuid()"},{"line_number":70,"context_line":"        self.subnet_id \u003d uuidutils.generate_uuid()"},{"line_number":71,"context_line":"        self.admin_context \u003d ncontext.get_admin_context()"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def _prepare_mocks(self, address_factory\u003dNone, subnet_factory\u003dNone):"},{"line_number":74,"context_line":"        if address_factory is None:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba5201f7_021d4c73","line":71,"updated":"2016-12-29 20:44:09.000000000","message":"Can you please add a note why do we need admin_context instead of the mock?","commit_id":"75af4fa817ff43d6a749c04cf5358ada9693306c"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"4e623e32fe9ad8668b9d2063903b48b61e1f2f04","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        super(TestDbBasePluginIpam, self).setUp()"},{"line_number":69,"context_line":"        self.tenant_id \u003d uuidutils.generate_uuid()"},{"line_number":70,"context_line":"        self.subnet_id \u003d uuidutils.generate_uuid()"},{"line_number":71,"context_line":"        self.admin_context \u003d ncontext.get_admin_context()"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def _prepare_mocks(self, address_factory\u003dNone, subnet_factory\u003dNone):"},{"line_number":74,"context_line":"        if address_factory is None:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba5201f7_cca13548","line":71,"in_reply_to":"ba5201f7_021d4c73","updated":"2017-01-11 21:17:14.000000000","message":"Sure, basically it was required internally for the method update_db_subnet in the line 722","commit_id":"75af4fa817ff43d6a749c04cf5358ada9693306c"},{"author":{"_account_id":20246,"name":"Aradhana Singh","email":"aradhanamailbox@gmail.com","username":"asingh"},"change_message_id":"508bf115b6c85706ba013a174159efe5e0d27afb","unresolved":false,"context_lines":[{"line_number":737,"context_line":"                  \u0027ipv6_address_mode\u0027: None,"},{"line_number":738,"context_line":"                  \u0027ipv6_ra_mode\u0027: None}"},{"line_number":739,"context_line":"        subnet_with_pools \u003d subnet.copy()"},{"line_number":740,"context_line":"        db_mock.return_value \u003d subnet"},{"line_number":741,"context_line":"        subnet_with_pools[\u0027allocation_pools\u0027] \u003d old_pools"},{"line_number":742,"context_line":"        # if subnet has no allocation pools set, then old pools has to"},{"line_number":743,"context_line":"        # be added to subnet dict passed to request factory"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_90499a91","line":740,"range":{"start_line":740,"start_character":0,"end_line":740,"end_character":37},"updated":"2017-03-06 23:35:03.000000000","message":"afiu, this is not needed.\ntox -re py27 neutron.tests.unit.db.test_ipam_pluggable_backend seems to work fine without L740, L751 \u0026 L762.","commit_id":"10775ceeebf9d91739bf34f34d6187c220d2b375"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"a20d521f2a0becd4cc003a45259b00b9240f74e6","unresolved":false,"context_lines":[{"line_number":737,"context_line":"                  \u0027ipv6_address_mode\u0027: None,"},{"line_number":738,"context_line":"                  \u0027ipv6_ra_mode\u0027: None}"},{"line_number":739,"context_line":"        subnet_with_pools \u003d subnet.copy()"},{"line_number":740,"context_line":"        db_mock.return_value \u003d subnet"},{"line_number":741,"context_line":"        subnet_with_pools[\u0027allocation_pools\u0027] \u003d old_pools"},{"line_number":742,"context_line":"        # if subnet has no allocation pools set, then old pools has to"},{"line_number":743,"context_line":"        # be added to subnet dict passed to request factory"}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_d57f76a9","line":740,"range":{"start_line":740,"start_character":0,"end_line":740,"end_character":37},"in_reply_to":"9a30ddce_90499a91","updated":"2017-04-05 15:48:21.000000000","message":"Aradhana, this line is mocking the _get_subnet method of DbBasePluginCommon class, I get the following error when it\u0027s removed:\n\n    b\u0027  File \"/Users/vjmorale/src/openstack/neutron/neutron/tests/unit/db/test_ipam_pluggable_backend.py\", line 743, in test_update_db_subnet_unchanged_pools\u0027\n    b\u0027    old_pools)\u0027\n    b\u0027  File \"/Users/vjmorale/src/openstack/neutron/neutron/tests/unit/db/test_ipam_pluggable_backend.py\", line 723, in _test_update_db_subnet\u0027\n    b\"    context, subnet[\u0027id\u0027], subnet, old_pools)\"\n    b\u0027  File \"/Users/vjmorale/src/openstack/neutron/neutron/db/ipam_pluggable_backend.py\", line 392, in update_db_subnet\u0027\n    b\u0027    context, id, s, old_pools)\u0027\n    b\u0027  File \"/Users/vjmorale/src/openstack/neutron/neutron/db/ipam_backend_mixin.py\", line 214, in update_db_subnet\u0027\n    b\u0027    subnet \u003d self._get_subnet(context, subnet_id)\u0027\n    b\u0027  File \"/Users/vjmorale/src/openstack/neutron/neutron/db/db_base_plugin_common.py\", line 210, in _get_subnet\u0027\n    b\u0027    raise n_exc.SubnetNotFound(subnet_id\u003did)\u0027\n    b\u0027neutron_lib.exceptions.SubnetNotFound: Subnet e91f9086-dc2e-4f80-ab5c-bce08cdd0a1c could not be found.\u0027\n    b\u0027\u0027","commit_id":"10775ceeebf9d91739bf34f34d6187c220d2b375"},{"author":{"_account_id":20246,"name":"Aradhana Singh","email":"aradhanamailbox@gmail.com","username":"asingh"},"change_message_id":"508bf115b6c85706ba013a174159efe5e0d27afb","unresolved":false,"context_lines":[{"line_number":748,"context_line":"    @mock.patch.object(db_base_plugin_common.DbBasePluginCommon, \u0027_get_subnet\u0027)"},{"line_number":749,"context_line":"    @mock.patch(\u0027neutron.ipam.driver.Pool\u0027)"},{"line_number":750,"context_line":"    def test_update_db_subnet_new_pools(self, pool_mock, db_mock, obj_mock):"},{"line_number":751,"context_line":"        obj_mock.return_value \u003d None"},{"line_number":752,"context_line":"        old_pools \u003d [netaddr.IPRange(\u0027192.1.1.2\u0027, \u0027192.1.1.254\u0027)]"},{"line_number":753,"context_line":"        subnet \u003d {\u0027id\u0027: uuidutils.generate_uuid(),"},{"line_number":754,"context_line":"                  \u0027network_id\u0027: uuidutils.generate_uuid(),"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_305b8e56","line":751,"range":{"start_line":751,"start_character":0,"end_line":751,"end_character":36},"updated":"2017-03-06 23:35:03.000000000","message":"ditto","commit_id":"10775ceeebf9d91739bf34f34d6187c220d2b375"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"a20d521f2a0becd4cc003a45259b00b9240f74e6","unresolved":false,"context_lines":[{"line_number":748,"context_line":"    @mock.patch.object(db_base_plugin_common.DbBasePluginCommon, \u0027_get_subnet\u0027)"},{"line_number":749,"context_line":"    @mock.patch(\u0027neutron.ipam.driver.Pool\u0027)"},{"line_number":750,"context_line":"    def test_update_db_subnet_new_pools(self, pool_mock, db_mock, obj_mock):"},{"line_number":751,"context_line":"        obj_mock.return_value \u003d None"},{"line_number":752,"context_line":"        old_pools \u003d [netaddr.IPRange(\u0027192.1.1.2\u0027, \u0027192.1.1.254\u0027)]"},{"line_number":753,"context_line":"        subnet \u003d {\u0027id\u0027: uuidutils.generate_uuid(),"},{"line_number":754,"context_line":"                  \u0027network_id\u0027: uuidutils.generate_uuid(),"}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_4774dd99","line":751,"range":{"start_line":751,"start_character":0,"end_line":751,"end_character":36},"in_reply_to":"9a30ddce_305b8e56","updated":"2017-04-05 15:48:21.000000000","message":"This is mocking the create method of the IPAllocationPool object, so if this is not mocked I the creation is executed and getting this error:\n\n    b\u0027    return meth(self, multiparams, params)\u0027\n    b\u0027  File \"/Users/vjmorale/src/openstack/neutron/.tox/py35/lib/python3.5/site-packages/sqlalchemy/sql/elements.py\", line 263, in _execute_on_connection\u0027\n    b\u0027    return connection._execute_clauseelement(self, multiparams, params)\u0027\n    b\u0027  File \"/Users/vjmorale/src/openstack/neutron/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py\", line 1053, in _execute_clauseelement\u0027\n    b\u0027    compiled_sql, distilled_params\u0027\n    b\u0027  File \"/Users/vjmorale/src/openstack/neutron/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py\", line 1189, in _execute_context\u0027\n    b\u0027    context)\u0027\n    b\u0027  File \"/Users/vjmorale/src/openstack/neutron/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py\", line 1390, in _handle_dbapi_exception\u0027\n    b\u0027    util.raise_from_cause(newraise, exc_info)\u0027\n    b\u0027  File \"/Users/vjmorale/src/openstack/neutron/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/compat.py\", line 203, in raise_from_cause\u0027\n    b\u0027    reraise(type(exception), exception, tb\u003dexc_tb, cause\u003dcause)\u0027\n    b\u0027  File \"/Users/vjmorale/src/openstack/neutron/.tox/py35/lib/python3.5/site-packages/sqlalchemy/util/compat.py\", line 186, in reraise\u0027\n    b\u0027    raise value.with_traceback(tb)\u0027\n    b\u0027  File \"/Users/vjmorale/src/openstack/neutron/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/base.py\", line 1182, in _execute_context\u0027\n    b\u0027    context)\u0027\n    b\u0027  File \"/Users/vjmorale/src/openstack/neutron/.tox/py35/lib/python3.5/site-packages/sqlalchemy/engine/default.py\", line 470, in do_execute\u0027\n    b\u0027    cursor.execute(statement, parameters)\u0027\n    b\"oslo_db.exception.DBReferenceError: (sqlite3.IntegrityError) FOREIGN KEY constraint failed [SQL: \u0027INSERT INTO ipallocationpools (id, subnet_id, first_ip, last_ip) VALUES (?, ?, ?, ?)\u0027] [parameters: (\u002729938264-4015-4ee7-b85b-467aee8c02d6\u0027, \u002724262576-8070-430a-9564-\n67ba8791932b\u0027, \u0027192.1.1.10\u0027, \u0027192.1.1.254\u0027)]\"\n    b\u0027\u0027","commit_id":"10775ceeebf9d91739bf34f34d6187c220d2b375"},{"author":{"_account_id":20246,"name":"Aradhana Singh","email":"aradhanamailbox@gmail.com","username":"asingh"},"change_message_id":"508bf115b6c85706ba013a174159efe5e0d27afb","unresolved":false,"context_lines":[{"line_number":759,"context_line":"                  \u0027ipv6_ra_mode\u0027: None}"},{"line_number":760,"context_line":"        # make a copy of subnet for validation, since update_subnet changes"},{"line_number":761,"context_line":"        # incoming subnet dict"},{"line_number":762,"context_line":"        db_mock.return_value \u003d subnet"},{"line_number":763,"context_line":"        expected_subnet \u003d subnet.copy()"},{"line_number":764,"context_line":"        # validate that subnet passed to request factory is the same as"},{"line_number":765,"context_line":"        # incoming one, i.e. new pools in it are not overwritten by old pools"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_105e8a45","line":762,"range":{"start_line":762,"start_character":0,"end_line":762,"end_character":37},"updated":"2017-03-06 23:35:03.000000000","message":"ditto","commit_id":"10775ceeebf9d91739bf34f34d6187c220d2b375"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"a20d521f2a0becd4cc003a45259b00b9240f74e6","unresolved":false,"context_lines":[{"line_number":759,"context_line":"                  \u0027ipv6_ra_mode\u0027: None}"},{"line_number":760,"context_line":"        # make a copy of subnet for validation, since update_subnet changes"},{"line_number":761,"context_line":"        # incoming subnet dict"},{"line_number":762,"context_line":"        db_mock.return_value \u003d subnet"},{"line_number":763,"context_line":"        expected_subnet \u003d subnet.copy()"},{"line_number":764,"context_line":"        # validate that subnet passed to request factory is the same as"},{"line_number":765,"context_line":"        # incoming one, i.e. new pools in it are not overwritten by old pools"}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_27ae79e7","line":762,"range":{"start_line":762,"start_character":0,"end_line":762,"end_character":37},"in_reply_to":"9a30ddce_105e8a45","updated":"2017-04-05 15:48:21.000000000","message":"In this case, this is mocking the same _get_subnet method(line 748)","commit_id":"10775ceeebf9d91739bf34f34d6187c220d2b375"}]}
