)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a96271675a3d630023d2625f45f8ecdce93bbe80","unresolved":false,"context_lines":[{"line_number":21,"context_line":"with the Allocation tests."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Co-Authored-By: Dan Smith \u003cdansmith@redhat.com\u003e"},{"line_number":24,"context_line":"Partially-Implements: blueprint resource-providers"},{"line_number":25,"context_line":"Change-Id: Iaec8a8e318adfd8feae6496ad962bc02d13adebd"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":24,"id":"1a122d0e_3fa710be","line":24,"range":{"start_line":24,"start_character":32,"end_line":24,"end_character":50},"updated":"2016-04-20 18:59:21.000000000","message":"Shouldn\u0027t this be resource-providers-allocations ?","commit_id":"ba7e1ca7fd8627e735bff7d8c78807a8a2c3d42e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e035127c0f380ad9b43793702929083339ad942b","unresolved":false,"context_lines":[{"line_number":21,"context_line":"with the Allocation tests."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Co-Authored-By: Dan Smith \u003cdansmith@redhat.com\u003e"},{"line_number":24,"context_line":"Partially-Implements: blueprint generic-resource-pools"},{"line_number":25,"context_line":"Change-Id: Iaec8a8e318adfd8feae6496ad962bc02d13adebd"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":26,"id":"1a122d0e_c7470e79","line":24,"range":{"start_line":24,"start_character":31,"end_line":24,"end_character":54},"updated":"2016-04-30 02:13:38.000000000","message":"This should actually be resource-providers-allocations right?","commit_id":"02617f395221dd26eac01f8ed099847eecfca51d"}],"nova/objects/resource_provider.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"625546e43885c254fc392911e9eb2d90cc25bae1","unresolved":false,"context_lines":[{"line_number":257,"context_line":"                                 resource_class_id):"},{"line_number":258,"context_line":"        return context.session.query(models.Allocation).filter_by("},{"line_number":259,"context_line":"            resource_provider_id \u003d resource_provider_id,"},{"line_number":260,"context_line":"            resource_class_id \u003d resource_class_id).all()"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"@base.NovaObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa0719c6_d53624e6","line":260,"updated":"2016-03-22 20:36:27.000000000","message":"You can remove the above method, it isn\u0027t called anywhere.","commit_id":"29a4ee8056750a6703666e8f6c1c94235e9ee7cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2d3528f337e85d4ae367b6c6942f11d4b7a1a8fd","unresolved":false,"context_lines":[{"line_number":257,"context_line":"                                 resource_class_id):"},{"line_number":258,"context_line":"        return context.session.query(models.Allocation).filter_by("},{"line_number":259,"context_line":"            resource_provider_id \u003d resource_provider_id,"},{"line_number":260,"context_line":"            resource_class_id \u003d resource_class_id).all()"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"@base.NovaObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa0719c6_85474176","line":260,"in_reply_to":"fa0719c6_d53624e6","updated":"2016-03-23 10:18:27.000000000","message":"Done","commit_id":"29a4ee8056750a6703666e8f6c1c94235e9ee7cb"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"1a8cce85bae30b9648f6526a0b0dc769f1ad960b","unresolved":false,"context_lines":[{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    @staticmethod"},{"line_number":243,"context_line":"    @db_api.main_context_manager.writer"},{"line_number":244,"context_line":"    def _create_in_db(context, updates):"},{"line_number":245,"context_line":"        db_allocation \u003d models.Allocation()"},{"line_number":246,"context_line":"        db_allocation.update(updates)"},{"line_number":247,"context_line":"        context.session.add(db_allocation)"},{"line_number":248,"context_line":"        return db_allocation"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    @staticmethod"},{"line_number":251,"context_line":"    @db_api.main_context_manager.writer"}],"source_content_type":"text/x-python","patch_set":28,"id":"1a122d0e_8f179644","line":248,"range":{"start_line":244,"start_character":4,"end_line":248,"end_character":28},"updated":"2016-05-04 07:23:54.000000000","message":"Saw a different code organization style @L132-L137, but no big deal.","commit_id":"32cabc12bc8f8aa63feaeaa6881d12d508d74217"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"c6691ee0434729095b553e742687a3b1e6b31378","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        db_allocation \u003d models.Allocation()"},{"line_number":246,"context_line":"        db_allocation.update(updates)"},{"line_number":247,"context_line":"        context.session.add(db_allocation)"},{"line_number":248,"context_line":"        return db_allocation"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    @staticmethod"},{"line_number":251,"context_line":"    @db_api.main_context_manager.writer"}],"source_content_type":"text/x-python","patch_set":28,"id":"1a122d0e_f004dd14","line":248,"in_reply_to":"1a122d0e_8f179644","updated":"2016-05-05 14:35:12.000000000","message":"If I recall correctly, the reason some of the staticmethods have been moved out to module level functions is to make some mocks work properly in python3.\n\nWhere mocks aren\u0027t being used for testing this isn\u0027t required.","commit_id":"32cabc12bc8f8aa63feaeaa6881d12d508d74217"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b6d2c1035152caefb783bcdcf5ca72aa377ff4ab","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        db_allocation_list \u003d cls._get_allocations_from_db("},{"line_number":275,"context_line":"            context, resource_provider_id, resource_class_id)"},{"line_number":276,"context_line":"        return base.obj_make_list("},{"line_number":277,"context_line":"            context, cls(context), objects.Allocation, db_allocation_list)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"    @staticmethod"},{"line_number":280,"context_line":"    @db_api.api_context_manager.reader"}],"source_content_type":"text/x-python","patch_set":38,"id":"9abb7d3a_f0110cb1","line":277,"updated":"2016-05-27 13:38:25.000000000","message":"So, here\u0027s the thing... we need to think about how AllocationList will be used. I don\u0027t see a use for getting the allocations table records for a resource provider and resource class. I *do* see a use for getting the *sum* of used amounts for *all* resource classes that a resource provider has (this would be used by the scheduler). And I see a potential use for a list of all consumers and all amounts consumed for all resources on a resource provider (that would be used in the audit functions in the resource tracker). But I don\u0027t see a use for getting the allocation records for just one resource class in a provider...\n\nWhat I would do here is the following:\n\n @base.remotable_classmethod\n def get_all_by_resource_provider(cls, context, resource_provider):\n     # return all allocation records for the resource provider\n\nand then we can create a new object called Usage that represents the SUM(used) for a resource class and resource provider from the allocations table, and a UsageList object that is a list of those Usage objects. The UsageList object would have a method get_all_by_resource_provider() that would look virtually the same as the above for AllocationList, only the query would use a GROUP BY on resource_class and use a SUM(used) to generate the Usage.used values.\n\nDoes that make sense? We need to think in terms of how this information will be used by callers. The callers are the resource tracker and the scheduler, so we should model these objects in the way that those callers need to see the information: aggregated by resource class for the scheduler and in a granular form but not limited to a particular resource class for the resource tracker.\n\nFor this patch, just do the AllocationList.get_all_by_resource_provider() implementation and then in a followup patch, add the Usage and UsageList objects that will store that aggregated-by-resource-class information.","commit_id":"8536fa404c5cf11992b9b98f9769c3fff9960919"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"41a4b399b6291f3da225553a0090336da91d1b17","unresolved":false,"context_lines":[{"line_number":556,"context_line":""},{"line_number":557,"context_line":"    @staticmethod"},{"line_number":558,"context_line":"    @db_api.api_context_manager.writer"},{"line_number":559,"context_line":"    def _destroy(context, id):"},{"line_number":560,"context_line":"        result \u003d context.session.query(models.Allocation).filter_by("},{"line_number":561,"context_line":"            id\u003did).delete()"},{"line_number":562,"context_line":"        if not result:"}],"source_content_type":"text/x-python","patch_set":57,"id":"1aa78d24_0c2ff8f6","line":559,"updated":"2016-07-05 21:34:41.000000000","message":"I would put these above where they\u0027re used too, by the way. I hate it less when the scopes are small, but still prefer to see the inner before the outer.","commit_id":"5b8a2622c61c24dda1af5132e2ad27744312729b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"29947ca46cc0188964401424a10cb500b11d20d8","unresolved":false,"context_lines":[{"line_number":556,"context_line":""},{"line_number":557,"context_line":"    @staticmethod"},{"line_number":558,"context_line":"    @db_api.api_context_manager.writer"},{"line_number":559,"context_line":"    def _destroy(context, id):"},{"line_number":560,"context_line":"        result \u003d context.session.query(models.Allocation).filter_by("},{"line_number":561,"context_line":"            id\u003did).delete()"},{"line_number":562,"context_line":"        if not result:"}],"source_content_type":"text/x-python","patch_set":57,"id":"1aa78d24_475efb76","line":559,"in_reply_to":"1aa78d24_0c2ff8f6","updated":"2016-07-05 21:52:45.000000000","message":"Done","commit_id":"5b8a2622c61c24dda1af5132e2ad27744312729b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8e3b084e6ce9a9cdfaa589cb0b04d8334f94aa98","unresolved":false,"context_lines":[{"line_number":526,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    fields \u003d {"},{"line_number":529,"context_line":"        \u0027id\u0027: fields.IntegerField(),"},{"line_number":530,"context_line":"        \u0027resource_provider\u0027: fields.ObjectField(\u0027ResourceProvider\u0027),"},{"line_number":531,"context_line":"        \u0027consumer_id\u0027: fields.UUIDField(),"},{"line_number":532,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(),"}],"source_content_type":"text/x-python","patch_set":59,"id":"1aa78d24_9c70f1a5","line":529,"updated":"2016-07-06 23:26:52.000000000","message":"I\u0027m of the opinion that we should remove the individual create() and destroy() calls for the Inventory and Allocation objects and force any modifications to inventory or allocations through the transactional ResourceProvider.set_inventory()/add_inventory().delete_inventory() methods (and the soon-to-be-coded ones for allocations.\n\nThe only place where the singular create()/destroy() methods are useful are in the functional tests, and really I\u0027m of the mind to replace those calls with direct-to-DB-sqlalchemy insert/delete operations so that we are sure to signal to developers that the only correct interface for changing allocation or inventory information is via the transactional set_XXX methods on ResourceProvider.\n\nThat said, I\u0027m also perfectly fine letting this through and removing those create()/destroy() singular methods in a future patch since nothing other than functional tests are using these calls at the moment.","commit_id":"6e58d82ff4f40bb762d2ab5c95503dc6c84917b6"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3a81545e8442558b42e54fb0221626d6ccd969f2","unresolved":false,"context_lines":[{"line_number":526,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    fields \u003d {"},{"line_number":529,"context_line":"        \u0027id\u0027: fields.IntegerField(),"},{"line_number":530,"context_line":"        \u0027resource_provider\u0027: fields.ObjectField(\u0027ResourceProvider\u0027),"},{"line_number":531,"context_line":"        \u0027consumer_id\u0027: fields.UUIDField(),"},{"line_number":532,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(),"}],"source_content_type":"text/x-python","patch_set":59,"id":"1aa78d24_f97a03f0","line":529,"updated":"2016-07-06 14:29:50.000000000","message":"Question, should we expose that internal ID for an allocation ? I don\u0027t think so.\n\nTbc, do we need to add a destroy() call? Sure. Do we need to remove all the allocations related to a specific resource class and a rp ? yes, of course. But do we need to delete a *specific* allocation done by its ID ? I\u0027m not sure.\n\nIf so, I don\u0027t really like to use the internal DB items for knowing which ID is my allocation, maybe an UUID could be better, nope ?","commit_id":"6e58d82ff4f40bb762d2ab5c95503dc6c84917b6"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"7b2e44a9809a1704eacf910c851cb309e919c5c2","unresolved":false,"context_lines":[{"line_number":526,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    fields \u003d {"},{"line_number":529,"context_line":"        \u0027id\u0027: fields.IntegerField(),"},{"line_number":530,"context_line":"        \u0027resource_provider\u0027: fields.ObjectField(\u0027ResourceProvider\u0027),"},{"line_number":531,"context_line":"        \u0027consumer_id\u0027: fields.UUIDField(),"},{"line_number":532,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(),"}],"source_content_type":"text/x-python","patch_set":59,"id":"1aa78d24_d2def90f","line":529,"in_reply_to":"1aa78d24_77fe17af","updated":"2016-07-06 16:17:14.000000000","message":"When the resource tracker is deleting allocations it will find them either by the resource_provider field or the consumer_id field, depending on the class of resource being allocated.\n\nIn either case the call will actually be done via the yet to exist call delete_allocations() (or similar) on the resource provider object so that the change can be contained within the \u0027generation\u0027 semantics currently being used when adding, updating or deleting inventory.\n\nThe destroy(), create() etc methods present here are for convenience in the rare cases where it is necessary to manage allocations outside the context described above. There\u0027s some more discussion along these lines in the comments on earlier patches.\n\nIt\u0027s quite likely we could probably trim the methods on the Allocation object back a bit: the model here was created before the \u0027generation\u0027 stuff was fleshed out. The existing style, however, is used in tests and has general utility.\n\nI\u0027m happy to change it however people like, if they do.","commit_id":"6e58d82ff4f40bb762d2ab5c95503dc6c84917b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"79ecf70134b04e104a98049a195c444fa56b1cb8","unresolved":false,"context_lines":[{"line_number":526,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    fields \u003d {"},{"line_number":529,"context_line":"        \u0027id\u0027: fields.IntegerField(),"},{"line_number":530,"context_line":"        \u0027resource_provider\u0027: fields.ObjectField(\u0027ResourceProvider\u0027),"},{"line_number":531,"context_line":"        \u0027consumer_id\u0027: fields.UUIDField(),"},{"line_number":532,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(),"}],"source_content_type":"text/x-python","patch_set":59,"id":"1aa78d24_efbf90cd","line":529,"in_reply_to":"1aa78d24_cf61f4d4","updated":"2016-07-07 15:23:08.000000000","message":"Whether or not we have the delete methods is one question, and whether or not we keep the id field here is another. I don\u0027t much care about the former if other people do, but I feel like the latter should be \"yes, keep the id field\".\n\nOne reason for keeping the CRUD operations is to enable us to provide tools for cleaning up any issues we might introduce with this stuff. Meaning, if we land all this code and determine that we\u0027re leaking allocations or something, we\u0027ll need a way to nuke one manually.\n\nHow about we make them not-remotable? That way they will fail if a compute node tries to do them, but later we could make them remotable if we need to.","commit_id":"6e58d82ff4f40bb762d2ab5c95503dc6c84917b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"55c17f5d567f8871804bcfa496c773ce9119bb66","unresolved":false,"context_lines":[{"line_number":526,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    fields \u003d {"},{"line_number":529,"context_line":"        \u0027id\u0027: fields.IntegerField(),"},{"line_number":530,"context_line":"        \u0027resource_provider\u0027: fields.ObjectField(\u0027ResourceProvider\u0027),"},{"line_number":531,"context_line":"        \u0027consumer_id\u0027: fields.UUIDField(),"},{"line_number":532,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(),"}],"source_content_type":"text/x-python","patch_set":59,"id":"1aa78d24_e5752cfa","line":529,"in_reply_to":"1aa78d24_d2def90f","updated":"2016-07-06 18:06:17.000000000","message":"Sylvain, I\u0027m not sure I get your point. If the resource tracker needs to deallocate an instance\u0027s record for IP from $pool1, we could look up the allocation by resource_provider and by consumer id and then delete it (which would use the id field like anything else), or we could have a delete_by_resource_provider_and_consumer_id() function to do the same thing without a lookup first.\n\nFrom the api side we could also do either, but I would kindof expect the first approach would be used.\n\nAnyway, unless you feel strongly about this, I\u0027d prefer id to stay in here as it is for *all* of our other DB-backed objects.","commit_id":"6e58d82ff4f40bb762d2ab5c95503dc6c84917b6"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"df28811bbbebeb3f1ea8baab27168a677c0efe38","unresolved":false,"context_lines":[{"line_number":526,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    fields \u003d {"},{"line_number":529,"context_line":"        \u0027id\u0027: fields.IntegerField(),"},{"line_number":530,"context_line":"        \u0027resource_provider\u0027: fields.ObjectField(\u0027ResourceProvider\u0027),"},{"line_number":531,"context_line":"        \u0027consumer_id\u0027: fields.UUIDField(),"},{"line_number":532,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(),"}],"source_content_type":"text/x-python","patch_set":59,"id":"1aa78d24_cf61f4d4","line":529,"in_reply_to":"1aa78d24_e5752cfa","updated":"2016-07-07 15:18:57.000000000","message":"Dan, sorry for being unclear. While I tend to prefer exposing usual CRUD operations for objects we manage thru the REST API, I feel here that all an allocation is only existing thru the concept of resource_providers.\n\nSince we\u0027re not yet clear on how we will use that new REST API in the ResourceTracker/compute side, I\u0027d tend to defer that specific implementation of .delete() till the point where we\u0027ll begin to use it so it would be like the change right before the one calling it.\n\nHere, my main worries are that we\u0027re adding remotable methods that would be very hard to remove or change, hence me proposing to only implement those methods when we need them (so the signature would be obvious by that time).","commit_id":"6e58d82ff4f40bb762d2ab5c95503dc6c84917b6"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3a213a66bcdc3dddc136913285b5b79b6c82c90c","unresolved":false,"context_lines":[{"line_number":526,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    fields \u003d {"},{"line_number":529,"context_line":"        \u0027id\u0027: fields.IntegerField(),"},{"line_number":530,"context_line":"        \u0027resource_provider\u0027: fields.ObjectField(\u0027ResourceProvider\u0027),"},{"line_number":531,"context_line":"        \u0027consumer_id\u0027: fields.UUIDField(),"},{"line_number":532,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(),"}],"source_content_type":"text/x-python","patch_set":59,"id":"1aa78d24_77fe17af","line":529,"in_reply_to":"1aa78d24_e85cee7e","updated":"2016-07-06 15:59:07.000000000","message":"So, let me think more about that. Given your example, say that we track the IPs for a resource-provider like a Neutron routed network, we have the compute node claiming the allocation by .create(). It wouldn\u0027t then persist the allocation ID, right?\n\nNow, say that the related instance is deleted, we would then delete that allocation. How can I find the related allocation for the IP ? How can I make sure *this* allocation is related to *that* IP, if the RT is not persisting it ?","commit_id":"6e58d82ff4f40bb762d2ab5c95503dc6c84917b6"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"949021bcf6e1a29aa6851d12a8ff06724152c68e","unresolved":false,"context_lines":[{"line_number":526,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    fields \u003d {"},{"line_number":529,"context_line":"        \u0027id\u0027: fields.IntegerField(),"},{"line_number":530,"context_line":"        \u0027resource_provider\u0027: fields.ObjectField(\u0027ResourceProvider\u0027),"},{"line_number":531,"context_line":"        \u0027consumer_id\u0027: fields.UUIDField(),"},{"line_number":532,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(),"}],"source_content_type":"text/x-python","patch_set":59,"id":"1aa78d24_cff1f496","line":529,"in_reply_to":"1aa78d24_efbf90cd","updated":"2016-07-07 15:26:10.000000000","message":"Having those calls non-remotable is fine by me, I was only concerned by the fact that we\u0027re providing a contract here for the future.","commit_id":"6e58d82ff4f40bb762d2ab5c95503dc6c84917b6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b3d6e407f8497fa60c20956368ebb82cace99146","unresolved":false,"context_lines":[{"line_number":526,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    fields \u003d {"},{"line_number":529,"context_line":"        \u0027id\u0027: fields.IntegerField(),"},{"line_number":530,"context_line":"        \u0027resource_provider\u0027: fields.ObjectField(\u0027ResourceProvider\u0027),"},{"line_number":531,"context_line":"        \u0027consumer_id\u0027: fields.UUIDField(),"},{"line_number":532,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(),"}],"source_content_type":"text/x-python","patch_set":59,"id":"1aa78d24_e85cee7e","line":529,"in_reply_to":"1aa78d24_f97a03f0","updated":"2016-07-06 14:53:01.000000000","message":"This is a reasonable question, I suppose.\n\nCertainly we have some resources which can come and go, right? For example, IPs will be tracked with this system. If I attach and then detach a port, I would need to delete just that allocation from the system when I detach, right?\n\nYes, I can probably get the right allocation by using the provider uuid, resource class, and consumer id, but.. surely it\u0027s more efficient to delete based on id?\n\nAlso, we store id in most of our DB-bound objects, so this is surely not a departure from convention.","commit_id":"6e58d82ff4f40bb762d2ab5c95503dc6c84917b6"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8e3b084e6ce9a9cdfaa589cb0b04d8334f94aa98","unresolved":false,"context_lines":[{"line_number":583,"context_line":"        return query.all()"},{"line_number":584,"context_line":""},{"line_number":585,"context_line":"    @base.remotable_classmethod"},{"line_number":586,"context_line":"    def get_all_by_resource_provider(cls, context, resource_provider):"},{"line_number":587,"context_line":"        resource_provider_id \u003d resource_provider.id"},{"line_number":588,"context_line":"        db_allocation_list \u003d cls._get_allocations_from_db("},{"line_number":589,"context_line":"            context, resource_provider_id)"}],"source_content_type":"text/x-python","patch_set":59,"id":"1aa78d24_fc6bf5b4","line":586,"updated":"2016-07-06 23:26:52.000000000","message":"Please make this match the InventoryList.get_all_by_resource_provider_uuid() method and pass the UUID not the resource provider object:\n\nhttps://github.com/openstack/nova/blob/master/nova/objects/resource_provider.py#L516","commit_id":"6e58d82ff4f40bb762d2ab5c95503dc6c84917b6"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"dde27daf885be53616f9d05cd1d3677e610ecc4e","unresolved":false,"context_lines":[{"line_number":579,"context_line":"                 .join(models.Allocation.resource_provider)"},{"line_number":580,"context_line":"                 .options(contains_eager(\u0027resource_provider\u0027))"},{"line_number":581,"context_line":"                 .filter(models.Allocation.resource_provider_id"},{"line_number":582,"context_line":"                                 \u003d\u003d models.ResourceProvider.id)"},{"line_number":583,"context_line":"                 .filter(models.ResourceProvider.uuid \u003d\u003d rp_uuid))"},{"line_number":584,"context_line":"        return query.all()"},{"line_number":585,"context_line":""}],"source_content_type":"text/x-python","patch_set":61,"id":"1aa78d24_b7c94d28","line":582,"updated":"2016-07-07 20:40:54.000000000","message":"Is there no way to take advantage of the relationship defined on the model for this? This duplicates that and specifies it as an eager load. If the relationship was defined with lazy\u003d\u0027joined\u0027 it would accomplish the same thing I think.","commit_id":"b82f7f0f06a7d8ee762795e988b58428f2f53b42"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"570c06e471478d5962097799e4b3017bfd7b24a5","unresolved":false,"context_lines":[{"line_number":579,"context_line":"                 .join(models.Allocation.resource_provider)"},{"line_number":580,"context_line":"                 .options(contains_eager(\u0027resource_provider\u0027))"},{"line_number":581,"context_line":"                 .filter(models.Allocation.resource_provider_id"},{"line_number":582,"context_line":"                                 \u003d\u003d models.ResourceProvider.id)"},{"line_number":583,"context_line":"                 .filter(models.ResourceProvider.uuid \u003d\u003d rp_uuid))"},{"line_number":584,"context_line":"        return query.all()"},{"line_number":585,"context_line":""}],"source_content_type":"text/x-python","patch_set":61,"id":"1aa78d24_172301be","line":582,"in_reply_to":"1aa78d24_b7c94d28","updated":"2016-07-07 20:44:30.000000000","message":"Yeah, shouldn\u0027t be needed. I just tested without it and everything still works. Sorry, I just wasn\u0027t thinking.","commit_id":"b82f7f0f06a7d8ee762795e988b58428f2f53b42"}],"nova/tests/functional/db/test_resource_provider.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"625546e43885c254fc392911e9eb2d90cc25bae1","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"DISK_ALLOCATION \u003d dict("},{"line_number":31,"context_line":"    consumer_id\u003duuidsentinel.disk_consumer,"},{"line_number":32,"context_line":"    used\u003d2"},{"line_number":33,"context_line":")"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"fa0719c6_1531bcec","line":32,"updated":"2016-03-22 20:36:27.000000000","message":"It would be better to include resource_class\u003dfields.ResourceClass.DISK_GB here, otherwise DISK_ALLOCATION could easily be MEMORY_MB_ALLOCATION or anything else, frankly.","commit_id":"29a4ee8056750a6703666e8f6c1c94235e9ee7cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2d3528f337e85d4ae367b6c6942f11d4b7a1a8fd","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"DISK_ALLOCATION \u003d dict("},{"line_number":31,"context_line":"    consumer_id\u003duuidsentinel.disk_consumer,"},{"line_number":32,"context_line":"    used\u003d2"},{"line_number":33,"context_line":")"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"fa0719c6_c57659d6","line":32,"in_reply_to":"fa0719c6_1531bcec","updated":"2016-03-23 10:18:27.000000000","message":"Done","commit_id":"29a4ee8056750a6703666e8f6c1c94235e9ee7cb"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"625546e43885c254fc392911e9eb2d90cc25bae1","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        disk_allocation \u003d objects.Allocation("},{"line_number":132,"context_line":"            context\u003dself.context,"},{"line_number":133,"context_line":"            resource_provider\u003dresource_provider,"},{"line_number":134,"context_line":"            resource_class\u003dresource_class,"},{"line_number":135,"context_line":"            **DISK_ALLOCATION"},{"line_number":136,"context_line":"        )"},{"line_number":137,"context_line":"        disk_allocation.create()"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa0719c6_754e3870","line":134,"updated":"2016-03-22 20:36:27.000000000","message":"And remove the above line.","commit_id":"29a4ee8056750a6703666e8f6c1c94235e9ee7cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2d3528f337e85d4ae367b6c6942f11d4b7a1a8fd","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        disk_allocation \u003d objects.Allocation("},{"line_number":132,"context_line":"            context\u003dself.context,"},{"line_number":133,"context_line":"            resource_provider\u003dresource_provider,"},{"line_number":134,"context_line":"            resource_class\u003dresource_class,"},{"line_number":135,"context_line":"            **DISK_ALLOCATION"},{"line_number":136,"context_line":"        )"},{"line_number":137,"context_line":"        disk_allocation.create()"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa0719c6_057df1b0","line":134,"in_reply_to":"fa0719c6_754e3870","updated":"2016-03-23 10:18:27.000000000","message":"Done","commit_id":"29a4ee8056750a6703666e8f6c1c94235e9ee7cb"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"625546e43885c254fc392911e9eb2d90cc25bae1","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        self.assertEqual(DISK_ALLOCATION[\u0027used\u0027],"},{"line_number":143,"context_line":"                         disk_allocation.used)"},{"line_number":144,"context_line":"        self.assertEqual(DISK_ALLOCATION[\u0027consumer_id\u0027],"},{"line_number":145,"context_line":"                         uuidsentinel.disk_consumer)"},{"line_number":146,"context_line":"        self.assertIsInstance(disk_allocation.id, int)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        allocations \u003d objects.AllocationList.get_allocations("}],"source_content_type":"text/x-python","patch_set":12,"id":"fa0719c6_5551740d","line":145,"updated":"2016-03-22 20:36:27.000000000","message":"nits... we try to keep the order of assertEqual()\u0027s parameters (expected, actual)","commit_id":"29a4ee8056750a6703666e8f6c1c94235e9ee7cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"9c3fbc0c9e3e962af13cb1719dee23ea269371a0","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        self.assertEqual(DISK_ALLOCATION[\u0027used\u0027],"},{"line_number":143,"context_line":"                         disk_allocation.used)"},{"line_number":144,"context_line":"        self.assertEqual(DISK_ALLOCATION[\u0027consumer_id\u0027],"},{"line_number":145,"context_line":"                         uuidsentinel.disk_consumer)"},{"line_number":146,"context_line":"        self.assertIsInstance(disk_allocation.id, int)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        allocations \u003d objects.AllocationList.get_allocations("}],"source_content_type":"text/x-python","patch_set":12,"id":"fa0719c6_7ba909df","line":145,"in_reply_to":"fa0719c6_5551740d","updated":"2016-03-22 21:26:09.000000000","message":"That\u0027s actually a bug there. It should be checking the sentinel.","commit_id":"29a4ee8056750a6703666e8f6c1c94235e9ee7cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2d3528f337e85d4ae367b6c6942f11d4b7a1a8fd","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        self.assertEqual(DISK_ALLOCATION[\u0027used\u0027],"},{"line_number":143,"context_line":"                         disk_allocation.used)"},{"line_number":144,"context_line":"        self.assertEqual(DISK_ALLOCATION[\u0027consumer_id\u0027],"},{"line_number":145,"context_line":"                         uuidsentinel.disk_consumer)"},{"line_number":146,"context_line":"        self.assertIsInstance(disk_allocation.id, int)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        allocations \u003d objects.AllocationList.get_allocations("}],"source_content_type":"text/x-python","patch_set":12,"id":"fa0719c6_654cad9e","line":145,"in_reply_to":"fa0719c6_7ba909df","updated":"2016-03-23 10:18:27.000000000","message":"Done","commit_id":"29a4ee8056750a6703666e8f6c1c94235e9ee7cb"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"41a4b399b6291f3da225553a0090336da91d1b17","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            context\u003dself.context,"},{"line_number":91,"context_line":"            uuid\u003duuidsentinel.inventory_resource_provider"},{"line_number":92,"context_line":"        )"},{"line_number":93,"context_line":"        resource_class \u003d fields.ResourceClass.DISK_GB"},{"line_number":94,"context_line":"        disk_inventory \u003d objects.Inventory("},{"line_number":95,"context_line":"            context\u003dself.context,"},{"line_number":96,"context_line":"            resource_provider\u003dresource_provider,"}],"source_content_type":"text/x-python","patch_set":57,"id":"1aa78d24_0c4ed895","side":"PARENT","line":93,"updated":"2016-07-05 21:34:41.000000000","message":"Why is a patch about Allocations touching stuff in the Inventory tests?","commit_id":"f5dbc82f6a5d9c8938930fe21aac6a9db99f48fb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"29947ca46cc0188964401424a10cb500b11d20d8","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            context\u003dself.context,"},{"line_number":91,"context_line":"            uuid\u003duuidsentinel.inventory_resource_provider"},{"line_number":92,"context_line":"        )"},{"line_number":93,"context_line":"        resource_class \u003d fields.ResourceClass.DISK_GB"},{"line_number":94,"context_line":"        disk_inventory \u003d objects.Inventory("},{"line_number":95,"context_line":"            context\u003dself.context,"},{"line_number":96,"context_line":"            resource_provider\u003dresource_provider,"}],"source_content_type":"text/x-python","patch_set":57,"id":"1aa78d24_878583ae","side":"PARENT","line":93,"in_reply_to":"1aa78d24_0c4ed895","updated":"2016-07-05 21:52:45.000000000","message":"Because the DISK_INVENTORY which is shared between the tests was changed. There\u0027s a note in the commit message.","commit_id":"f5dbc82f6a5d9c8938930fe21aac6a9db99f48fb"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"79fd555e1b02d257375b2ea7af91e47d58df8b81","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            context\u003dself.context,"},{"line_number":91,"context_line":"            uuid\u003duuidsentinel.inventory_resource_provider"},{"line_number":92,"context_line":"        )"},{"line_number":93,"context_line":"        resource_class \u003d fields.ResourceClass.DISK_GB"},{"line_number":94,"context_line":"        disk_inventory \u003d objects.Inventory("},{"line_number":95,"context_line":"            context\u003dself.context,"},{"line_number":96,"context_line":"            resource_provider\u003dresource_provider,"}],"source_content_type":"text/x-python","patch_set":57,"id":"1aa78d24_fb605fd1","side":"PARENT","line":93,"in_reply_to":"1aa78d24_878583ae","updated":"2016-07-05 22:00:04.000000000","message":"But not in this patch, right?\n\nAnyway, as long as it is intentional I\u0027ll bite my lip.","commit_id":"f5dbc82f6a5d9c8938930fe21aac6a9db99f48fb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"65b43254d13c9f5d0a65c4daf48e6a786dd3f364","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            context\u003dself.context,"},{"line_number":91,"context_line":"            uuid\u003duuidsentinel.inventory_resource_provider"},{"line_number":92,"context_line":"        )"},{"line_number":93,"context_line":"        resource_class \u003d fields.ResourceClass.DISK_GB"},{"line_number":94,"context_line":"        disk_inventory \u003d objects.Inventory("},{"line_number":95,"context_line":"            context\u003dself.context,"},{"line_number":96,"context_line":"            resource_provider\u003dresource_provider,"}],"source_content_type":"text/x-python","patch_set":57,"id":"1aa78d24_3ea3f5b3","side":"PARENT","line":93,"in_reply_to":"1aa78d24_fb605fd1","updated":"2016-07-05 22:37:27.000000000","message":"It\u0027s basically to have some parallelism between the two constants DISK_INVENTORY and DISK_ALLOCATION.\n\nHappy to get rid of it if that makes people happy, but the tidiness makes me happy.","commit_id":"f5dbc82f6a5d9c8938930fe21aac6a9db99f48fb"}],"nova/tests/unit/objects/test_resource_provider.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"625546e43885c254fc392911e9eb2d90cc25bae1","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    \u0027id\u0027: _ALLOCATION_ID,"},{"line_number":46,"context_line":"    \u0027resource_provider_id\u0027: _RESOURCE_PROVIDER_ID,"},{"line_number":47,"context_line":"    \u0027resource_class_id\u0027: _RESOURCE_CLASS_ID,"},{"line_number":48,"context_line":"    \u0027consumer_id\u0027: uuids.fake_compute_node,"},{"line_number":49,"context_line":"    \u0027used\u0027: 8,"},{"line_number":50,"context_line":"}"},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"fa0719c6_353680e6","line":48,"updated":"2016-03-22 20:36:27.000000000","message":"Erm, this would be the instance, not the compute node :)","commit_id":"29a4ee8056750a6703666e8f6c1c94235e9ee7cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2d3528f337e85d4ae367b6c6942f11d4b7a1a8fd","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    \u0027id\u0027: _ALLOCATION_ID,"},{"line_number":46,"context_line":"    \u0027resource_provider_id\u0027: _RESOURCE_PROVIDER_ID,"},{"line_number":47,"context_line":"    \u0027resource_class_id\u0027: _RESOURCE_CLASS_ID,"},{"line_number":48,"context_line":"    \u0027consumer_id\u0027: uuids.fake_compute_node,"},{"line_number":49,"context_line":"    \u0027used\u0027: 8,"},{"line_number":50,"context_line":"}"},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"fa0719c6_8570e1dd","line":48,"in_reply_to":"fa0719c6_353680e6","updated":"2016-03-23 10:18:27.000000000","message":"Done","commit_id":"29a4ee8056750a6703666e8f6c1c94235e9ee7cb"}]}
