)]}'
{"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6701bd632da06af210c75f3273cb5668aeb2d700","unresolved":false,"context_lines":[{"line_number":925,"context_line":"                                                           subnet_id):"},{"line_number":926,"context_line":"        # Do not delete the subnet if IP allocations for internal"},{"line_number":927,"context_line":"        # router ports still exist"},{"line_number":928,"context_line":"        # TODO(electrocucaracha): Look a solution for Join in OVO"},{"line_number":929,"context_line":"        allocs \u003d context.session.query(models_v2.IPAllocation).filter_by("},{"line_number":930,"context_line":"                subnet_id\u003dsubnet_id).join(models_v2.Port).filter("},{"line_number":931,"context_line":"                        models_v2.Port.device_owner.in_("}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_2a9d2759","line":928,"updated":"2017-06-09 18:25:20.000000000","message":"the solution should be same as for lines 920-921.","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"2dbeb28c33c310e05895cfe6b81499b46628dad6","unresolved":false,"context_lines":[{"line_number":925,"context_line":"                                                           subnet_id):"},{"line_number":926,"context_line":"        # Do not delete the subnet if IP allocations for internal"},{"line_number":927,"context_line":"        # router ports still exist"},{"line_number":928,"context_line":"        # TODO(electrocucaracha): Look a solution for Join in OVO"},{"line_number":929,"context_line":"        allocs \u003d context.session.query(models_v2.IPAllocation).filter_by("},{"line_number":930,"context_line":"                subnet_id\u003dsubnet_id).join(models_v2.Port).filter("},{"line_number":931,"context_line":"                        models_v2.Port.device_owner.in_("}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_fe432eae","line":928,"in_reply_to":"7f231b9d_2a9d2759","updated":"2017-06-13 07:05:40.000000000","message":"Done","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce5623b328bb2f0e7236c06d83761fe9d6851ea8","unresolved":false,"context_lines":[{"line_number":915,"context_line":"        return result"},{"line_number":916,"context_line":""},{"line_number":917,"context_line":"    @db_api.context_manager.reader"},{"line_number":918,"context_line":"    def _subnet_get_user_allocation(self, context, subnet_id):"},{"line_number":919,"context_line":"        \"\"\"Check if there are any user ports on subnet and return first.\"\"\""},{"line_number":920,"context_line":"        return port_obj.IPAllocation.get_alloc_by_subnet_id("},{"line_number":921,"context_line":"            context, subnet_id, AUTO_DELETE_PORT_OWNERS)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7f231b9d_31b3feec","line":918,"updated":"2017-06-13 19:43:17.000000000","message":"at this point it\u0027s not clear why we need separate methods here and in line 924 and not put the body inline where it\u0027s used.","commit_id":"5f46d06e4a2df19f4ac3c2a22db632787b4cc444"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"1f3f94905c74d6ba42c4e0fc13ab49da7efc2593","unresolved":false,"context_lines":[{"line_number":915,"context_line":"        return result"},{"line_number":916,"context_line":""},{"line_number":917,"context_line":"    @db_api.context_manager.reader"},{"line_number":918,"context_line":"    def _subnet_get_user_allocation(self, context, subnet_id):"},{"line_number":919,"context_line":"        \"\"\"Check if there are any user ports on subnet and return first.\"\"\""},{"line_number":920,"context_line":"        return port_obj.IPAllocation.get_alloc_by_subnet_id("},{"line_number":921,"context_line":"            context, subnet_id, AUTO_DELETE_PORT_OWNERS)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7f231b9d_ddba716c","line":918,"in_reply_to":"7f231b9d_31b3feec","updated":"2017-06-15 00:47:26.000000000","message":"I think it is because these two methods are querying two different situations.","commit_id":"5f46d06e4a2df19f4ac3c2a22db632787b4cc444"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce5623b328bb2f0e7236c06d83761fe9d6851ea8","unresolved":false,"context_lines":[{"line_number":955,"context_line":"            LOG.info(_LI(\"Found port (%(port_id)s, %(ip)s) having IP \""},{"line_number":956,"context_line":"                         \"allocation on subnet \""},{"line_number":957,"context_line":"                         \"%(subnet)s, cannot delete\"),"},{"line_number":958,"context_line":"                     {\u0027ip\u0027: alloc[0].ip_address,"},{"line_number":959,"context_line":"                      \u0027port_id\u0027: alloc[0].port_id,"},{"line_number":960,"context_line":"                      \u0027subnet\u0027: id})"},{"line_number":961,"context_line":"            raise exc.SubnetInUse(subnet_id\u003did)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7f231b9d_71de1612","line":958,"updated":"2017-06-13 19:43:17.000000000","message":"seems like we need only the first entry, so we can optimize it to fetch the first entry only.","commit_id":"5f46d06e4a2df19f4ac3c2a22db632787b4cc444"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"1f3f94905c74d6ba42c4e0fc13ab49da7efc2593","unresolved":false,"context_lines":[{"line_number":955,"context_line":"            LOG.info(_LI(\"Found port (%(port_id)s, %(ip)s) having IP \""},{"line_number":956,"context_line":"                         \"allocation on subnet \""},{"line_number":957,"context_line":"                         \"%(subnet)s, cannot delete\"),"},{"line_number":958,"context_line":"                     {\u0027ip\u0027: alloc[0].ip_address,"},{"line_number":959,"context_line":"                      \u0027port_id\u0027: alloc[0].port_id,"},{"line_number":960,"context_line":"                      \u0027subnet\u0027: id})"},{"line_number":961,"context_line":"            raise exc.SubnetInUse(subnet_id\u003did)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7f231b9d_9d6bd91c","line":958,"in_reply_to":"7f231b9d_71de1612","updated":"2017-06-15 00:47:26.000000000","message":"Done","commit_id":"5f46d06e4a2df19f4ac3c2a22db632787b4cc444"}],"neutron/objects/ports.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6701bd632da06af210c75f3273cb5668aeb2d700","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        return fields"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    @classmethod"},{"line_number":184,"context_line":"    def get_user_alloc_by_subnet_id(cls, context, subnet_id, device_owner):"},{"line_number":185,"context_line":"        # need to join with ports table as IPAllocation\u0027s port"},{"line_number":186,"context_line":"        # is not joined eagerly and thus producing query which yields"},{"line_number":187,"context_line":"        # incorrect results"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_6a931f51","line":184,"range":{"start_line":184,"start_character":73,"end_line":184,"end_character":74},"updated":"2017-06-09 18:25:20.000000000","message":"it\u0027s actually device owners to EXCLUDE. The argument should be renamed to reflect that.","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6701bd632da06af210c75f3273cb5668aeb2d700","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        return fields"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    @classmethod"},{"line_number":184,"context_line":"    def get_user_alloc_by_subnet_id(cls, context, subnet_id, device_owner):"},{"line_number":185,"context_line":"        # need to join with ports table as IPAllocation\u0027s port"},{"line_number":186,"context_line":"        # is not joined eagerly and thus producing query which yields"},{"line_number":187,"context_line":"        # incorrect results"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_2aaf6795","line":184,"updated":"2017-06-09 18:25:20.000000000","message":"we should switch it to return objects; maybe rename into get_all_by_subnet_id","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"2dbeb28c33c310e05895cfe6b81499b46628dad6","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        return fields"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    @classmethod"},{"line_number":184,"context_line":"    def get_user_alloc_by_subnet_id(cls, context, subnet_id, device_owner):"},{"line_number":185,"context_line":"        # need to join with ports table as IPAllocation\u0027s port"},{"line_number":186,"context_line":"        # is not joined eagerly and thus producing query which yields"},{"line_number":187,"context_line":"        # incorrect results"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_be17f6a3","line":184,"range":{"start_line":184,"start_character":73,"end_line":184,"end_character":74},"in_reply_to":"7f231b9d_6a931f51","updated":"2017-06-13 07:05:40.000000000","message":"Done","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce5623b328bb2f0e7236c06d83761fe9d6851ea8","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        return fields"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    @classmethod"},{"line_number":186,"context_line":"    def get_alloc_by_subnet_id(cls, context, subnet_id, device_owner,"},{"line_number":187,"context_line":"                               exclude\u003dTrue):"},{"line_number":188,"context_line":"        # need to join with ports table as IPAllocation\u0027s port"},{"line_number":189,"context_line":"        # is not joined eagerly and thus producing query which yields"}],"source_content_type":"text/x-python","patch_set":9,"id":"7f231b9d_119da258","line":186,"updated":"2017-06-13 19:43:17.000000000","message":"for what I see, all use cases for the method are merely interested in the first allocation, or even in just the fact whether any exist. Can we maybe make it return the first entry only? Or even a boolean that will indicate if matching records exist?","commit_id":"5f46d06e4a2df19f4ac3c2a22db632787b4cc444"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"1f3f94905c74d6ba42c4e0fc13ab49da7efc2593","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        return fields"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    @classmethod"},{"line_number":186,"context_line":"    def get_alloc_by_subnet_id(cls, context, subnet_id, device_owner,"},{"line_number":187,"context_line":"                               exclude\u003dTrue):"},{"line_number":188,"context_line":"        # need to join with ports table as IPAllocation\u0027s port"},{"line_number":189,"context_line":"        # is not joined eagerly and thus producing query which yields"}],"source_content_type":"text/x-python","patch_set":9,"id":"7f231b9d_3dc96525","line":186,"in_reply_to":"7f231b9d_119da258","updated":"2017-06-15 00:47:26.000000000","message":"Done. I will return the first result in the case of device owner exclusion and boolean result in the case of device owner inclusion.","commit_id":"5f46d06e4a2df19f4ac3c2a22db632787b4cc444"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2c17e1646ad93566d46fe4731ddb444f31e9e647","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        return fields"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    @classmethod"},{"line_number":186,"context_line":"    def get_alloc_by_subnet_id(cls, context, subnet_id, device_owner,"},{"line_number":187,"context_line":"                               exclude\u003dTrue):"},{"line_number":188,"context_line":"        # need to join with ports table as IPAllocation\u0027s port"},{"line_number":189,"context_line":"        # is not joined eagerly and thus producing query which yields"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f1d235d_4f4e5cc1","line":186,"range":{"start_line":186,"start_character":8,"end_line":186,"end_character":30},"updated":"2017-07-06 16:06:06.000000000","message":"the name of the method now doesn\u0027t reflect returned value (boolean). Maybe \u0027allocation_exists\u0027 or smth like that?","commit_id":"6670954de32a24fef6a3d7251e04a269b15bdb3c"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"26f7aa316e5c68358f90a01562a596fbbe79c260","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        return fields"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    @classmethod"},{"line_number":186,"context_line":"    def get_alloc_by_subnet_id(cls, context, subnet_id, device_owner,"},{"line_number":187,"context_line":"                               exclude\u003dTrue):"},{"line_number":188,"context_line":"        # need to join with ports table as IPAllocation\u0027s port"},{"line_number":189,"context_line":"        # is not joined eagerly and thus producing query which yields"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f1d235d_c6d5a71d","line":186,"range":{"start_line":186,"start_character":8,"end_line":186,"end_character":30},"in_reply_to":"3f1d235d_4f4e5cc1","updated":"2017-07-07 00:44:02.000000000","message":"Actually this method does not always return a boolean.\nIf exclude is true, and if alloc_db exists, we need to return the IP allocation. This method is called in Line 920(_subnet_get_user_allocation) in https://review.openstack.org/#/c/396718/11/neutron/db/db_base_plugin_v2.py, which will be called in Line 952(_ensure_no_user_ports_on_subnet) in the same file. In Line 952, the method will log the alloc_db\u0027s IP address and port_id.","commit_id":"6670954de32a24fef6a3d7251e04a269b15bdb3c"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2c17e1646ad93566d46fe4731ddb444f31e9e647","unresolved":false,"context_lines":[{"line_number":199,"context_line":"                       filter(models_v2.Port.device_owner."},{"line_number":200,"context_line":"                       in_(device_owner)).first())"},{"line_number":201,"context_line":"        if exclude and alloc_db:"},{"line_number":202,"context_line":"            return super(IPAllocation, cls)._load_object(context, alloc_db)"},{"line_number":203,"context_line":"        if alloc_db:"},{"line_number":204,"context_line":"            return True"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3f1d235d_cfcf0c27","line":202,"updated":"2017-07-06 16:06:06.000000000","message":"to be consistent about returned value, maybe convert to bool() before returning.","commit_id":"6670954de32a24fef6a3d7251e04a269b15bdb3c"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"26f7aa316e5c68358f90a01562a596fbbe79c260","unresolved":false,"context_lines":[{"line_number":199,"context_line":"                       filter(models_v2.Port.device_owner."},{"line_number":200,"context_line":"                       in_(device_owner)).first())"},{"line_number":201,"context_line":"        if exclude and alloc_db:"},{"line_number":202,"context_line":"            return super(IPAllocation, cls)._load_object(context, alloc_db)"},{"line_number":203,"context_line":"        if alloc_db:"},{"line_number":204,"context_line":"            return True"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3f1d235d_06f27f9a","line":202,"in_reply_to":"3f1d235d_cfcf0c27","updated":"2017-07-07 00:44:02.000000000","message":"Check the reply above. We need to return ip allocation object here.","commit_id":"6670954de32a24fef6a3d7251e04a269b15bdb3c"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2c17e1646ad93566d46fe4731ddb444f31e9e647","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        if exclude and alloc_db:"},{"line_number":202,"context_line":"            return super(IPAllocation, cls)._load_object(context, alloc_db)"},{"line_number":203,"context_line":"        if alloc_db:"},{"line_number":204,"context_line":"            return True"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"@obj_base.VersionedObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f1d235d_0fcaa419","line":204,"updated":"2017-07-06 16:06:06.000000000","message":"maybe return False at the end to be very explicit about the result.","commit_id":"6670954de32a24fef6a3d7251e04a269b15bdb3c"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"26f7aa316e5c68358f90a01562a596fbbe79c260","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        if exclude and alloc_db:"},{"line_number":202,"context_line":"            return super(IPAllocation, cls)._load_object(context, alloc_db)"},{"line_number":203,"context_line":"        if alloc_db:"},{"line_number":204,"context_line":"            return True"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"@obj_base.VersionedObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f1d235d_c62da7fe","line":204,"in_reply_to":"3f1d235d_0fcaa419","updated":"2017-07-07 00:44:02.000000000","message":"OK, will add it.","commit_id":"6670954de32a24fef6a3d7251e04a269b15bdb3c"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"153ff1dbcfbdbfc30d253aacc160d32e15ab9252","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        if exclude and alloc_db:"},{"line_number":202,"context_line":"            return super(IPAllocation, cls)._load_object(context, alloc_db)"},{"line_number":203,"context_line":"        if alloc_db:"},{"line_number":204,"context_line":"            return True"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"@obj_base.VersionedObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f1d235d_1bdbdc7d","line":204,"in_reply_to":"3f1d235d_c62da7fe","updated":"2017-07-07 16:04:59.000000000","message":"OK so it seems like you actually need an allocation object, then no need for that, None is fine.","commit_id":"6670954de32a24fef6a3d7251e04a269b15bdb3c"}],"neutron/tests/unit/db/test_db_base_plugin_v2.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce5623b328bb2f0e7236c06d83761fe9d6851ea8","unresolved":false,"context_lines":[{"line_number":6527,"context_line":"                    res \u003d plugin._subnet_get_user_allocation("},{"line_number":6528,"context_line":"                        context.get_admin_context(),"},{"line_number":6529,"context_line":"                        subnet[\u0027subnet\u0027][\u0027id\u0027])"},{"line_number":6530,"context_line":"                    self.assertFalse(res)"},{"line_number":6531,"context_line":""},{"line_number":6532,"context_line":"    def test__validate_network_subnetpools(self):"},{"line_number":6533,"context_line":"        network \u003d models_v2.Network()"}],"source_content_type":"text/x-python","patch_set":9,"id":"7f231b9d_512f9af5","line":6530,"updated":"2017-06-13 19:43:17.000000000","message":"if you would return the first entry, you would not need to touch the test case","commit_id":"5f46d06e4a2df19f4ac3c2a22db632787b4cc444"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"1f3f94905c74d6ba42c4e0fc13ab49da7efc2593","unresolved":false,"context_lines":[{"line_number":6527,"context_line":"                    res \u003d plugin._subnet_get_user_allocation("},{"line_number":6528,"context_line":"                        context.get_admin_context(),"},{"line_number":6529,"context_line":"                        subnet[\u0027subnet\u0027][\u0027id\u0027])"},{"line_number":6530,"context_line":"                    self.assertFalse(res)"},{"line_number":6531,"context_line":""},{"line_number":6532,"context_line":"    def test__validate_network_subnetpools(self):"},{"line_number":6533,"context_line":"        network \u003d models_v2.Network()"}],"source_content_type":"text/x-python","patch_set":9,"id":"7f231b9d_ddd391d4","line":6530,"in_reply_to":"7f231b9d_512f9af5","updated":"2017-06-15 00:47:26.000000000","message":"Done","commit_id":"5f46d06e4a2df19f4ac3c2a22db632787b4cc444"}],"neutron/tests/unit/db/test_ipam_pluggable_backend.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6701bd632da06af210c75f3273cb5668aeb2d700","unresolved":false,"context_lines":[{"line_number":694,"context_line":"        mocks[\u0027ipam\u0027]._get_subnet \u003d get_subnet_mock"},{"line_number":695,"context_line":""},{"line_number":696,"context_line":"        with mock.patch.object("},{"line_number":697,"context_line":"                port_obj.IPAllocation, \u0027create\u0027, return_value\u003dNone):"},{"line_number":698,"context_line":"            mocks[\u0027ipam\u0027].allocate_ips_for_port_and_store(context,"},{"line_number":699,"context_line":"                                                          port_dict,"},{"line_number":700,"context_line":"                                                          port_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_cad91323","line":697,"range":{"start_line":697,"start_character":47,"end_line":697,"end_character":66},"updated":"2017-06-09 18:25:20.000000000","message":"I don\u0027t think this is needed, we don\u0027t inspect result anywhere since it\u0027s always None.","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"2dbeb28c33c310e05895cfe6b81499b46628dad6","unresolved":false,"context_lines":[{"line_number":694,"context_line":"        mocks[\u0027ipam\u0027]._get_subnet \u003d get_subnet_mock"},{"line_number":695,"context_line":""},{"line_number":696,"context_line":"        with mock.patch.object("},{"line_number":697,"context_line":"                port_obj.IPAllocation, \u0027create\u0027, return_value\u003dNone):"},{"line_number":698,"context_line":"            mocks[\u0027ipam\u0027].allocate_ips_for_port_and_store(context,"},{"line_number":699,"context_line":"                                                          port_dict,"},{"line_number":700,"context_line":"                                                          port_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_7e115eac","line":697,"range":{"start_line":697,"start_character":47,"end_line":697,"end_character":66},"in_reply_to":"7f231b9d_cad91323","updated":"2017-06-13 07:05:40.000000000","message":"Done","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6701bd632da06af210c75f3273cb5668aeb2d700","unresolved":false,"context_lines":[{"line_number":761,"context_line":""},{"line_number":762,"context_line":"    @mock.patch(\u0027neutron.ipam.driver.Pool\u0027)"},{"line_number":763,"context_line":"    def test_update_db_subnet_new_pools_exception(self, pool_mock):"},{"line_number":764,"context_line":"        # context \u003d n_context.get_admin_context()"},{"line_number":765,"context_line":"        context \u003d mock.Mock()"},{"line_number":766,"context_line":"        mocks \u003d self._prepare_mocks_with_pool_mock(pool_mock)"},{"line_number":767,"context_line":"        mocks[\u0027ipam\u0027] \u003d ipam_pluggable_backend.IpamPluggableBackend()"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_aaeff7ae","line":764,"updated":"2017-06-09 18:25:20.000000000","message":"leftover?","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"2dbeb28c33c310e05895cfe6b81499b46628dad6","unresolved":false,"context_lines":[{"line_number":761,"context_line":""},{"line_number":762,"context_line":"    @mock.patch(\u0027neutron.ipam.driver.Pool\u0027)"},{"line_number":763,"context_line":"    def test_update_db_subnet_new_pools_exception(self, pool_mock):"},{"line_number":764,"context_line":"        # context \u003d n_context.get_admin_context()"},{"line_number":765,"context_line":"        context \u003d mock.Mock()"},{"line_number":766,"context_line":"        mocks \u003d self._prepare_mocks_with_pool_mock(pool_mock)"},{"line_number":767,"context_line":"        mocks[\u0027ipam\u0027] \u003d ipam_pluggable_backend.IpamPluggableBackend()"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_5e28e2e0","line":764,"in_reply_to":"7f231b9d_aaeff7ae","updated":"2017-06-13 07:05:40.000000000","message":"Done","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6701bd632da06af210c75f3273cb5668aeb2d700","unresolved":false,"context_lines":[{"line_number":795,"context_line":"        # Validate original exception (DBDeadlock) is not overridden by"},{"line_number":796,"context_line":"        # exception raised on rollback (ValueError)"},{"line_number":797,"context_line":"        with mock.patch.object("},{"line_number":798,"context_line":"            port_obj.IPAllocation, \u0027create\u0027, return_value\u003dNone):"},{"line_number":799,"context_line":"            self.assertRaises(db_exc.DBDeadlock,"},{"line_number":800,"context_line":"                              mocks[\u0027ipam\u0027].update_port_with_ips,"},{"line_number":801,"context_line":"                              context,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_4a34e34a","line":798,"range":{"start_line":798,"start_character":43,"end_line":798,"end_character":62},"updated":"2017-06-09 18:25:20.000000000","message":"not needed","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"2dbeb28c33c310e05895cfe6b81499b46628dad6","unresolved":false,"context_lines":[{"line_number":795,"context_line":"        # Validate original exception (DBDeadlock) is not overridden by"},{"line_number":796,"context_line":"        # exception raised on rollback (ValueError)"},{"line_number":797,"context_line":"        with mock.patch.object("},{"line_number":798,"context_line":"            port_obj.IPAllocation, \u0027create\u0027, return_value\u003dNone):"},{"line_number":799,"context_line":"            self.assertRaises(db_exc.DBDeadlock,"},{"line_number":800,"context_line":"                              mocks[\u0027ipam\u0027].update_port_with_ips,"},{"line_number":801,"context_line":"                              context,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_3e23e607","line":798,"range":{"start_line":798,"start_character":43,"end_line":798,"end_character":62},"in_reply_to":"7f231b9d_4a34e34a","updated":"2017-06-13 07:05:40.000000000","message":"Done","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6701bd632da06af210c75f3273cb5668aeb2d700","unresolved":false,"context_lines":[{"line_number":803,"context_line":"                              db_port,"},{"line_number":804,"context_line":"                              new_port,"},{"line_number":805,"context_line":"                              mock.Mock())"},{"line_number":806,"context_line":"        with mock.patch.object("},{"line_number":807,"context_line":"            port_obj.IPAllocation, \u0027create\u0027, return_value\u003dNone):"},{"line_number":808,"context_line":"            mocks[\u0027ipam\u0027]._ipam_deallocate_ips.assert_called_once_with("},{"line_number":809,"context_line":"                context, mocks[\u0027driver\u0027], db_port,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_8a131bb9","line":806,"updated":"2017-06-09 18:25:20.000000000","message":"why to create same mock twice instead of using the same?","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"2dbeb28c33c310e05895cfe6b81499b46628dad6","unresolved":false,"context_lines":[{"line_number":803,"context_line":"                              db_port,"},{"line_number":804,"context_line":"                              new_port,"},{"line_number":805,"context_line":"                              mock.Mock())"},{"line_number":806,"context_line":"        with mock.patch.object("},{"line_number":807,"context_line":"            port_obj.IPAllocation, \u0027create\u0027, return_value\u003dNone):"},{"line_number":808,"context_line":"            mocks[\u0027ipam\u0027]._ipam_deallocate_ips.assert_called_once_with("},{"line_number":809,"context_line":"                context, mocks[\u0027driver\u0027], db_port,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_1e226a01","line":806,"in_reply_to":"7f231b9d_8a131bb9","updated":"2017-06-13 07:05:40.000000000","message":"Done","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6701bd632da06af210c75f3273cb5668aeb2d700","unresolved":false,"context_lines":[{"line_number":804,"context_line":"                              new_port,"},{"line_number":805,"context_line":"                              mock.Mock())"},{"line_number":806,"context_line":"        with mock.patch.object("},{"line_number":807,"context_line":"            port_obj.IPAllocation, \u0027create\u0027, return_value\u003dNone):"},{"line_number":808,"context_line":"            mocks[\u0027ipam\u0027]._ipam_deallocate_ips.assert_called_once_with("},{"line_number":809,"context_line":"                context, mocks[\u0027driver\u0027], db_port,"},{"line_number":810,"context_line":"                changes.add, revert_on_fail\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_ea3a8f32","line":807,"range":{"start_line":807,"start_character":43,"end_line":807,"end_character":62},"updated":"2017-06-09 18:25:20.000000000","message":"not needed.","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"2dbeb28c33c310e05895cfe6b81499b46628dad6","unresolved":false,"context_lines":[{"line_number":804,"context_line":"                              new_port,"},{"line_number":805,"context_line":"                              mock.Mock())"},{"line_number":806,"context_line":"        with mock.patch.object("},{"line_number":807,"context_line":"            port_obj.IPAllocation, \u0027create\u0027, return_value\u003dNone):"},{"line_number":808,"context_line":"            mocks[\u0027ipam\u0027]._ipam_deallocate_ips.assert_called_once_with("},{"line_number":809,"context_line":"                context, mocks[\u0027driver\u0027], db_port,"},{"line_number":810,"context_line":"                changes.add, revert_on_fail\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_de7992fc","line":807,"range":{"start_line":807,"start_character":43,"end_line":807,"end_character":62},"in_reply_to":"7f231b9d_ea3a8f32","updated":"2017-06-13 07:05:40.000000000","message":"Done","commit_id":"e57a625a68c3582439537157daad6447811352e5"}],"neutron/tests/unit/services/revisions/test_revision_plugin.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6701bd632da06af210c75f3273cb5668aeb2d700","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        with self.port():"},{"line_number":65,"context_line":"            with self.ctx.session.begin():"},{"line_number":66,"context_line":"                ipal_objs \u003d port_obj.IPAllocation.get_objects(self.ctx)"},{"line_number":67,"context_line":"                if ipal_objs:"},{"line_number":68,"context_line":"                    ipal_obj \u003d ipal_objs[0]"},{"line_number":69,"context_line":"                # load port into our session"},{"line_number":70,"context_line":"                port \u003d self.ctx.session.query(models_v2.Port).one()"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_6a7d5fe6","line":67,"updated":"2017-06-09 18:25:20.000000000","message":"and if not, then you leave the variable uninitialized which will crash in line 79. I think we should raise an error here.","commit_id":"e57a625a68c3582439537157daad6447811352e5"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"2dbeb28c33c310e05895cfe6b81499b46628dad6","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        with self.port():"},{"line_number":65,"context_line":"            with self.ctx.session.begin():"},{"line_number":66,"context_line":"                ipal_objs \u003d port_obj.IPAllocation.get_objects(self.ctx)"},{"line_number":67,"context_line":"                if ipal_objs:"},{"line_number":68,"context_line":"                    ipal_obj \u003d ipal_objs[0]"},{"line_number":69,"context_line":"                # load port into our session"},{"line_number":70,"context_line":"                port \u003d self.ctx.session.query(models_v2.Port).one()"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f231b9d_9e831acd","line":67,"in_reply_to":"7f231b9d_6a7d5fe6","updated":"2017-06-13 07:05:40.000000000","message":"Done","commit_id":"e57a625a68c3582439537157daad6447811352e5"}]}
