)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":21,"context_line":"ProviderSummary respectively. The"},{"line_number":22,"context_line":"PlacementAlternatives.get_by_filters() method accepts a dict of"},{"line_number":23,"context_line":"resources in a similar fashion to"},{"line_number":24,"context_line":"ResourceProviderList.get_all_by_filters() and is will be used in"},{"line_number":25,"context_line":"follow-up patches to expose the proposed GET /allocation_requests REST"},{"line_number":26,"context_line":"endpoint being discussed in the placement-allocation-requests spec"},{"line_number":27,"context_line":"(https://review.openstack.org/#/c/471927/)."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"7f231b9d_5a92aa4d","line":24,"range":{"start_line":24,"start_character":46,"end_line":24,"end_character":48},"updated":"2017-06-16 18:37:16.000000000","message":"s/is//","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0c6f39e3f8b4727b2a0da951a9411ecf928ebc62","unresolved":false,"context_lines":[{"line_number":20,"context_line":"These fields store lists of objects of type AllocationRequest and"},{"line_number":21,"context_line":"ProviderSummary respectively. The AllocationCandidates.get_by_filters()"},{"line_number":22,"context_line":"method accepts a dict of resources in a similar fashion to"},{"line_number":23,"context_line":"ResourceProviderList.get_all_by_filters() and is will be used in"},{"line_number":24,"context_line":"follow-up patches to expose the proposed GET /allocation_requests REST"},{"line_number":25,"context_line":"endpoint being discussed in the placement-allocation-requests spec"},{"line_number":26,"context_line":"(https://review.openstack.org/#/c/471927/)."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7f231b9d_96546c23","line":23,"range":{"start_line":23,"start_character":46,"end_line":23,"end_character":48},"updated":"2017-06-19 18:25:21.000000000","message":"Remove \"is\".","commit_id":"13518594fc14becfacf863ecc4983f290b5aa680"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"2f21da23d77e6417a0b0c084a9207eb9e0581c2b","unresolved":false,"context_lines":[{"line_number":20,"context_line":"These fields store lists of objects of type AllocationRequest and"},{"line_number":21,"context_line":"ProviderSummary respectively. The AllocationCandidates.get_by_filters()"},{"line_number":22,"context_line":"method accepts a dict of resources in a similar fashion to"},{"line_number":23,"context_line":"ResourceProviderList.get_all_by_filters() and is will be used in"},{"line_number":24,"context_line":"follow-up patches to expose the proposed GET /allocation_requests REST"},{"line_number":25,"context_line":"endpoint being discussed in the placement-allocation-requests spec"},{"line_number":26,"context_line":"(https://review.openstack.org/#/c/471927/)."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7f231b9d_39822b02","line":23,"range":{"start_line":23,"start_character":46,"end_line":23,"end_character":48},"in_reply_to":"7f231b9d_96546c23","updated":"2017-06-19 18:40:27.000000000","message":"Done","commit_id":"13518594fc14becfacf863ecc4983f290b5aa680"}],"nova/objects/resource_provider.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"54db7708a8928a65ce258502e447030e927d106e","unresolved":false,"context_lines":[{"line_number":2173,"context_line":"        return base.obj_make_list(context, cls(context), Trait, db_traits)"},{"line_number":2174,"context_line":""},{"line_number":2175,"context_line":""},{"line_number":2176,"context_line":"class AllocationRequestResource(base.NovaObject):"},{"line_number":2177,"context_line":"    # 1.0: Initial version"},{"line_number":2178,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":2179,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f231b9d_afc8f454","line":2176,"updated":"2017-06-12 17:10:46.000000000","message":"Note that this is not registered, and thus can\u0027t be sent over RPC. That said:\n\nWhy are these nova objects?\n\nIf these are for the placement side to prepare the response, why not just prepare the response dictionary itself? I see below that you have a semi-objects-esque classmethod query, but you just need to turn the object back into the appropriate dict, right?\n\nIf these are for the scheduler-side, we just need these within the scheduler itself to parse the result of the call to placement, right? They should never need to be versioned and thus I think they could be just regular objects, or really, just not modeled at all. Why not let the code using the result from placement not just examine the data structure returned directly?\n\nWe said (or I said) that conductor would treat the bit of this that scheduler puts into the request as a black box for the purposes of the retry, so there\u0027s really no reason to version or over-model this, IMHO.\n\nI guess my point is, I\u0027m not sure what the point of all this modeling is, when the _get_by_filters() below can just construct the response payload itself just as easy.","commit_id":"d32d8261d902c18c6066ad85fab9f9b7a5a03840"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9a46c76688cbbc69d3ec707d2c165ef5539363c0","unresolved":false,"context_lines":[{"line_number":2173,"context_line":"        return base.obj_make_list(context, cls(context), Trait, db_traits)"},{"line_number":2174,"context_line":""},{"line_number":2175,"context_line":""},{"line_number":2176,"context_line":"class AllocationRequestResource(base.NovaObject):"},{"line_number":2177,"context_line":"    # 1.0: Initial version"},{"line_number":2178,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":2179,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f231b9d_4f95e0e3","line":2176,"in_reply_to":"7f231b9d_2fcce433","updated":"2017-06-12 17:17:02.000000000","message":"Okay, well, that\u0027s your call. Seems like a lot of work for no real gain, but I do like consistency.\n\nNote that you haven\u0027t registered these, so the fields aren\u0027t even constructed, which means you\u0027re not getting type enforcement or anything like that. You need to at least build them, and I\u0027d recommend we don\u0027t register them to make sure they\u0027re not rpc\u0027able by accident. So something like:\n\n @base.register_if(False)\n\non each.","commit_id":"d32d8261d902c18c6066ad85fab9f9b7a5a03840"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d254a6f5e7f3ad3d0fc1ee5496015c8ac3e15245","unresolved":false,"context_lines":[{"line_number":2173,"context_line":"        return base.obj_make_list(context, cls(context), Trait, db_traits)"},{"line_number":2174,"context_line":""},{"line_number":2175,"context_line":""},{"line_number":2176,"context_line":"class AllocationRequestResource(base.NovaObject):"},{"line_number":2177,"context_line":"    # 1.0: Initial version"},{"line_number":2178,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":2179,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f231b9d_52ffc700","line":2176,"in_reply_to":"7f231b9d_4f95e0e3","updated":"2017-06-12 17:21:10.000000000","message":"Done","commit_id":"d32d8261d902c18c6066ad85fab9f9b7a5a03840"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"5934c60c326a43f7bea30113b7b06bab59fd5baa","unresolved":false,"context_lines":[{"line_number":2173,"context_line":"        return base.obj_make_list(context, cls(context), Trait, db_traits)"},{"line_number":2174,"context_line":""},{"line_number":2175,"context_line":""},{"line_number":2176,"context_line":"class AllocationRequestResource(base.NovaObject):"},{"line_number":2177,"context_line":"    # 1.0: Initial version"},{"line_number":2178,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":2179,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f231b9d_2fcce433","line":2176,"in_reply_to":"7f231b9d_afc8f454","updated":"2017-06-12 17:14:40.000000000","message":"We send no resource provider objects over RPC, ever. Which is why there\u0027s no remotable methods on any of the r-p objects.\n\nThat said, these are nova objects because the rest of the resource provider objects are nova objects...","commit_id":"d32d8261d902c18c6066ad85fab9f9b7a5a03840"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8c84823366eb88a479be125f1e8140c254aa0ed3","unresolved":false,"context_lines":[{"line_number":2349,"context_line":"        )"},{"line_number":2350,"context_line":""},{"line_number":2351,"context_line":"        # Build up a dict, keyed by internal resource provider ID, of usage"},{"line_number":2352,"context_line":"        # information that from which we will then build both allocation"},{"line_number":2353,"context_line":"        # request and provider summary information"},{"line_number":2354,"context_line":"        summaries \u003d {}"},{"line_number":2355,"context_line":"        for usage in usages:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f231b9d_17326ff2","line":2352,"range":{"start_line":2352,"start_character":22,"end_line":2352,"end_character":31},"updated":"2017-06-12 11:34:13.000000000","message":"from","commit_id":"d32d8261d902c18c6066ad85fab9f9b7a5a03840"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8c84823366eb88a479be125f1e8140c254aa0ed3","unresolved":false,"context_lines":[{"line_number":2375,"context_line":"            }"},{"line_number":2376,"context_line":""},{"line_number":2377,"context_line":"        # Next, build up a list of allocation requests. These allocation"},{"line_number":2378,"context_line":"        # requests are dicts,, keyed by resource class name, of resource"},{"line_number":2379,"context_line":"        # provider UUIDs and amounts to consume from that resource provider"},{"line_number":2380,"context_line":"        alloc_request_objs \u003d []"},{"line_number":2381,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f231b9d_d7519710","line":2378,"range":{"start_line":2378,"start_character":28,"end_line":2378,"end_character":30},"updated":"2017-06-12 11:34:13.000000000","message":",","commit_id":"d32d8261d902c18c6066ad85fab9f9b7a5a03840"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2173,"context_line":"        return base.obj_make_list(context, cls(context), Trait, db_traits)"},{"line_number":2174,"context_line":""},{"line_number":2175,"context_line":""},{"line_number":2176,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2177,"context_line":"class AllocationRequestResource(base.NovaObject):"},{"line_number":2178,"context_line":"    # 1.0: Initial version"},{"line_number":2179,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_7cc8c3a4","line":2176,"updated":"2017-06-16 18:37:16.000000000","message":"Why aren\u0027t these registered? They are just helper objects/containers/models?","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2186,"context_line":""},{"line_number":2187,"context_line":""},{"line_number":2188,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2189,"context_line":"class AllocationRequest(base.NovaObject):"},{"line_number":2190,"context_line":"    # 1.0: Initial version"},{"line_number":2191,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":2192,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_5c48672b","line":2189,"range":{"start_line":2189,"start_character":6,"end_line":2189,"end_character":23},"updated":"2017-06-16 18:37:16.000000000","message":"Could be AllocationRequestResourceList? Since it contains a list of AllocationRequestResource objects. Then it could also use ObjectListBase.\n\nBut I see PlacementAlternatives contains a list of these, so things get weird.\n\nSo a PlacementAlternatives has a list of allocation requests, and each allocation request has a list of resource requests, with each being a given resource provider, resource class and amount of resource to allocate for that class against that provider. OK.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2205,"context_line":"    fields \u003d {"},{"line_number":2206,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(read_only\u003dTrue),"},{"line_number":2207,"context_line":"        \u0027capacity\u0027: fields.NonNegativeIntegerField(),"},{"line_number":2208,"context_line":"        \u0027used\u0027: fields.NonNegativeIntegerField(),"},{"line_number":2209,"context_line":"    }"},{"line_number":2210,"context_line":""},{"line_number":2211,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_9cb95f7a","line":2208,"range":{"start_line":2208,"start_character":9,"end_line":2208,"end_character":13},"updated":"2017-06-16 18:37:16.000000000","message":"nit: \"usage\" to match the Usage object? Or is this matching the Allocation.used field? If the latter, that\u0027s an IntegerField while this is a NonNegativeIntegerField - should those be consistent? Can you have negative usage?","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3753f372babd1bd4ca5bcd10ec4739c5d229b0db","unresolved":false,"context_lines":[{"line_number":2205,"context_line":"    fields \u003d {"},{"line_number":2206,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(read_only\u003dTrue),"},{"line_number":2207,"context_line":"        \u0027capacity\u0027: fields.NonNegativeIntegerField(),"},{"line_number":2208,"context_line":"        \u0027used\u0027: fields.NonNegativeIntegerField(),"},{"line_number":2209,"context_line":"    }"},{"line_number":2210,"context_line":""},{"line_number":2211,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_a2363050","line":2208,"range":{"start_line":2208,"start_character":9,"end_line":2208,"end_character":13},"in_reply_to":"7f231b9d_9cb95f7a","updated":"2017-06-16 18:51:39.000000000","message":"should be used to match Allocation. these all should be NonNegativeIntegerField.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2223,"context_line":""},{"line_number":2224,"context_line":"@db_api.api_context_manager.reader"},{"line_number":2225,"context_line":"def _get_usages_by_provider_and_rc(ctx, rp_ids, rc_ids):"},{"line_number":2226,"context_line":"    \"\"\"Returns a dict, keyed by resource provider ID (internal ID, not UUID) of"},{"line_number":2227,"context_line":"    usage and inventory information about the provider/resource class."},{"line_number":2228,"context_line":"    \"\"\""},{"line_number":2229,"context_line":"    rpt \u003d sa.alias(_RP_TBL, name\u003d\"rp\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_df9a2912","line":2226,"range":{"start_line":2226,"start_character":7,"end_line":2226,"end_character":21},"updated":"2017-06-16 18:37:16.000000000","message":"This doesn\u0027t return a dict.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3753f372babd1bd4ca5bcd10ec4739c5d229b0db","unresolved":false,"context_lines":[{"line_number":2223,"context_line":""},{"line_number":2224,"context_line":"@db_api.api_context_manager.reader"},{"line_number":2225,"context_line":"def _get_usages_by_provider_and_rc(ctx, rp_ids, rc_ids):"},{"line_number":2226,"context_line":"    \"\"\"Returns a dict, keyed by resource provider ID (internal ID, not UUID) of"},{"line_number":2227,"context_line":"    usage and inventory information about the provider/resource class."},{"line_number":2228,"context_line":"    \"\"\""},{"line_number":2229,"context_line":"    rpt \u003d sa.alias(_RP_TBL, name\u003d\"rp\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_224220ac","line":2226,"range":{"start_line":2226,"start_character":7,"end_line":2226,"end_character":21},"in_reply_to":"7f231b9d_df9a2912","updated":"2017-06-16 18:51:39.000000000","message":"will reword","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2228,"context_line":"    \"\"\""},{"line_number":2229,"context_line":"    rpt \u003d sa.alias(_RP_TBL, name\u003d\"rp\")"},{"line_number":2230,"context_line":"    inv \u003d sa.alias(_INV_TBL, name\u003d\"inv\")"},{"line_number":2231,"context_line":"    usage \u003d sa.alias("},{"line_number":2232,"context_line":"        sa.select(["},{"line_number":2233,"context_line":"            _ALLOC_TBL.c.resource_provider_id,"},{"line_number":2234,"context_line":"            _ALLOC_TBL.c.resource_class_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_ffc045e3","line":2231,"updated":"2017-06-16 18:37:16.000000000","message":"nit: comments within for the things being built for sql would be helpful.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"80bf75ccd3637e326e8933393310e393e669d022","unresolved":false,"context_lines":[{"line_number":2228,"context_line":"    \"\"\""},{"line_number":2229,"context_line":"    rpt \u003d sa.alias(_RP_TBL, name\u003d\"rp\")"},{"line_number":2230,"context_line":"    inv \u003d sa.alias(_INV_TBL, name\u003d\"inv\")"},{"line_number":2231,"context_line":"    usage \u003d sa.alias("},{"line_number":2232,"context_line":"        sa.select(["},{"line_number":2233,"context_line":"            _ALLOC_TBL.c.resource_provider_id,"},{"line_number":2234,"context_line":"            _ALLOC_TBL.c.resource_class_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_aabee2aa","line":2231,"in_reply_to":"7f231b9d_50af2629","updated":"2017-06-19 17:49:25.000000000","message":"Done","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3825f053695bc3c9c3ab96866d1894ddbec3f7a7","unresolved":false,"context_lines":[{"line_number":2228,"context_line":"    \"\"\""},{"line_number":2229,"context_line":"    rpt \u003d sa.alias(_RP_TBL, name\u003d\"rp\")"},{"line_number":2230,"context_line":"    inv \u003d sa.alias(_INV_TBL, name\u003d\"inv\")"},{"line_number":2231,"context_line":"    usage \u003d sa.alias("},{"line_number":2232,"context_line":"        sa.select(["},{"line_number":2233,"context_line":"            _ALLOC_TBL.c.resource_provider_id,"},{"line_number":2234,"context_line":"            _ALLOC_TBL.c.resource_class_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_50af2629","line":2231,"in_reply_to":"7f231b9d_c20c8c95","updated":"2017-06-16 20:09:22.000000000","message":"I\u0027m not sure the generated SQL would help me, I guess I was thinking more prose, like here we\u0027re building foo, then below we build bar, and then after that we are combining them for baz. The docstring at the top kind of lays this out, it\u0027s just sparse. This isn\u0027t critical for me either way.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3753f372babd1bd4ca5bcd10ec4739c5d229b0db","unresolved":false,"context_lines":[{"line_number":2228,"context_line":"    \"\"\""},{"line_number":2229,"context_line":"    rpt \u003d sa.alias(_RP_TBL, name\u003d\"rp\")"},{"line_number":2230,"context_line":"    inv \u003d sa.alias(_INV_TBL, name\u003d\"inv\")"},{"line_number":2231,"context_line":"    usage \u003d sa.alias("},{"line_number":2232,"context_line":"        sa.select(["},{"line_number":2233,"context_line":"            _ALLOC_TBL.c.resource_provider_id,"},{"line_number":2234,"context_line":"            _ALLOC_TBL.c.resource_class_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_c20c8c95","line":2231,"in_reply_to":"7f231b9d_ffc045e3","updated":"2017-06-16 18:51:39.000000000","message":"you mean you\u0027d like a code comment showing the SQL generated from this? or something else?","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7f8fd1d4ac2fa2d3d8a5079f07f0aedb91745ea4","unresolved":false,"context_lines":[{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":""},{"line_number":2268,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2269,"context_line":"class PlacementAlternatives(base.NovaObject):"},{"line_number":2270,"context_line":"    \"\"\"The PlacementAlternatives object describes resource providers, including"},{"line_number":2271,"context_line":"    providers of shared resources, that meet a particular request for resources"},{"line_number":2272,"context_line":"    and traits."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_c271a10e","line":2269,"range":{"start_line":2269,"start_character":6,"end_line":2269,"end_character":27},"updated":"2017-06-13 15:24:29.000000000","message":"I don\u0027t get why \u0027Placement\u0027 is in the name. This doesn\u0027t provide an alternative for placement.\n\n\u0027Alternatives\u0027 implies that this is different from the selected candidate. If we are in fact going to return this to scheduler, and have the scheduler then process this to do its selection, it should be something like \u0027QualifiedResourceProviders\u0027 or similar.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ca040cb3ec37d01da120cc07e5f346cf849f5b52","unresolved":false,"context_lines":[{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":""},{"line_number":2268,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2269,"context_line":"class PlacementAlternatives(base.NovaObject):"},{"line_number":2270,"context_line":"    \"\"\"The PlacementAlternatives object describes resource providers, including"},{"line_number":2271,"context_line":"    providers of shared resources, that meet a particular request for resources"},{"line_number":2272,"context_line":"    and traits."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_d084af0e","line":2269,"in_reply_to":"7f231b9d_02b30bec","updated":"2017-06-14 11:11:57.000000000","message":"I prefer ProvderAllocationCandidates to PlacementAlternatives (or anything with alternatives in the name) because we\u0027re already using the term alternatives to mean that extra stuff we\u0027re composing in the scheduler so the conductor can do retries.\n\nSpeaking of, I\u0027m still unclear on how this model of passing around allocations is going to work with the retry-in-conductor need?","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7d8e8c9b9062d08785856f674c240578f7a865eb","unresolved":false,"context_lines":[{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":""},{"line_number":2268,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2269,"context_line":"class PlacementAlternatives(base.NovaObject):"},{"line_number":2270,"context_line":"    \"\"\"The PlacementAlternatives object describes resource providers, including"},{"line_number":2271,"context_line":"    providers of shared resources, that meet a particular request for resources"},{"line_number":2272,"context_line":"    and traits."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_41d561e4","line":2269,"range":{"start_line":2269,"start_character":6,"end_line":2269,"end_character":27},"in_reply_to":"7f231b9d_0d9d62bb","updated":"2017-06-14 19:33:20.000000000","message":"OK, now I\u0027m extra-confused :)\n\nI thought that the idea was to return a list of root RPs, and along with each would be the dict that would need to be passed to placement to claim the resources, including any shared/nested providers. Is that not what we\u0027re doing here? The docstring below says \"The PlacementAlternatives object describes resource providers, including providers of shared resources, that meet a particular request for resources and traits.\"","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"b2231b447d0f8d6f2f850f0d5841ca02f7241b11","unresolved":false,"context_lines":[{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":""},{"line_number":2268,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2269,"context_line":"class PlacementAlternatives(base.NovaObject):"},{"line_number":2270,"context_line":"    \"\"\"The PlacementAlternatives object describes resource providers, including"},{"line_number":2271,"context_line":"    providers of shared resources, that meet a particular request for resources"},{"line_number":2272,"context_line":"    and traits."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_d693a0a2","line":2269,"range":{"start_line":2269,"start_character":6,"end_line":2269,"end_character":27},"in_reply_to":"7f231b9d_2b6eed00","updated":"2017-06-13 19:11:07.000000000","message":"If this in internal only to placement, then \u0027Placement\u0027 really doesn\u0027t apply. And if this going to be the primary way that resources will be searched for and returned, let\u0027s not call it \u0027alternative\u0027. 3 years from now it will seem confusing.\n\nNot to bikeshed on this, but the name confused me, so I can\u0027t imagine it being any clearer to someone new to the code.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":""},{"line_number":2268,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2269,"context_line":"class PlacementAlternatives(base.NovaObject):"},{"line_number":2270,"context_line":"    \"\"\"The PlacementAlternatives object describes resource providers, including"},{"line_number":2271,"context_line":"    providers of shared resources, that meet a particular request for resources"},{"line_number":2272,"context_line":"    and traits."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_dc947739","line":2269,"range":{"start_line":2269,"start_character":6,"end_line":2269,"end_character":27},"in_reply_to":"7f231b9d_32b3d54f","updated":"2017-06-16 18:37:16.000000000","message":"+1 to ProviderAllocationCandidates and updating/clarifying the docstring.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"451ea94b7fba144e2a10776db89b79ed6365e775","unresolved":false,"context_lines":[{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":""},{"line_number":2268,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2269,"context_line":"class PlacementAlternatives(base.NovaObject):"},{"line_number":2270,"context_line":"    \"\"\"The PlacementAlternatives object describes resource providers, including"},{"line_number":2271,"context_line":"    providers of shared resources, that meet a particular request for resources"},{"line_number":2272,"context_line":"    and traits."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_32b3d54f","line":2269,"range":{"start_line":2269,"start_character":6,"end_line":2269,"end_character":27},"in_reply_to":"7f231b9d_41d561e4","updated":"2017-06-14 21:02:16.000000000","message":"I should reword the docstring to say \"describes resource providers that meet a particular request along with a set of possible allocation request bodies that can be used by the caller to attempt claims against those resource providers.\"\n\nDon\u0027t be confused :) This is exactly what we described on the straw man etherpad.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9f32c02e589fdc5f33cf1e96a01fd6b5528a87aa","unresolved":false,"context_lines":[{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":""},{"line_number":2268,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2269,"context_line":"class PlacementAlternatives(base.NovaObject):"},{"line_number":2270,"context_line":"    \"\"\"The PlacementAlternatives object describes resource providers, including"},{"line_number":2271,"context_line":"    providers of shared resources, that meet a particular request for resources"},{"line_number":2272,"context_line":"    and traits."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_86415d3c","line":2269,"range":{"start_line":2269,"start_character":6,"end_line":2269,"end_character":27},"in_reply_to":"7f231b9d_42b903ca","updated":"2017-06-14 12:07:15.000000000","message":"Well, I did suggest \u0027QualifiedResourceProviders\u0027 in my first comment. \u0027MatchedResourceProviders\u0027, \u0027FilteredResourceProviders\u0027, etc., would all work too.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b04799421adc1947cd617a5686a2a8f80032e26c","unresolved":false,"context_lines":[{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":""},{"line_number":2268,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2269,"context_line":"class PlacementAlternatives(base.NovaObject):"},{"line_number":2270,"context_line":"    \"\"\"The PlacementAlternatives object describes resource providers, including"},{"line_number":2271,"context_line":"    providers of shared resources, that meet a particular request for resources"},{"line_number":2272,"context_line":"    and traits."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_0d9d62bb","line":2269,"range":{"start_line":2269,"start_character":6,"end_line":2269,"end_character":27},"in_reply_to":"7f231b9d_86415d3c","updated":"2017-06-14 16:54:39.000000000","message":"Right, but we\u0027re returning allocation requests, not providers.\n\nHow about ProviderAllocationCandidates?","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea36150e05ec3df4f71cee884d58b8319cf074d8","unresolved":false,"context_lines":[{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":""},{"line_number":2268,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2269,"context_line":"class PlacementAlternatives(base.NovaObject):"},{"line_number":2270,"context_line":"    \"\"\"The PlacementAlternatives object describes resource providers, including"},{"line_number":2271,"context_line":"    providers of shared resources, that meet a particular request for resources"},{"line_number":2272,"context_line":"    and traits."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_02b30bec","line":2269,"range":{"start_line":2269,"start_character":6,"end_line":2269,"end_character":27},"in_reply_to":"7f231b9d_c271a10e","updated":"2017-06-13 23:01:58.000000000","message":"How about ProviderAllocationCandidates?","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"af908ab2967e725e49c4644830347317fcc3af23","unresolved":false,"context_lines":[{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":""},{"line_number":2268,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2269,"context_line":"class PlacementAlternatives(base.NovaObject):"},{"line_number":2270,"context_line":"    \"\"\"The PlacementAlternatives object describes resource providers, including"},{"line_number":2271,"context_line":"    providers of shared resources, that meet a particular request for resources"},{"line_number":2272,"context_line":"    and traits."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_2b6eed00","line":2269,"range":{"start_line":2269,"start_character":6,"end_line":2269,"end_character":27},"in_reply_to":"7f231b9d_c271a10e","updated":"2017-06-13 18:50:36.000000000","message":"Scheduler will never see this, AFAIK. This is just internal modeling. Since I think that Jay is expecting to call the api \"alternatives\" this seems like a fine name for it.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea36150e05ec3df4f71cee884d58b8319cf074d8","unresolved":false,"context_lines":[{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":""},{"line_number":2268,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2269,"context_line":"class PlacementAlternatives(base.NovaObject):"},{"line_number":2270,"context_line":"    \"\"\"The PlacementAlternatives object describes resource providers, including"},{"line_number":2271,"context_line":"    providers of shared resources, that meet a particular request for resources"},{"line_number":2272,"context_line":"    and traits."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_42b903ca","line":2269,"range":{"start_line":2269,"start_character":6,"end_line":2269,"end_character":27},"in_reply_to":"7f231b9d_d693a0a2","updated":"2017-06-13 23:01:58.000000000","message":"Do you have a suggestion for a better name?","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"80bf75ccd3637e326e8933393310e393e669d022","unresolved":false,"context_lines":[{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":""},{"line_number":2268,"context_line":"@base.NovaObjectRegistry.register_if(False)"},{"line_number":2269,"context_line":"class PlacementAlternatives(base.NovaObject):"},{"line_number":2270,"context_line":"    \"\"\"The PlacementAlternatives object describes resource providers, including"},{"line_number":2271,"context_line":"    providers of shared resources, that meet a particular request for resources"},{"line_number":2272,"context_line":"    and traits."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_4a33ce62","line":2269,"range":{"start_line":2269,"start_character":6,"end_line":2269,"end_character":27},"in_reply_to":"7f231b9d_dc947739","updated":"2017-06-19 17:49:25.000000000","message":"Done","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2275,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":2276,"context_line":""},{"line_number":2277,"context_line":"    fields \u003d {"},{"line_number":2278,"context_line":"        # A collection of allocation possibilities that can be attempted by the"},{"line_number":2279,"context_line":"        # caller that would, at the time of calling, meet the requested"},{"line_number":2280,"context_line":"        # resource and trait constraints"},{"line_number":2281,"context_line":"        \u0027allocation_requests\u0027: fields.ListOfObjectsField(\u0027AllocationRequest\u0027),"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_fcf2936f","line":2278,"updated":"2017-06-16 18:37:16.000000000","message":"Thanks for documenting the fields. I\u0027ve always wished we had more documentation of the fields in our object and data models.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2277,"context_line":"    fields \u003d {"},{"line_number":2278,"context_line":"        # A collection of allocation possibilities that can be attempted by the"},{"line_number":2279,"context_line":"        # caller that would, at the time of calling, meet the requested"},{"line_number":2280,"context_line":"        # resource and trait constraints"},{"line_number":2281,"context_line":"        \u0027allocation_requests\u0027: fields.ListOfObjectsField(\u0027AllocationRequest\u0027),"},{"line_number":2282,"context_line":"        # Information about usage and inventory that relate to any provider"},{"line_number":2283,"context_line":"        # contained in any of the AllocationRequest objects in the"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_5c018737","line":2280,"range":{"start_line":2280,"start_character":23,"end_line":2280,"end_character":28},"updated":"2017-06-16 18:37:16.000000000","message":"Where are the traits used here? They aren\u0027t in the AllocationRequest objects or AllocationRequestResource objects. I guess those are correlated on the summary object?","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"80bf75ccd3637e326e8933393310e393e669d022","unresolved":false,"context_lines":[{"line_number":2277,"context_line":"    fields \u003d {"},{"line_number":2278,"context_line":"        # A collection of allocation possibilities that can be attempted by the"},{"line_number":2279,"context_line":"        # caller that would, at the time of calling, meet the requested"},{"line_number":2280,"context_line":"        # resource and trait constraints"},{"line_number":2281,"context_line":"        \u0027allocation_requests\u0027: fields.ListOfObjectsField(\u0027AllocationRequest\u0027),"},{"line_number":2282,"context_line":"        # Information about usage and inventory that relate to any provider"},{"line_number":2283,"context_line":"        # contained in any of the AllocationRequest objects in the"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_ea3bba34","line":2280,"range":{"start_line":2280,"start_character":23,"end_line":2280,"end_character":28},"in_reply_to":"7f231b9d_5c018737","updated":"2017-06-19 17:49:25.000000000","message":"Done. Removed.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2301,"context_line":"                         requested or be associated via aggregate to a provider"},{"line_number":2302,"context_line":"                         that shares this resource and has capacity for the"},{"line_number":2303,"context_line":"                         requested amount."},{"line_number":2304,"context_line":"            \u0027required\u0027: A list of trait strings that must be found on one of"},{"line_number":2305,"context_line":"                        the resource providers included in each allocation"},{"line_number":2306,"context_line":"                        request contained within the returned"},{"line_number":2307,"context_line":"                        PlacementAlternative object."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_bf588df9","line":2304,"range":{"start_line":2304,"start_character":13,"end_line":2304,"end_character":21},"updated":"2017-06-16 18:37:16.000000000","message":"nit: I\u0027d call this traits or required_traits, since it\u0027s hard to know what this means by \"required\" otherwise.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3825f053695bc3c9c3ab96866d1894ddbec3f7a7","unresolved":false,"context_lines":[{"line_number":2301,"context_line":"                         requested or be associated via aggregate to a provider"},{"line_number":2302,"context_line":"                         that shares this resource and has capacity for the"},{"line_number":2303,"context_line":"                         requested amount."},{"line_number":2304,"context_line":"            \u0027required\u0027: A list of trait strings that must be found on one of"},{"line_number":2305,"context_line":"                        the resource providers included in each allocation"},{"line_number":2306,"context_line":"                        request contained within the returned"},{"line_number":2307,"context_line":"                        PlacementAlternative object."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_90a01e44","line":2304,"range":{"start_line":2304,"start_character":13,"end_line":2304,"end_character":21},"in_reply_to":"7f231b9d_42751cf9","updated":"2017-06-16 20:09:22.000000000","message":"Maybe we should not even mention this traits stuff in the docstring at this point? Or put a TODO in here somewhere to make it more clear that this is currently not supporting filtering by traits.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"80bf75ccd3637e326e8933393310e393e669d022","unresolved":false,"context_lines":[{"line_number":2301,"context_line":"                         requested or be associated via aggregate to a provider"},{"line_number":2302,"context_line":"                         that shares this resource and has capacity for the"},{"line_number":2303,"context_line":"                         requested amount."},{"line_number":2304,"context_line":"            \u0027required\u0027: A list of trait strings that must be found on one of"},{"line_number":2305,"context_line":"                        the resource providers included in each allocation"},{"line_number":2306,"context_line":"                        request contained within the returned"},{"line_number":2307,"context_line":"                        PlacementAlternative object."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_4a6bceef","line":2304,"range":{"start_line":2304,"start_character":13,"end_line":2304,"end_character":21},"in_reply_to":"7f231b9d_90a01e44","updated":"2017-06-19 17:49:25.000000000","message":"Done","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3753f372babd1bd4ca5bcd10ec4739c5d229b0db","unresolved":false,"context_lines":[{"line_number":2301,"context_line":"                         requested or be associated via aggregate to a provider"},{"line_number":2302,"context_line":"                         that shares this resource and has capacity for the"},{"line_number":2303,"context_line":"                         requested amount."},{"line_number":2304,"context_line":"            \u0027required\u0027: A list of trait strings that must be found on one of"},{"line_number":2305,"context_line":"                        the resource providers included in each allocation"},{"line_number":2306,"context_line":"                        request contained within the returned"},{"line_number":2307,"context_line":"                        PlacementAlternative object."}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_42751cf9","line":2304,"range":{"start_line":2304,"start_character":13,"end_line":2304,"end_character":21},"in_reply_to":"7f231b9d_bf588df9","updated":"2017-06-16 18:51:39.000000000","message":"Will do when I add traits in here ;)","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ca040cb3ec37d01da120cc07e5f346cf849f5b52","unresolved":false,"context_lines":[{"line_number":2316,"context_line":""},{"line_number":2317,"context_line":"    @staticmethod"},{"line_number":2318,"context_line":"    @db_api.api_context_manager.reader"},{"line_number":2319,"context_line":"    def _get_by_filters(context, filters):"},{"line_number":2320,"context_line":"        # We first get the list of \"root providers\" that either have the"},{"line_number":2321,"context_line":"        # requested resources/traits or are associated with the providers that"},{"line_number":2322,"context_line":"        # share one or more of the requested resource(s)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_50dbff19","line":2319,"updated":"2017-06-14 11:11:57.000000000","message":"There\u0027s going to be some overlap between this and the get_all_by_filters on ResourceProviderList. I hope that at some point (not necessarily immediately) we can dry up the duplication to some composable functions which create the SQL required for a particular output.\n\nEspecially as we have 3 or maybe 4 different threads of code which are touching on \"getting some resource providers and their capacity\": shared providers, nested providers, providers-by-traits, and these allocation requests.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2316,"context_line":""},{"line_number":2317,"context_line":"    @staticmethod"},{"line_number":2318,"context_line":"    @db_api.api_context_manager.reader"},{"line_number":2319,"context_line":"    def _get_by_filters(context, filters):"},{"line_number":2320,"context_line":"        # We first get the list of \"root providers\" that either have the"},{"line_number":2321,"context_line":"        # requested resources/traits or are associated with the providers that"},{"line_number":2322,"context_line":"        # share one or more of the requested resource(s)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_bf3f6d85","line":2319,"in_reply_to":"7f231b9d_50dbff19","updated":"2017-06-16 18:37:16.000000000","message":"+1 to helper model builders. We could leave a TODO if we think there is something common we can pull out. Although _get_all_with_shared and _get_providers_with_shared_capacity do some heavy lifting here.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0eb69a3a61f44a7978df7192d268406d5b05dbee","unresolved":false,"context_lines":[{"line_number":2316,"context_line":""},{"line_number":2317,"context_line":"    @staticmethod"},{"line_number":2318,"context_line":"    @db_api.api_context_manager.reader"},{"line_number":2319,"context_line":"    def _get_by_filters(context, filters):"},{"line_number":2320,"context_line":"        # We first get the list of \"root providers\" that either have the"},{"line_number":2321,"context_line":"        # requested resources/traits or are associated with the providers that"},{"line_number":2322,"context_line":"        # share one or more of the requested resource(s)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_a2299037","line":2319,"in_reply_to":"7f231b9d_50dbff19","updated":"2017-06-16 18:23:06.000000000","message":"ack","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"80bf75ccd3637e326e8933393310e393e669d022","unresolved":false,"context_lines":[{"line_number":2316,"context_line":""},{"line_number":2317,"context_line":"    @staticmethod"},{"line_number":2318,"context_line":"    @db_api.api_context_manager.reader"},{"line_number":2319,"context_line":"    def _get_by_filters(context, filters):"},{"line_number":2320,"context_line":"        # We first get the list of \"root providers\" that either have the"},{"line_number":2321,"context_line":"        # requested resources/traits or are associated with the providers that"},{"line_number":2322,"context_line":"        # share one or more of the requested resource(s)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_aa526233","line":2319,"in_reply_to":"7f231b9d_bf3f6d85","updated":"2017-06-19 17:49:25.000000000","message":"Done","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2341,"context_line":"            rc_id: _get_providers_with_shared_capacity(context, rc_id, amount)"},{"line_number":2342,"context_line":"            for rc_id, amount in resources.items()"},{"line_number":2343,"context_line":"        }"},{"line_number":2344,"context_line":"        all_rp_ids \u003d set(roots)"},{"line_number":2345,"context_line":"        for rps in sharing_providers.values():"},{"line_number":2346,"context_line":"            all_rp_ids |\u003d set(rps)"},{"line_number":2347,"context_line":""},{"line_number":2348,"context_line":"        # Grab usage summaries for each provider (local or sharing) and"},{"line_number":2349,"context_line":"        # resource class requested"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_5f53b96b","line":2346,"range":{"start_line":2344,"start_character":8,"end_line":2346,"end_character":34},"updated":"2017-06-16 18:37:16.000000000","message":"A comment here would be helpful.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"80bf75ccd3637e326e8933393310e393e669d022","unresolved":false,"context_lines":[{"line_number":2341,"context_line":"            rc_id: _get_providers_with_shared_capacity(context, rc_id, amount)"},{"line_number":2342,"context_line":"            for rc_id, amount in resources.items()"},{"line_number":2343,"context_line":"        }"},{"line_number":2344,"context_line":"        all_rp_ids \u003d set(roots)"},{"line_number":2345,"context_line":"        for rps in sharing_providers.values():"},{"line_number":2346,"context_line":"            all_rp_ids |\u003d set(rps)"},{"line_number":2347,"context_line":""},{"line_number":2348,"context_line":"        # Grab usage summaries for each provider (local or sharing) and"},{"line_number":2349,"context_line":"        # resource class requested"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_4a12ae63","line":2346,"range":{"start_line":2344,"start_character":8,"end_line":2346,"end_character":34},"in_reply_to":"7f231b9d_5f53b96b","updated":"2017-06-19 17:49:25.000000000","message":"Done","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2361,"context_line":"            u_rp_id \u003d usage[\u0027resource_provider_id\u0027]"},{"line_number":2362,"context_line":"            u_rp_uuid \u003d usage[\u0027resource_provider_uuid\u0027]"},{"line_number":2363,"context_line":"            u_rc_id \u003d usage[\u0027resource_class_id\u0027]"},{"line_number":2364,"context_line":"            used \u003d usage[\u0027used\u0027] or 0"},{"line_number":2365,"context_line":"            allocation_ratio \u003d usage[\u0027allocation_ratio\u0027]"},{"line_number":2366,"context_line":"            capacity \u003d (usage[\u0027total\u0027] - usage[\u0027reserved\u0027]) * allocation_ratio"},{"line_number":2367,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_c26eccc7","line":2364,"range":{"start_line":2364,"start_character":19,"end_line":2364,"end_character":37},"updated":"2017-06-16 18:37:16.000000000","message":"Could used be None or less than 0?","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"80bf75ccd3637e326e8933393310e393e669d022","unresolved":false,"context_lines":[{"line_number":2361,"context_line":"            u_rp_id \u003d usage[\u0027resource_provider_id\u0027]"},{"line_number":2362,"context_line":"            u_rp_uuid \u003d usage[\u0027resource_provider_uuid\u0027]"},{"line_number":2363,"context_line":"            u_rc_id \u003d usage[\u0027resource_class_id\u0027]"},{"line_number":2364,"context_line":"            used \u003d usage[\u0027used\u0027] or 0"},{"line_number":2365,"context_line":"            allocation_ratio \u003d usage[\u0027allocation_ratio\u0027]"},{"line_number":2366,"context_line":"            capacity \u003d (usage[\u0027total\u0027] - usage[\u0027reserved\u0027]) * allocation_ratio"},{"line_number":2367,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_1d7f6266","line":2364,"range":{"start_line":2364,"start_character":19,"end_line":2364,"end_character":37},"in_reply_to":"7f231b9d_c26eccc7","updated":"2017-06-19 17:49:25.000000000","message":"nah, only 0.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2363,"context_line":"            u_rc_id \u003d usage[\u0027resource_class_id\u0027]"},{"line_number":2364,"context_line":"            used \u003d usage[\u0027used\u0027] or 0"},{"line_number":2365,"context_line":"            allocation_ratio \u003d usage[\u0027allocation_ratio\u0027]"},{"line_number":2366,"context_line":"            capacity \u003d (usage[\u0027total\u0027] - usage[\u0027reserved\u0027]) * allocation_ratio"},{"line_number":2367,"context_line":""},{"line_number":2368,"context_line":"            summary \u003d summaries.get(u_rp_id)"},{"line_number":2369,"context_line":"            if not summary:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_c255acfb","line":2366,"range":{"start_line":2366,"start_character":23,"end_line":2366,"end_character":78},"updated":"2017-06-16 18:37:16.000000000","message":"Does this need to be cast to an int like in the Inventory object?\n\nhttps://github.com/openstack/nova/blob/master/nova/objects/resource_provider.py#L1376","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"80bf75ccd3637e326e8933393310e393e669d022","unresolved":false,"context_lines":[{"line_number":2363,"context_line":"            u_rc_id \u003d usage[\u0027resource_class_id\u0027]"},{"line_number":2364,"context_line":"            used \u003d usage[\u0027used\u0027] or 0"},{"line_number":2365,"context_line":"            allocation_ratio \u003d usage[\u0027allocation_ratio\u0027]"},{"line_number":2366,"context_line":"            capacity \u003d (usage[\u0027total\u0027] - usage[\u0027reserved\u0027]) * allocation_ratio"},{"line_number":2367,"context_line":""},{"line_number":2368,"context_line":"            summary \u003d summaries.get(u_rp_id)"},{"line_number":2369,"context_line":"            if not summary:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_fdc70695","line":2366,"range":{"start_line":2366,"start_character":23,"end_line":2366,"end_character":78},"in_reply_to":"7f231b9d_c255acfb","updated":"2017-06-19 17:49:25.000000000","message":"Good point. Done.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2380,"context_line":"            }"},{"line_number":2381,"context_line":""},{"line_number":2382,"context_line":"        # Next, build up a list of allocation requests. These allocation"},{"line_number":2383,"context_line":"        # requests are dicts, keyed by resource class name, of resource"},{"line_number":2384,"context_line":"        # provider UUIDs and amounts to consume from that resource provider"},{"line_number":2385,"context_line":"        alloc_request_objs \u003d []"},{"line_number":2386,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_42be3cff","line":2383,"range":{"start_line":2383,"start_character":23,"end_line":2383,"end_character":28},"updated":"2017-06-16 18:37:16.000000000","message":"They are AllocationRequest objects.","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3753f372babd1bd4ca5bcd10ec4739c5d229b0db","unresolved":false,"context_lines":[{"line_number":2380,"context_line":"            }"},{"line_number":2381,"context_line":""},{"line_number":2382,"context_line":"        # Next, build up a list of allocation requests. These allocation"},{"line_number":2383,"context_line":"        # requests are dicts, keyed by resource class name, of resource"},{"line_number":2384,"context_line":"        # provider UUIDs and amounts to consume from that resource provider"},{"line_number":2385,"context_line":"        alloc_request_objs \u003d []"},{"line_number":2386,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_424e3cc1","line":2383,"range":{"start_line":2383,"start_character":23,"end_line":2383,"end_character":28},"in_reply_to":"7f231b9d_42be3cff","updated":"2017-06-16 18:51:39.000000000","message":"Done","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"00f9e47b525965f1f5237542e547b31a61de5a49","unresolved":false,"context_lines":[{"line_number":2437,"context_line":"                )"},{"line_number":2438,"context_line":"                alloc_request_objs.append(req_obj)"},{"line_number":2439,"context_line":""},{"line_number":2440,"context_line":"            if not sharing_resource_requests:"},{"line_number":2441,"context_line":"                continue"},{"line_number":2442,"context_line":""},{"line_number":2443,"context_line":"            # add an AllocationRequest that includes local resources from the"},{"line_number":2444,"context_line":"            # root provider and shared resources from each sharing provider of"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_221580e5","line":2441,"range":{"start_line":2440,"start_character":12,"end_line":2441,"end_character":24},"updated":"2017-06-16 18:37:16.000000000","message":"comment? I guess this just means, if has_all was true and there are no requests for shared resources, then we\u0027ve already go our AllocationRequests for this root provider? I guess I was expecting an else after the \"if has_all\".","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3753f372babd1bd4ca5bcd10ec4739c5d229b0db","unresolved":false,"context_lines":[{"line_number":2437,"context_line":"                )"},{"line_number":2438,"context_line":"                alloc_request_objs.append(req_obj)"},{"line_number":2439,"context_line":""},{"line_number":2440,"context_line":"            if not sharing_resource_requests:"},{"line_number":2441,"context_line":"                continue"},{"line_number":2442,"context_line":""},{"line_number":2443,"context_line":"            # add an AllocationRequest that includes local resources from the"},{"line_number":2444,"context_line":"            # root provider and shared resources from each sharing provider of"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_c2b6cc8a","line":2441,"range":{"start_line":2440,"start_character":12,"end_line":2441,"end_character":24},"in_reply_to":"7f231b9d_221580e5","updated":"2017-06-16 18:51:39.000000000","message":"Done","commit_id":"a9b7bb06739de39db89c6ac7b77ee3edaa45597c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9ced800a9a2d9013fe0bda511e8b8b166aff4aed","unresolved":false,"context_lines":[{"line_number":2173,"context_line":"        return base.obj_make_list(context, cls(context), Trait, db_traits)"},{"line_number":2174,"context_line":""},{"line_number":2175,"context_line":""},{"line_number":2176,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":2177,"context_line":"class AllocationRequestResource(base.NovaObject):"},{"line_number":2178,"context_line":"    # 1.0: Initial version"},{"line_number":2179,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_7999c3ce","line":2176,"updated":"2017-06-19 18:25:47.000000000","message":"I replied to this question in IRC, maybe Jay didn\u0027t see. These should not be registered. The register_if(False) we had before was correct. We need to build the object and properties, but not register it for RPC.","commit_id":"13518594fc14becfacf863ecc4983f290b5aa680"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0c6f39e3f8b4727b2a0da951a9411ecf928ebc62","unresolved":false,"context_lines":[{"line_number":2173,"context_line":"        return base.obj_make_list(context, cls(context), Trait, db_traits)"},{"line_number":2174,"context_line":""},{"line_number":2175,"context_line":""},{"line_number":2176,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":2177,"context_line":"class AllocationRequestResource(base.NovaObject):"},{"line_number":2178,"context_line":"    # 1.0: Initial version"},{"line_number":2179,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_363918f2","line":2176,"range":{"start_line":2176,"start_character":25,"end_line":2176,"end_character":33},"updated":"2017-06-19 18:25:21.000000000","message":"Why are these being registered now? They weren\u0027t in PS3. What changed?","commit_id":"13518594fc14becfacf863ecc4983f290b5aa680"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"2c7ece1828fd7c1153e88fd3cc99214251b4957d","unresolved":false,"context_lines":[{"line_number":2173,"context_line":"        return base.obj_make_list(context, cls(context), Trait, db_traits)"},{"line_number":2174,"context_line":""},{"line_number":2175,"context_line":""},{"line_number":2176,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":2177,"context_line":"class AllocationRequestResource(base.NovaObject):"},{"line_number":2178,"context_line":"    # 1.0: Initial version"},{"line_number":2179,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_79bae3e1","line":2176,"in_reply_to":"7f231b9d_7999c3ce","updated":"2017-06-19 18:37:31.000000000","message":"I registered them so I could use objects.AllocationCandidates in the handler and fixtures. All the other objects in the file are registered anyway, so I thought meh..","commit_id":"13518594fc14becfacf863ecc4983f290b5aa680"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0c6f39e3f8b4727b2a0da951a9411ecf928ebc62","unresolved":false,"context_lines":[{"line_number":2297,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":2298,"context_line":"class AllocationCandidates(base.NovaObject):"},{"line_number":2299,"context_line":"    \"\"\"The AllocationCandidates object is a collection of possible allocations"},{"line_number":2300,"context_line":"    that match some request for resources and traits, along with some summary"},{"line_number":2301,"context_line":"    information about the resource providers involved in these allocation"},{"line_number":2302,"context_line":"    candidates."},{"line_number":2303,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_96022c0b","line":2300,"range":{"start_line":2300,"start_character":42,"end_line":2300,"end_character":52},"updated":"2017-06-19 18:25:21.000000000","message":"nit: you removed the usage of traits since PS3 except this - since we don\u0027t support filtering on traits yet, I\u0027d probably remove this.","commit_id":"13518594fc14becfacf863ecc4983f290b5aa680"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"2c7ece1828fd7c1153e88fd3cc99214251b4957d","unresolved":false,"context_lines":[{"line_number":2297,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":2298,"context_line":"class AllocationCandidates(base.NovaObject):"},{"line_number":2299,"context_line":"    \"\"\"The AllocationCandidates object is a collection of possible allocations"},{"line_number":2300,"context_line":"    that match some request for resources and traits, along with some summary"},{"line_number":2301,"context_line":"    information about the resource providers involved in these allocation"},{"line_number":2302,"context_line":"    candidates."},{"line_number":2303,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_59bf27d0","line":2300,"range":{"start_line":2300,"start_character":42,"end_line":2300,"end_character":52},"in_reply_to":"7f231b9d_96022c0b","updated":"2017-06-19 18:37:31.000000000","message":"Done","commit_id":"13518594fc14becfacf863ecc4983f290b5aa680"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0c6f39e3f8b4727b2a0da951a9411ecf928ebc62","unresolved":false,"context_lines":[{"line_number":2317,"context_line":""},{"line_number":2318,"context_line":"    @classmethod"},{"line_number":2319,"context_line":"    def get_by_filters(cls, context, filters):"},{"line_number":2320,"context_line":"        \"\"\"Returns a PlacementAlternatives object containing all resource"},{"line_number":2321,"context_line":"        providers matching a set of supplied resource constraints, with a set"},{"line_number":2322,"context_line":"        of allocation requests constructed from that list of resource"},{"line_number":2323,"context_line":"        providers."}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_59796791","line":2320,"range":{"start_line":2320,"start_character":21,"end_line":2320,"end_character":42},"updated":"2017-06-19 18:25:21.000000000","message":"old name","commit_id":"13518594fc14becfacf863ecc4983f290b5aa680"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"2c7ece1828fd7c1153e88fd3cc99214251b4957d","unresolved":false,"context_lines":[{"line_number":2317,"context_line":""},{"line_number":2318,"context_line":"    @classmethod"},{"line_number":2319,"context_line":"    def get_by_filters(cls, context, filters):"},{"line_number":2320,"context_line":"        \"\"\"Returns a PlacementAlternatives object containing all resource"},{"line_number":2321,"context_line":"        providers matching a set of supplied resource constraints, with a set"},{"line_number":2322,"context_line":"        of allocation requests constructed from that list of resource"},{"line_number":2323,"context_line":"        providers."}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_39b46bf2","line":2320,"range":{"start_line":2320,"start_character":21,"end_line":2320,"end_character":42},"in_reply_to":"7f231b9d_59796791","updated":"2017-06-19 18:37:31.000000000","message":"Done","commit_id":"13518594fc14becfacf863ecc4983f290b5aa680"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0c6f39e3f8b4727b2a0da951a9411ecf928ebc62","unresolved":false,"context_lines":[{"line_number":2395,"context_line":"            u_rp_id \u003d usage[\u0027resource_provider_id\u0027]"},{"line_number":2396,"context_line":"            u_rp_uuid \u003d usage[\u0027resource_provider_uuid\u0027]"},{"line_number":2397,"context_line":"            u_rc_id \u003d usage[\u0027resource_class_id\u0027]"},{"line_number":2398,"context_line":"            used \u003d usage[\u0027used\u0027] or 0"},{"line_number":2399,"context_line":"            allocation_ratio \u003d usage[\u0027allocation_ratio\u0027]"},{"line_number":2400,"context_line":"            cap \u003d int((usage[\u0027total\u0027] - usage[\u0027reserved\u0027]) * allocation_ratio)"},{"line_number":2401,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_39558bfb","line":2398,"range":{"start_line":2398,"start_character":19,"end_line":2398,"end_character":37},"updated":"2017-06-19 18:25:21.000000000","message":"Still not sure why we need the \"or 0\" here if we expect usage[\u0027uuid\u0027] to be set and is not None or less than 0.","commit_id":"13518594fc14becfacf863ecc4983f290b5aa680"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"2c7ece1828fd7c1153e88fd3cc99214251b4957d","unresolved":false,"context_lines":[{"line_number":2395,"context_line":"            u_rp_id \u003d usage[\u0027resource_provider_id\u0027]"},{"line_number":2396,"context_line":"            u_rp_uuid \u003d usage[\u0027resource_provider_uuid\u0027]"},{"line_number":2397,"context_line":"            u_rc_id \u003d usage[\u0027resource_class_id\u0027]"},{"line_number":2398,"context_line":"            used \u003d usage[\u0027used\u0027] or 0"},{"line_number":2399,"context_line":"            allocation_ratio \u003d usage[\u0027allocation_ratio\u0027]"},{"line_number":2400,"context_line":"            cap \u003d int((usage[\u0027total\u0027] - usage[\u0027reserved\u0027]) * allocation_ratio)"},{"line_number":2401,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_b9c75b65","line":2398,"range":{"start_line":2398,"start_character":19,"end_line":2398,"end_character":37},"in_reply_to":"7f231b9d_39558bfb","updated":"2017-06-19 18:37:31.000000000","message":"Because usage[\u0027used\u0027] may be None (it\u0027s a LEFT JOIN in the usages query...)","commit_id":"13518594fc14becfacf863ecc4983f290b5aa680"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cfa86aa636da75c3632d35284f8b0fe829bfd447","unresolved":false,"context_lines":[{"line_number":2297,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":2298,"context_line":"class AllocationCandidates(base.NovaObject):"},{"line_number":2299,"context_line":"    \"\"\"The AllocationCandidates object is a collection of possible allocations"},{"line_number":2300,"context_line":"    that match some request for resources and traits, along with some summary"},{"line_number":2301,"context_line":"    information about the resource providers involved in these allocation"},{"line_number":2302,"context_line":"    candidates."},{"line_number":2303,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"7f231b9d_7960a336","line":2300,"range":{"start_line":2300,"start_character":42,"end_line":2300,"end_character":52},"updated":"2017-06-19 18:48:10.000000000","message":"Should remove this part about traits since we don\u0027t support filtering on traits yet.","commit_id":"0710a49f90a3dc91b47570396b1ddefbb00193d3"}]}
