)]}'
{"nova/objects/resource_provider.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"49ce363253bf39614f460a2d7595f86791d9f57e","unresolved":false,"context_lines":[{"line_number":2586,"context_line":"    \"\"\""},{"line_number":2587,"context_line":"    res_requests \u003d collections.defaultdict(list)"},{"line_number":2588,"context_line":"    for rc_id in sharing.keys():"},{"line_number":2589,"context_line":"        for rp_id in sharing[rc_id]:"},{"line_number":2590,"context_line":"            summary \u003d summaries[rp_id]"},{"line_number":2591,"context_line":"            rp_uuid \u003d summary.resource_provider.uuid"},{"line_number":2592,"context_line":"            res_req \u003d AllocationRequestResource("},{"line_number":2593,"context_line":"                ctx,"},{"line_number":2594,"context_line":"                resource_provider\u003dResourceProvider(ctx, uuid\u003drp_uuid),"},{"line_number":2595,"context_line":"                resource_class\u003d_RC_CACHE.string_from_id(rc_id),"},{"line_number":2596,"context_line":"                amount\u003drequested_resources[rc_id],"},{"line_number":2597,"context_line":"            )"},{"line_number":2598,"context_line":"            res_requests[rc_id].append(res_req)"},{"line_number":2599,"context_line":"    return res_requests"},{"line_number":2600,"context_line":""},{"line_number":2601,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_e2c91125","line":2598,"range":{"start_line":2589,"start_character":0,"end_line":2598,"end_character":47},"updated":"2017-11-01 22:39:43.000000000","message":"Can\u0027t this chunk be replaced by a call to the new _allocation_request_for_provider method?","commit_id":"8e8d16e08d652c6ad885c4f90607aece62b1a089"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8b26a40d3f9912e4d6888d241efc5e39c5b89c8b","unresolved":false,"context_lines":[{"line_number":2586,"context_line":"    \"\"\""},{"line_number":2587,"context_line":"    res_requests \u003d collections.defaultdict(list)"},{"line_number":2588,"context_line":"    for rc_id in sharing.keys():"},{"line_number":2589,"context_line":"        for rp_id in sharing[rc_id]:"},{"line_number":2590,"context_line":"            summary \u003d summaries[rp_id]"},{"line_number":2591,"context_line":"            rp_uuid \u003d summary.resource_provider.uuid"},{"line_number":2592,"context_line":"            res_req \u003d AllocationRequestResource("},{"line_number":2593,"context_line":"                ctx,"},{"line_number":2594,"context_line":"                resource_provider\u003dResourceProvider(ctx, uuid\u003drp_uuid),"},{"line_number":2595,"context_line":"                resource_class\u003d_RC_CACHE.string_from_id(rc_id),"},{"line_number":2596,"context_line":"                amount\u003drequested_resources[rc_id],"},{"line_number":2597,"context_line":"            )"},{"line_number":2598,"context_line":"            res_requests[rc_id].append(res_req)"},{"line_number":2599,"context_line":"    return res_requests"},{"line_number":2600,"context_line":""},{"line_number":2601,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_5d0d6633","line":2598,"range":{"start_line":2589,"start_character":0,"end_line":2598,"end_character":47},"in_reply_to":"3f4b6375_e2c91125","updated":"2017-11-01 22:56:40.000000000","message":"No, this is returning the set of *parts* of an allocation request that represent the resources being shared with another provider. _allocation_request_for_provider() constructs a *full* allocation request for ALL requested resources from a single provider.","commit_id":"8e8d16e08d652c6ad885c4f90607aece62b1a089"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"49ce363253bf39614f460a2d7595f86791d9f57e","unresolved":false,"context_lines":[{"line_number":2798,"context_line":"            # root provider and shared resources from each sharing provider of"},{"line_number":2799,"context_line":"            # that resource class"},{"line_number":2800,"context_line":"            non_shared_resources \u003d local_resources - shared_resources"},{"line_number":2801,"context_line":"            non_shared_requests \u003d ["},{"line_number":2802,"context_line":"                AllocationRequestResource("},{"line_number":2803,"context_line":"                    context,"},{"line_number":2804,"context_line":"                    resource_provider\u003dResourceProvider("},{"line_number":2805,"context_line":"                        context,"},{"line_number":2806,"context_line":"                        uuid\u003drp_uuid,"},{"line_number":2807,"context_line":"                    ),"},{"line_number":2808,"context_line":"                    resource_class\u003d_RC_CACHE.string_from_id(rc_id),"},{"line_number":2809,"context_line":"                    amount\u003damount,"},{"line_number":2810,"context_line":"                ) for rc_id, amount in resources.items()"},{"line_number":2811,"context_line":"                if rc_id in non_shared_resources"},{"line_number":2812,"context_line":"            ]"},{"line_number":2813,"context_line":"            sharing_request_tuples \u003d zip("},{"line_number":2814,"context_line":"                sharing_resource_requests[shared_rc_id]"},{"line_number":2815,"context_line":"                for shared_rc_id in shared_resources"},{"line_number":2816,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_42e465ac","line":2813,"range":{"start_line":2801,"start_character":0,"end_line":2813,"end_character":1},"updated":"2017-11-01 22:39:43.000000000","message":"Can this be replaced by a call to the above as well?","commit_id":"8e8d16e08d652c6ad885c4f90607aece62b1a089"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"29b3791471a7b44d3926fbfbd95e7bdb5c6ced4b","unresolved":false,"context_lines":[{"line_number":2798,"context_line":"            # root provider and shared resources from each sharing provider of"},{"line_number":2799,"context_line":"            # that resource class"},{"line_number":2800,"context_line":"            non_shared_resources \u003d local_resources - shared_resources"},{"line_number":2801,"context_line":"            non_shared_requests \u003d ["},{"line_number":2802,"context_line":"                AllocationRequestResource("},{"line_number":2803,"context_line":"                    context,"},{"line_number":2804,"context_line":"                    resource_provider\u003dResourceProvider("},{"line_number":2805,"context_line":"                        context,"},{"line_number":2806,"context_line":"                        uuid\u003drp_uuid,"},{"line_number":2807,"context_line":"                    ),"},{"line_number":2808,"context_line":"                    resource_class\u003d_RC_CACHE.string_from_id(rc_id),"},{"line_number":2809,"context_line":"                    amount\u003damount,"},{"line_number":2810,"context_line":"                ) for rc_id, amount in resources.items()"},{"line_number":2811,"context_line":"                if rc_id in non_shared_resources"},{"line_number":2812,"context_line":"            ]"},{"line_number":2813,"context_line":"            sharing_request_tuples \u003d zip("},{"line_number":2814,"context_line":"                sharing_resource_requests[shared_rc_id]"},{"line_number":2815,"context_line":"                for shared_rc_id in shared_resources"},{"line_number":2816,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_49421a6a","line":2813,"range":{"start_line":2801,"start_character":0,"end_line":2813,"end_character":1},"in_reply_to":"3f4b6375_40ea040f","updated":"2017-11-03 14:48:38.000000000","message":"ack, good idea. I\u0027ll do that.","commit_id":"8e8d16e08d652c6ad885c4f90607aece62b1a089"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8b26a40d3f9912e4d6888d241efc5e39c5b89c8b","unresolved":false,"context_lines":[{"line_number":2798,"context_line":"            # root provider and shared resources from each sharing provider of"},{"line_number":2799,"context_line":"            # that resource class"},{"line_number":2800,"context_line":"            non_shared_resources \u003d local_resources - shared_resources"},{"line_number":2801,"context_line":"            non_shared_requests \u003d ["},{"line_number":2802,"context_line":"                AllocationRequestResource("},{"line_number":2803,"context_line":"                    context,"},{"line_number":2804,"context_line":"                    resource_provider\u003dResourceProvider("},{"line_number":2805,"context_line":"                        context,"},{"line_number":2806,"context_line":"                        uuid\u003drp_uuid,"},{"line_number":2807,"context_line":"                    ),"},{"line_number":2808,"context_line":"                    resource_class\u003d_RC_CACHE.string_from_id(rc_id),"},{"line_number":2809,"context_line":"                    amount\u003damount,"},{"line_number":2810,"context_line":"                ) for rc_id, amount in resources.items()"},{"line_number":2811,"context_line":"                if rc_id in non_shared_resources"},{"line_number":2812,"context_line":"            ]"},{"line_number":2813,"context_line":"            sharing_request_tuples \u003d zip("},{"line_number":2814,"context_line":"                sharing_resource_requests[shared_rc_id]"},{"line_number":2815,"context_line":"                for shared_rc_id in shared_resources"},{"line_number":2816,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_dd2a767c","line":2813,"range":{"start_line":2801,"start_character":0,"end_line":2813,"end_character":1},"in_reply_to":"3f4b6375_42e465ac","updated":"2017-11-01 22:56:40.000000000","message":"No... see above. The problem being solved here is creating a single allocation request that is composed of resources coming from *multiple* resource providers, not a single provider.","commit_id":"8e8d16e08d652c6ad885c4f90607aece62b1a089"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ca8cfe91337712184b04dce899714cf04c152c2d","unresolved":false,"context_lines":[{"line_number":2798,"context_line":"            # root provider and shared resources from each sharing provider of"},{"line_number":2799,"context_line":"            # that resource class"},{"line_number":2800,"context_line":"            non_shared_resources \u003d local_resources - shared_resources"},{"line_number":2801,"context_line":"            non_shared_requests \u003d ["},{"line_number":2802,"context_line":"                AllocationRequestResource("},{"line_number":2803,"context_line":"                    context,"},{"line_number":2804,"context_line":"                    resource_provider\u003dResourceProvider("},{"line_number":2805,"context_line":"                        context,"},{"line_number":2806,"context_line":"                        uuid\u003drp_uuid,"},{"line_number":2807,"context_line":"                    ),"},{"line_number":2808,"context_line":"                    resource_class\u003d_RC_CACHE.string_from_id(rc_id),"},{"line_number":2809,"context_line":"                    amount\u003damount,"},{"line_number":2810,"context_line":"                ) for rc_id, amount in resources.items()"},{"line_number":2811,"context_line":"                if rc_id in non_shared_resources"},{"line_number":2812,"context_line":"            ]"},{"line_number":2813,"context_line":"            sharing_request_tuples \u003d zip("},{"line_number":2814,"context_line":"                sharing_resource_requests[shared_rc_id]"},{"line_number":2815,"context_line":"                for shared_rc_id in shared_resources"},{"line_number":2816,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_40ea040f","line":2813,"range":{"start_line":2801,"start_character":0,"end_line":2813,"end_character":1},"in_reply_to":"3f4b6375_dd2a767c","updated":"2017-11-02 16:33:35.000000000","message":"Yup, I see.\n\nIf we factor out a @classmethod on AllocationRequestResource like:\n\n @classmethod\n def from_resources(cls, ctx, rp_uuid, resources):\n     return [\n         AllocationRequestResource(\n             ctx,\n             resource_provider\u003dResourceProvider(ctx, rp_uuid),\n             resource_class\u003d_RC_CACHE.string_from_id(rc_id),\n             amount\u003damount)\n         for rc_id, amount in resources.items()]\n\n...it could be used from all three places.","commit_id":"8e8d16e08d652c6ad885c4f90607aece62b1a089"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"09b3708f372f74eba38e438e7b85ec56845e3557","unresolved":false,"context_lines":[{"line_number":2603,"context_line":""},{"line_number":2604,"context_line":""},{"line_number":2605,"context_line":"def _allocation_request_for_provider(ctx, requested_resources, rp_uuid):"},{"line_number":2606,"context_line":"    \"\"\"Returns an AllocationRequest object contains AllocationRequestResource"},{"line_number":2607,"context_line":"    objects for each resource class in the supplied requested resources dict."},{"line_number":2608,"context_line":""},{"line_number":2609,"context_line":"    :param ctx: nova.context.Context object"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f485f77_2fc1f2e5","line":2606,"range":{"start_line":2606,"start_character":43,"end_line":2606,"end_character":51},"updated":"2017-11-18 20:52:02.000000000","message":"which contains?","commit_id":"ffdcd5d6e9de1511679e0c51a806ca8815c2d368"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"267600f19e9a8264c596efec555336b0abb6f26e","unresolved":false,"context_lines":[{"line_number":2603,"context_line":""},{"line_number":2604,"context_line":""},{"line_number":2605,"context_line":"def _allocation_request_for_provider(ctx, requested_resources, rp_uuid):"},{"line_number":2606,"context_line":"    \"\"\"Returns an AllocationRequest object contains AllocationRequestResource"},{"line_number":2607,"context_line":"    objects for each resource class in the supplied requested resources dict."},{"line_number":2608,"context_line":""},{"line_number":2609,"context_line":"    :param ctx: nova.context.Context object"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f485f77_e291ac48","line":2606,"range":{"start_line":2606,"start_character":43,"end_line":2606,"end_character":51},"in_reply_to":"1f485f77_2fc1f2e5","updated":"2017-11-19 15:22:12.000000000","message":"Done (in https://review.openstack.org/#/c/521189/)","commit_id":"ffdcd5d6e9de1511679e0c51a806ca8815c2d368"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"09b3708f372f74eba38e438e7b85ec56845e3557","unresolved":false,"context_lines":[{"line_number":2606,"context_line":"    \"\"\"Returns an AllocationRequest object contains AllocationRequestResource"},{"line_number":2607,"context_line":"    objects for each resource class in the supplied requested resources dict."},{"line_number":2608,"context_line":""},{"line_number":2609,"context_line":"    :param ctx: nova.context.Context object"},{"line_number":2610,"context_line":"    :param requested_resources: dict, keyed by resource class ID, of amounts"},{"line_number":2611,"context_line":"                                being requested for that resource class"},{"line_number":2612,"context_line":"    :param rp_uuid: UUID of the resource provider supplying the resources"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f485f77_0fc4f6f3","line":2609,"range":{"start_line":2609,"start_character":29,"end_line":2609,"end_character":36},"updated":"2017-11-18 20:52:02.000000000","message":"RequestContext","commit_id":"ffdcd5d6e9de1511679e0c51a806ca8815c2d368"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"267600f19e9a8264c596efec555336b0abb6f26e","unresolved":false,"context_lines":[{"line_number":2606,"context_line":"    \"\"\"Returns an AllocationRequest object contains AllocationRequestResource"},{"line_number":2607,"context_line":"    objects for each resource class in the supplied requested resources dict."},{"line_number":2608,"context_line":""},{"line_number":2609,"context_line":"    :param ctx: nova.context.Context object"},{"line_number":2610,"context_line":"    :param requested_resources: dict, keyed by resource class ID, of amounts"},{"line_number":2611,"context_line":"                                being requested for that resource class"},{"line_number":2612,"context_line":"    :param rp_uuid: UUID of the resource provider supplying the resources"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f485f77_c2947039","line":2609,"range":{"start_line":2609,"start_character":29,"end_line":2609,"end_character":36},"in_reply_to":"1f485f77_0fc4f6f3","updated":"2017-11-19 15:22:12.000000000","message":"Done (in https://review.openstack.org/#/c/521189/)","commit_id":"ffdcd5d6e9de1511679e0c51a806ca8815c2d368"}]}
