)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"8f36d05438aa1683ef3e171cd44db5dab67bbc7f","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The split-out _alloc_candidates_with_shared() is still a long, complex"},{"line_number":16,"context_line":"method and I\u0027ll continue trying to reduce the complexity there and break"},{"line_number":17,"context_line":"functions out of it further. I did uncomplicate a part of the function"},{"line_number":18,"context_line":"with use of the itertools.product() function to replace a faulty use of"},{"line_number":19,"context_line":"zip() against a list of allocation request resource lists."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Change-Id: Ibcfd1a28f36d3c7ccd26fcc6386207e4a25300d4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"1f485f77_006880b6","line":19,"range":{"start_line":17,"start_character":29,"end_line":19,"end_character":58},"updated":"2017-11-16 12:14:13.000000000","message":"Cool. So, why not tagging this patch with bug_1730730[1]?\nAgree that we can finally reach here from the top of this series from launchpad thanks to @efried\u0027s comment, but the change here looks crucial to me.\n[1] https://bugs.launchpad.net/nova/+bug/1730730","commit_id":"fd288cd609c3425016d7e8a1563e4d11c85f572e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"39b87221439746528343e8ac1773759d8f33f6e7","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The split-out _alloc_candidates_with_shared() is still a long, complex"},{"line_number":16,"context_line":"method and I\u0027ll continue trying to reduce the complexity there and break"},{"line_number":17,"context_line":"functions out of it further. I did uncomplicate a part of the function"},{"line_number":18,"context_line":"with use of the itertools.product() function to replace a faulty use of"},{"line_number":19,"context_line":"zip() against a list of allocation request resource lists."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Change-Id: Ibcfd1a28f36d3c7ccd26fcc6386207e4a25300d4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"1f485f77_d46a217f","line":19,"range":{"start_line":17,"start_character":29,"end_line":19,"end_character":58},"in_reply_to":"1f485f77_006880b6","updated":"2017-11-16 16:20:36.000000000","message":"Because that bug was created after this patch was created :)","commit_id":"fd288cd609c3425016d7e8a1563e4d11c85f572e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d9df947a40679fa85607b35bea5c148e800433be","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The split-out _alloc_candidates_with_shared() is still a long, complex"},{"line_number":16,"context_line":"method and I\u0027ll continue trying to reduce the complexity there and break"},{"line_number":17,"context_line":"functions out of it further. I did uncomplicate a part of the function"},{"line_number":18,"context_line":"with use of the itertools.product() function to replace a faulty use of"},{"line_number":19,"context_line":"zip() against a list of allocation request resource lists."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Change-Id: Ibcfd1a28f36d3c7ccd26fcc6386207e4a25300d4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"ff82abbf_730e383c","line":19,"range":{"start_line":17,"start_character":29,"end_line":19,"end_character":58},"in_reply_to":"1f485f77_7ea1ff45","updated":"2017-11-23 16:47:04.000000000","message":"If we don\u0027t add the Closes-Bug: #1730730 tag to the commit message that means we will keep the bug open but actually this patch solves that bug.","commit_id":"fd288cd609c3425016d7e8a1563e4d11c85f572e"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"c53f79dbccb536d7bff9895d187b5acf1c99fb7b","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The split-out _alloc_candidates_with_shared() is still a long, complex"},{"line_number":16,"context_line":"method and I\u0027ll continue trying to reduce the complexity there and break"},{"line_number":17,"context_line":"functions out of it further. I did uncomplicate a part of the function"},{"line_number":18,"context_line":"with use of the itertools.product() function to replace a faulty use of"},{"line_number":19,"context_line":"zip() against a list of allocation request resource lists."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Change-Id: Ibcfd1a28f36d3c7ccd26fcc6386207e4a25300d4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"1f485f77_7ea1ff45","line":19,"range":{"start_line":17,"start_character":29,"end_line":19,"end_character":58},"in_reply_to":"1f485f77_d46a217f","updated":"2017-11-17 00:10:24.000000000","message":"I see. Okay.","commit_id":"fd288cd609c3425016d7e8a1563e4d11c85f572e"}],"nova/objects/resource_provider.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5a58debcdadaeb8e4f6d81acc128f830b5c6c8b6","unresolved":false,"context_lines":[{"line_number":2667,"context_line":"    return alloc_requests, summaries.values()"},{"line_number":2668,"context_line":""},{"line_number":2669,"context_line":""},{"line_number":2670,"context_line":"def _alloc_candidates_with_shared(ctx, requested_resources, rp_ids, sharing):"},{"line_number":2671,"context_line":"    \"\"\"Returns a tuple of (allocation requests, provider summaries) for a"},{"line_number":2672,"context_line":"    supplied set of requested resource amounts and resource providers."},{"line_number":2673,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_b9a5ae49","line":2670,"range":{"start_line":2670,"start_character":4,"end_line":2670,"end_character":33},"updated":"2017-11-01 02:25:49.000000000","message":"Emm...actually, this is the huge method we want to separate...it\u0027s still huge, and I see reviewers(like Chris, Eric) afraid to review this method...\n\nAnd look at the patch for adding the trait support which I wrote based on this method, this method becomes bigger...https://review.openstack.org/#/c/479766/10/nova/objects/resource_provider.py","commit_id":"ee5833a7225a3977be1125f5046da6e96af1b2be"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5a58debcdadaeb8e4f6d81acc128f830b5c6c8b6","unresolved":false,"context_lines":[{"line_number":2871,"context_line":"        # related to a provider that is sharing some resources with it. In"},{"line_number":2872,"context_line":"        # other words, this is the list of resource provider IDs that are NOT"},{"line_number":2873,"context_line":"        # sharing resources."},{"line_number":2874,"context_line":"        rp_ids \u003d [r[0] for r in _get_all_with_shared(context, resources)]"},{"line_number":2875,"context_line":"        return _alloc_candidates_with_shared(context, resources, rp_ids,"},{"line_number":2876,"context_line":"                                             sharing_providers)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_54567f08","line":2874,"range":{"start_line":2874,"start_character":32,"end_line":2874,"end_character":52},"updated":"2017-11-01 02:25:49.000000000","message":"This method doesn\u0027t work for the case Eric pointed out.\n\nThe case is: The Compute node has VCPU, memory and local disk, but at same time the compute node with another shared storage pool in the same aggregate. When the local disk is exhausted, the compute node can use the shared storage.\n\nThe SQL \u0027_get_all_with_shared\u0027 will filter out the compute node, since the local disk is exhausted.","commit_id":"ee5833a7225a3977be1125f5046da6e96af1b2be"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2639,"context_line":"    if not rp_ids:"},{"line_number":2640,"context_line":"        return [], []"},{"line_number":2641,"context_line":"    # Grab usage summaries for each provider and resource class requested"},{"line_number":2642,"context_line":"    requested_rc_ids \u003d list(requested_resources.keys())"},{"line_number":2643,"context_line":"    usages \u003d _get_usages_by_provider_and_rc(ctx, rp_ids, requested_rc_ids)"},{"line_number":2644,"context_line":""},{"line_number":2645,"context_line":"    # Get a dict, keyed by resource provider internal ID, of ProviderSummary"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_82037d42","line":2642,"range":{"start_line":2642,"start_character":47,"end_line":2642,"end_character":54},"updated":"2017-11-01 23:40:56.000000000","message":"redundant","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3d5078a9d043a8c22c7b4b980f921040be736829","unresolved":false,"context_lines":[{"line_number":2639,"context_line":"    if not rp_ids:"},{"line_number":2640,"context_line":"        return [], []"},{"line_number":2641,"context_line":"    # Grab usage summaries for each provider and resource class requested"},{"line_number":2642,"context_line":"    requested_rc_ids \u003d list(requested_resources.keys())"},{"line_number":2643,"context_line":"    usages \u003d _get_usages_by_provider_and_rc(ctx, rp_ids, requested_rc_ids)"},{"line_number":2644,"context_line":""},{"line_number":2645,"context_line":"    # Get a dict, keyed by resource provider internal ID, of ProviderSummary"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_a9c9ab59","line":2642,"range":{"start_line":2642,"start_character":47,"end_line":2642,"end_character":54},"in_reply_to":"3f4b6375_82037d42","updated":"2017-11-02 15:31:40.000000000","message":"Done","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2651,"context_line":"    # resource class names and amounts to consume from that resource provider"},{"line_number":2652,"context_line":"    alloc_requests \u003d []"},{"line_number":2653,"context_line":"    for rp_id in rp_ids:"},{"line_number":2654,"context_line":"        rp_summary \u003d summaries[rp_id]"},{"line_number":2655,"context_line":"        rp_uuid \u003d rp_summary.resource_provider.uuid"},{"line_number":2656,"context_line":"        req_obj \u003d _allocation_request_for_provider(ctx, requested_resources,"},{"line_number":2657,"context_line":"                                                   rp_uuid)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_82881dc6","line":2654,"range":{"start_line":2654,"start_character":21,"end_line":2654,"end_character":37},"updated":"2017-11-01 23:40:56.000000000","message":"meh, just fold this into the line below.","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3d5078a9d043a8c22c7b4b980f921040be736829","unresolved":false,"context_lines":[{"line_number":2651,"context_line":"    # resource class names and amounts to consume from that resource provider"},{"line_number":2652,"context_line":"    alloc_requests \u003d []"},{"line_number":2653,"context_line":"    for rp_id in rp_ids:"},{"line_number":2654,"context_line":"        rp_summary \u003d summaries[rp_id]"},{"line_number":2655,"context_line":"        rp_uuid \u003d rp_summary.resource_provider.uuid"},{"line_number":2656,"context_line":"        req_obj \u003d _allocation_request_for_provider(ctx, requested_resources,"},{"line_number":2657,"context_line":"                                                   rp_uuid)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_49deb711","line":2654,"range":{"start_line":2654,"start_character":21,"end_line":2654,"end_character":37},"in_reply_to":"3f4b6375_82881dc6","updated":"2017-11-02 15:31:40.000000000","message":"meh, rather not. :)","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2659,"context_line":"    return alloc_requests, summaries.values()"},{"line_number":2660,"context_line":""},{"line_number":2661,"context_line":""},{"line_number":2662,"context_line":"def _alloc_candidates_with_shared(ctx, requested_resources, rp_ids, sharing):"},{"line_number":2663,"context_line":"    \"\"\"Returns a tuple of (allocation requests, provider summaries) for a"},{"line_number":2664,"context_line":"    supplied set of requested resource amounts and resource providers."},{"line_number":2665,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_5d3b26c7","line":2662,"range":{"start_line":2662,"start_character":4,"end_line":2662,"end_character":33},"updated":"2017-11-01 23:40:56.000000000","message":"I don\u0027t see how we\u0027re tying the sharing providers to their non-sharing providers via aggregate in this method if rp_ids is just a grab-bag of all the non-sharing and sharing RP IDs.\n\nFor example, Compute Nodes and Sharing Providers associated with AGgregates as follows:\n\n AG1: (CN1, SP1)\n AG2: (CN2, SP2)\n\n...and both (CN1+SP1) and (CN2+SP2) can satisfy the requested_resources, the `rp_ids` param to this method would be (CN1, CN2) and the `sharing` param would be (SP1, SP2)?  But couldn\u0027t that result in allocation requests including (CN1+SP2) and (CN2+SP1)?","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3d5078a9d043a8c22c7b4b980f921040be736829","unresolved":false,"context_lines":[{"line_number":2659,"context_line":"    return alloc_requests, summaries.values()"},{"line_number":2660,"context_line":""},{"line_number":2661,"context_line":""},{"line_number":2662,"context_line":"def _alloc_candidates_with_shared(ctx, requested_resources, rp_ids, sharing):"},{"line_number":2663,"context_line":"    \"\"\"Returns a tuple of (allocation requests, provider summaries) for a"},{"line_number":2664,"context_line":"    supplied set of requested resource amounts and resource providers."},{"line_number":2665,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_4907d783","line":2662,"range":{"start_line":2662,"start_character":4,"end_line":2662,"end_character":33},"in_reply_to":"3f4b6375_5d3b26c7","updated":"2017-11-02 15:31:40.000000000","message":"rp_ids is NOT a grab bag of non and sharing providers. rp_ids is ONLY the non-sharing provider IDs. The sharing provider IDs are contained in the sharing variable\u0027s values (it\u0027s a dict, keyed by resource class ID of the providers that share that resource).\n\nI\u0027ve gone ahead and renamed the rp_ids to ns_rp_ids and added a line to the docstring explaining this.","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2664,"context_line":"    supplied set of requested resource amounts and resource providers."},{"line_number":2665,"context_line":""},{"line_number":2666,"context_line":"    The allocation requests will contain resource providers that EITHER have"},{"line_number":2667,"context_line":"    all the resources to satisfy each requested resource amount OR have can"},{"line_number":2668,"context_line":"    satisfy some of the requested resources AND are associated by aggregate to"},{"line_number":2669,"context_line":"    a resource provider that shares the missing resources with it."},{"line_number":2670,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_02be6d64","line":2667,"range":{"start_line":2667,"start_character":67,"end_line":2667,"end_character":71},"updated":"2017-11-01 23:40:56.000000000","message":"strike","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3d5078a9d043a8c22c7b4b980f921040be736829","unresolved":false,"context_lines":[{"line_number":2664,"context_line":"    supplied set of requested resource amounts and resource providers."},{"line_number":2665,"context_line":""},{"line_number":2666,"context_line":"    The allocation requests will contain resource providers that EITHER have"},{"line_number":2667,"context_line":"    all the resources to satisfy each requested resource amount OR have can"},{"line_number":2668,"context_line":"    satisfy some of the requested resources AND are associated by aggregate to"},{"line_number":2669,"context_line":"    a resource provider that shares the missing resources with it."},{"line_number":2670,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_09fd5f6d","line":2667,"range":{"start_line":2667,"start_character":67,"end_line":2667,"end_character":71},"in_reply_to":"3f4b6375_02be6d64","updated":"2017-11-02 15:31:40.000000000","message":"Done","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2665,"context_line":""},{"line_number":2666,"context_line":"    The allocation requests will contain resource providers that EITHER have"},{"line_number":2667,"context_line":"    all the resources to satisfy each requested resource amount OR have can"},{"line_number":2668,"context_line":"    satisfy some of the requested resources AND are associated by aggregate to"},{"line_number":2669,"context_line":"    a resource provider that shares the missing resources with it."},{"line_number":2670,"context_line":""},{"line_number":2671,"context_line":"    :param ctx: nova.context.Context object"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_22a60955","line":2668,"range":{"start_line":2668,"start_character":4,"end_line":2668,"end_character":43},"updated":"2017-11-01 23:40:56.000000000","message":"Again, is this a requirement?  Isn\u0027t it hypothetically possible for me to get all my resources from sharing RPs?","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3d5078a9d043a8c22c7b4b980f921040be736829","unresolved":false,"context_lines":[{"line_number":2665,"context_line":""},{"line_number":2666,"context_line":"    The allocation requests will contain resource providers that EITHER have"},{"line_number":2667,"context_line":"    all the resources to satisfy each requested resource amount OR have can"},{"line_number":2668,"context_line":"    satisfy some of the requested resources AND are associated by aggregate to"},{"line_number":2669,"context_line":"    a resource provider that shares the missing resources with it."},{"line_number":2670,"context_line":""},{"line_number":2671,"context_line":"    :param ctx: nova.context.Context object"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_090b1f7d","line":2668,"range":{"start_line":2668,"start_character":4,"end_line":2668,"end_character":43},"in_reply_to":"3f4b6375_22a60955","updated":"2017-11-02 15:31:40.000000000","message":"See comment from an earlier patch. I\u0027ve added a not below on line 2681 about nova-scheduler currently being the only caller of this and why we short-circuit out there.","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2672,"context_line":"    :param requested_resources: dict, keyed by resource class ID, of amounts"},{"line_number":2673,"context_line":"                                being requested for that resource class"},{"line_number":2674,"context_line":"    :param rp_ids: List of resource provider IDs for providers that EITHER"},{"line_number":2675,"context_line":"                   match all of the requested resources or are associated with"},{"line_number":2676,"context_line":"                   sharing providers that can satisfy missing requested"},{"line_number":2677,"context_line":"                   resources"},{"line_number":2678,"context_line":"    :param sharing: dict, keyed by resource class ID, of a set of resource"},{"line_number":2679,"context_line":"                    provider IDs that share that resource class"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_7d12625a","line":2676,"range":{"start_line":2675,"start_character":59,"end_line":2676,"end_character":36},"updated":"2017-11-01 23:40:56.000000000","message":"To be clear, rp_ids contains *only* non-sharing RP IDs?  And the sharing RP IDs come from the values of the `sharing` param?\n\nIf that\u0027s the case, suggest renaming the param (e.g. ns_rp_ids) and making that distinction crisply in the docstring.","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3d5078a9d043a8c22c7b4b980f921040be736829","unresolved":false,"context_lines":[{"line_number":2672,"context_line":"    :param requested_resources: dict, keyed by resource class ID, of amounts"},{"line_number":2673,"context_line":"                                being requested for that resource class"},{"line_number":2674,"context_line":"    :param rp_ids: List of resource provider IDs for providers that EITHER"},{"line_number":2675,"context_line":"                   match all of the requested resources or are associated with"},{"line_number":2676,"context_line":"                   sharing providers that can satisfy missing requested"},{"line_number":2677,"context_line":"                   resources"},{"line_number":2678,"context_line":"    :param sharing: dict, keyed by resource class ID, of a set of resource"},{"line_number":2679,"context_line":"                    provider IDs that share that resource class"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_e90fa385","line":2676,"range":{"start_line":2675,"start_character":59,"end_line":2676,"end_character":36},"in_reply_to":"3f4b6375_7d12625a","updated":"2017-11-02 15:31:40.000000000","message":"done.","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2683,"context_line":""},{"line_number":2684,"context_line":"    # We need to grab usage information for all the providers identified as"},{"line_number":2685,"context_line":"    # potentially fulfilling part of the resource request. This includes"},{"line_number":2686,"context_line":"    # non-sharing providers returned from the above call to either"},{"line_number":2687,"context_line":"    # _get_all_with_shared() or _get_provider_ids_matching_all() as well as all"},{"line_number":2688,"context_line":"    # the providers of shared resources. Here, we simply grab a unique set of"},{"line_number":2689,"context_line":"    # all those resource provider internal IDs by set union\u0027ing them together"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_fd2772b5","line":2686,"range":{"start_line":2686,"start_character":46,"end_line":2686,"end_character":51},"updated":"2017-11-01 23:40:56.000000000","message":"strike","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3d5078a9d043a8c22c7b4b980f921040be736829","unresolved":false,"context_lines":[{"line_number":2683,"context_line":""},{"line_number":2684,"context_line":"    # We need to grab usage information for all the providers identified as"},{"line_number":2685,"context_line":"    # potentially fulfilling part of the resource request. This includes"},{"line_number":2686,"context_line":"    # non-sharing providers returned from the above call to either"},{"line_number":2687,"context_line":"    # _get_all_with_shared() or _get_provider_ids_matching_all() as well as all"},{"line_number":2688,"context_line":"    # the providers of shared resources. Here, we simply grab a unique set of"},{"line_number":2689,"context_line":"    # all those resource provider internal IDs by set union\u0027ing them together"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_497a37f1","line":2686,"range":{"start_line":2686,"start_character":46,"end_line":2686,"end_character":51},"in_reply_to":"3f4b6375_fd2772b5","updated":"2017-11-02 15:31:40.000000000","message":"Done","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2693,"context_line":""},{"line_number":2694,"context_line":"    # Grab usage summaries for each provider (local or sharing) and resource"},{"line_number":2695,"context_line":"    # class requested"},{"line_number":2696,"context_line":"    requested_rc_ids \u003d list(requested_resources.keys())"},{"line_number":2697,"context_line":"    usages \u003d _get_usages_by_provider_and_rc(ctx, all_rp_ids, requested_rc_ids)"},{"line_number":2698,"context_line":""},{"line_number":2699,"context_line":"    # Get a dict, keyed by resource provider internal ID, of ProviderSummary"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_9da75e0c","line":2696,"range":{"start_line":2696,"start_character":47,"end_line":2696,"end_character":54},"updated":"2017-11-01 23:40:56.000000000","message":"redundant","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3d5078a9d043a8c22c7b4b980f921040be736829","unresolved":false,"context_lines":[{"line_number":2693,"context_line":""},{"line_number":2694,"context_line":"    # Grab usage summaries for each provider (local or sharing) and resource"},{"line_number":2695,"context_line":"    # class requested"},{"line_number":2696,"context_line":"    requested_rc_ids \u003d list(requested_resources.keys())"},{"line_number":2697,"context_line":"    usages \u003d _get_usages_by_provider_and_rc(ctx, all_rp_ids, requested_rc_ids)"},{"line_number":2698,"context_line":""},{"line_number":2699,"context_line":"    # Get a dict, keyed by resource provider internal ID, of ProviderSummary"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_cc41953b","line":2696,"range":{"start_line":2696,"start_character":47,"end_line":2696,"end_character":54},"in_reply_to":"3f4b6375_9da75e0c","updated":"2017-11-02 15:31:40.000000000","message":"Done","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2717,"context_line":"            # requested resources shared *with* it but the allocation of the"},{"line_number":2718,"context_line":"            # requested resource will not be made against it. Since this"},{"line_number":2719,"context_line":"            # provider won\u0027t actually have an allocation request written for"},{"line_number":2720,"context_line":"            # it, we just ignore it and continue"},{"line_number":2721,"context_line":"            continue"},{"line_number":2722,"context_line":"        rp_summary \u003d summaries[rp_id]"},{"line_number":2723,"context_line":"        rp_uuid \u003d rp_summary.resource_provider.uuid"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_dd86f665","line":2720,"range":{"start_line":2720,"start_character":26,"end_line":2720,"end_character":35},"updated":"2017-11-01 23:40:56.000000000","message":"see above","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2722,"context_line":"        rp_summary \u003d summaries[rp_id]"},{"line_number":2723,"context_line":"        rp_uuid \u003d rp_summary.resource_provider.uuid"},{"line_number":2724,"context_line":"        local_resources \u003d set("},{"line_number":2725,"context_line":"            rc_id for rc_id in requested_resources.keys()"},{"line_number":2726,"context_line":"            if _RC_CACHE.string_from_id(rc_id) in ["},{"line_number":2727,"context_line":"                res.resource_class for res in rp_summary.resources"},{"line_number":2728,"context_line":"            ]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_1d8c8e7d","line":2725,"range":{"start_line":2725,"start_character":50,"end_line":2725,"end_character":57},"updated":"2017-11-01 23:40:56.000000000","message":"redundant","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3d5078a9d043a8c22c7b4b980f921040be736829","unresolved":false,"context_lines":[{"line_number":2722,"context_line":"        rp_summary \u003d summaries[rp_id]"},{"line_number":2723,"context_line":"        rp_uuid \u003d rp_summary.resource_provider.uuid"},{"line_number":2724,"context_line":"        local_resources \u003d set("},{"line_number":2725,"context_line":"            rc_id for rc_id in requested_resources.keys()"},{"line_number":2726,"context_line":"            if _RC_CACHE.string_from_id(rc_id) in ["},{"line_number":2727,"context_line":"                res.resource_class for res in rp_summary.resources"},{"line_number":2728,"context_line":"            ]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_8c603dd1","line":2725,"range":{"start_line":2725,"start_character":50,"end_line":2725,"end_character":57},"in_reply_to":"3f4b6375_1d8c8e7d","updated":"2017-11-02 15:31:40.000000000","message":"Done","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2727,"context_line":"                res.resource_class for res in rp_summary.resources"},{"line_number":2728,"context_line":"            ]"},{"line_number":2729,"context_line":"        )"},{"line_number":2730,"context_line":"        shared_resources \u003d set("},{"line_number":2731,"context_line":"            rc_id for rc_id in requested_resources.keys()"},{"line_number":2732,"context_line":"            if _RC_CACHE.string_from_id(rc_id) not in ["},{"line_number":2733,"context_line":"                res.resource_class for res in rp_summary.resources"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_ddeb960f","line":2730,"updated":"2017-11-01 23:40:56.000000000","message":"or\n\n shared_resources \u003d set(requested_resources) - local_resources","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2733,"context_line":"                res.resource_class for res in rp_summary.resources"},{"line_number":2734,"context_line":"            ]"},{"line_number":2735,"context_line":"        )"},{"line_number":2736,"context_line":"        # Determine if the non-sharing provider actually has all the"},{"line_number":2737,"context_line":"        # resources requested. If not, we need to add an AllocationRequest"},{"line_number":2738,"context_line":"        # alternative containing this resource for each sharing provider"},{"line_number":2739,"context_line":"        has_all \u003d len(shared_resources) \u003d\u003d 0"},{"line_number":2740,"context_line":"        if has_all:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_1dba4e09","line":2737,"range":{"start_line":2736,"start_character":48,"end_line":2737,"end_character":29},"updated":"2017-11-01 23:40:56.000000000","message":"Nitpicking semantics here:\n\nIf the non-sharing provider has all the resources requested, but a sharing provider could *also* provide some of those resources instead, we want to report allocation requests for both (all) permutations.\n\nThe code (definition of has_all) is doing the right thing; I\u0027m just taking issue with the wording of the comment.","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3d5078a9d043a8c22c7b4b980f921040be736829","unresolved":false,"context_lines":[{"line_number":2733,"context_line":"                res.resource_class for res in rp_summary.resources"},{"line_number":2734,"context_line":"            ]"},{"line_number":2735,"context_line":"        )"},{"line_number":2736,"context_line":"        # Determine if the non-sharing provider actually has all the"},{"line_number":2737,"context_line":"        # resources requested. If not, we need to add an AllocationRequest"},{"line_number":2738,"context_line":"        # alternative containing this resource for each sharing provider"},{"line_number":2739,"context_line":"        has_all \u003d len(shared_resources) \u003d\u003d 0"},{"line_number":2740,"context_line":"        if has_all:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_4c85a559","line":2737,"range":{"start_line":2736,"start_character":48,"end_line":2737,"end_character":29},"in_reply_to":"3f4b6375_1dba4e09","updated":"2017-11-02 15:31:40.000000000","message":"Yeah, we currently don\u0027t deal with that scenario. If a provider has local inventory for a resource class and also has that resource class shared with it, we always take the local inventory. I\u0027ll add a note, but this isn\u0027t going to change in this patch.","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2747,"context_line":"        if has_none:"},{"line_number":2748,"context_line":"            # This resource provider doesn\u0027t actually provide any requested"},{"line_number":2749,"context_line":"            # resource. It only has requested resources shared *with* it."},{"line_number":2750,"context_line":"            # We do not list this provider in allocation_requests but do"},{"line_number":2751,"context_line":"            # list it in provider_summaries."},{"line_number":2752,"context_line":"            continue"},{"line_number":2753,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_1de12e2b","line":2750,"range":{"start_line":2750,"start_character":14,"end_line":2750,"end_character":65},"updated":"2017-11-01 23:40:56.000000000","message":"see above","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2754,"context_line":"        # add an AllocationRequest that includes resources from the"},{"line_number":2755,"context_line":"        # non-sharing provider AND shared resources from each sharing"},{"line_number":2756,"context_line":"        # provider of that resource class"},{"line_number":2757,"context_line":"        non_shared_resources \u003d local_resources - shared_resources"},{"line_number":2758,"context_line":"        non_shared_requests \u003d ["},{"line_number":2759,"context_line":"            AllocationRequestResource("},{"line_number":2760,"context_line":"                ctx, resource_provider\u003dResourceProvider(ctx, uuid\u003drp_uuid),"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_fd0412c8","line":2757,"range":{"start_line":2757,"start_character":31,"end_line":2757,"end_character":65},"updated":"2017-11-01 23:40:56.000000000","message":"Man, unless I\u0027m missing something big, this is always the empty set.  Follow me here:\n\nL2724 defines local_resources as all the requested RCs that are in this RP\u0027s summary resources.\n\nL2730 defines shared_resources as all the requested RCs that are *not* in this RP\u0027s summary resources.\n\nDoesn\u0027t that mean local_resources and shared_resources are by definition disjoint subsets of all the RC IDs in requested_resources?","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3d5078a9d043a8c22c7b4b980f921040be736829","unresolved":false,"context_lines":[{"line_number":2754,"context_line":"        # add an AllocationRequest that includes resources from the"},{"line_number":2755,"context_line":"        # non-sharing provider AND shared resources from each sharing"},{"line_number":2756,"context_line":"        # provider of that resource class"},{"line_number":2757,"context_line":"        non_shared_resources \u003d local_resources - shared_resources"},{"line_number":2758,"context_line":"        non_shared_requests \u003d ["},{"line_number":2759,"context_line":"            AllocationRequestResource("},{"line_number":2760,"context_line":"                ctx, resource_provider\u003dResourceProvider(ctx, uuid\u003drp_uuid),"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_2cd82979","line":2757,"range":{"start_line":2757,"start_character":31,"end_line":2757,"end_character":65},"in_reply_to":"3f4b6375_fd0412c8","updated":"2017-11-02 15:31:40.000000000","message":"I\u0027ve corrected it.","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2769,"context_line":"        )"},{"line_number":2770,"context_line":"        # sharing_request_tuples will now contain a list of tuples with the"},{"line_number":2771,"context_line":"        # tuples being AllocationRequestResource objects for each provider"},{"line_number":2772,"context_line":"        # of a shared resource"},{"line_number":2773,"context_line":"        for shared_request_tuple in sharing_request_tuples:"},{"line_number":2774,"context_line":"            shared_requests \u003d list(*shared_request_tuple)"},{"line_number":2775,"context_line":"            resource_requests \u003d non_shared_requests + shared_requests"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_5d39e63c","line":2772,"updated":"2017-11-01 23:40:56.000000000","message":"Each tuple contains M members, one AllocationRequestResource for each of the M resource classes provided by the sharing providers?\n\nAnd we\u0027re expecting N tuples, where N is the number of sharing providers?\n\nSeems like this only works if the sharing RPs are symmetrical in which resource classes they provide resources for.  Otherwise the zip above will quit the first time it hits a sharing RP that doesn\u0027t provide a resource for a given class.","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cf02419a8b142e42184932045ac34a5f11aaa3a","unresolved":false,"context_lines":[{"line_number":2771,"context_line":"        # tuples being AllocationRequestResource objects for each provider"},{"line_number":2772,"context_line":"        # of a shared resource"},{"line_number":2773,"context_line":"        for shared_request_tuple in sharing_request_tuples:"},{"line_number":2774,"context_line":"            shared_requests \u003d list(*shared_request_tuple)"},{"line_number":2775,"context_line":"            resource_requests \u003d non_shared_requests + shared_requests"},{"line_number":2776,"context_line":"            req \u003d AllocationRequest(ctx, resource_requests\u003dresource_requests)"},{"line_number":2777,"context_line":"            alloc_requests.append(req)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_9d5e3e74","line":2774,"range":{"start_line":2774,"start_character":30,"end_line":2774,"end_character":57},"updated":"2017-11-01 23:40:56.000000000","message":"Eh?  Is shared_request_tuple a tuple, or some kind of iterable of one member which is a tuple?","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3d5078a9d043a8c22c7b4b980f921040be736829","unresolved":false,"context_lines":[{"line_number":2771,"context_line":"        # tuples being AllocationRequestResource objects for each provider"},{"line_number":2772,"context_line":"        # of a shared resource"},{"line_number":2773,"context_line":"        for shared_request_tuple in sharing_request_tuples:"},{"line_number":2774,"context_line":"            shared_requests \u003d list(*shared_request_tuple)"},{"line_number":2775,"context_line":"            resource_requests \u003d non_shared_requests + shared_requests"},{"line_number":2776,"context_line":"            req \u003d AllocationRequest(ctx, resource_requests\u003dresource_requests)"},{"line_number":2777,"context_line":"            alloc_requests.append(req)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_2f525b3c","line":2774,"range":{"start_line":2774,"start_character":30,"end_line":2774,"end_character":57},"in_reply_to":"3f4b6375_9d5e3e74","updated":"2017-11-02 15:31:40.000000000","message":"Yeah, this section is pretty crazy. It\u0027s the \"Tetris\" section....\n\nLet\u0027s say we\u0027ve got a request for VCPU, MEMORY_MB, DISK_GB, and IPV4_ADDRESS. We have a bunch of compute nodes that supply the VCPU and MEMORY_MB and a couple sharing providers of the other resource classes.\n\nsharing_resource_requests is a dict that contains the pre-built AllocationRequestResource components for a particular resource class coming from each provider that shares that resource. It looks like this:\n\n {\n   DISK_GB_ID: [\n       AllocationRequestResource(DISK_GB, DISK_SHARING_RP_ID1), \n       AllocationRequestResource(DISK_GB, DISK_SHARING_RP_ID2),\n   ],\n   IPV4_ADDRESS_ID: [\n       AllocationRequestResource(IPV4_ADDRESS, IP_SHARING_RP_ID3),\n       AllocationRequestResource(IPV4_ADDRESS, IP_SHARING_RP_ID4),\n   ]\n }\n\nshared_resources is a set() containing the resource class IDs for any resource class that is NOT able to be satisfied by the non-sharing provider. Let\u0027s assume for shared-storage scenarios, this set looks like this:\n\n set([DISK_GB_ID, IPV4_ADDRESS])\n\nwhen we\u0027re in this part of the loop, the non_shared_requests will be a list of two AllocationRequestResource objects for the VCPU and MEMORY_MB being served by the compute node provider.\n\nWe need to construct AllocationRequest objects for all permutations of the \"local resource requests\" (the ones for VCPU and MEMORY_MB) and each of the sharing providers of the shared resources.\n\nI\u0027m going to rewrite this section to use itertools.permutations() or itertools.product()","commit_id":"b94bfdf51e8134ea69e697544fef0fa74ba20238"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c4d0240e5121d747a0e4670ab7384a976ce1a11d","unresolved":false,"context_lines":[{"line_number":2705,"context_line":""},{"line_number":2706,"context_line":"    # We need to grab usage information for all the providers identified as"},{"line_number":2707,"context_line":"    # potentially fulfilling part of the resource request. This includes"},{"line_number":2708,"context_line":"    # non-sharing providers returned from the above call to either"},{"line_number":2709,"context_line":"    # _get_all_with_shared() or _get_provider_ids_matching_all() as well as all"},{"line_number":2710,"context_line":"    # the providers of shared resources. Here, we simply grab a unique set of"},{"line_number":2711,"context_line":"    # all those resource provider internal IDs by set union\u0027ing them together"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_c0f954c8","line":2708,"range":{"start_line":2708,"start_character":46,"end_line":2708,"end_character":51},"updated":"2017-11-02 16:46:06.000000000","message":"not done","commit_id":"81d5ec857e37a4e27feb0b624c1f854afca5399c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b975041aeeeef60c9fedc4c3af283242d2e88693","unresolved":false,"context_lines":[{"line_number":2705,"context_line":""},{"line_number":2706,"context_line":"    # We need to grab usage information for all the providers identified as"},{"line_number":2707,"context_line":"    # potentially fulfilling part of the resource request. This includes"},{"line_number":2708,"context_line":"    # non-sharing providers returned from the above call to either"},{"line_number":2709,"context_line":"    # _get_all_with_shared() or _get_provider_ids_matching_all() as well as all"},{"line_number":2710,"context_line":"    # the providers of shared resources. Here, we simply grab a unique set of"},{"line_number":2711,"context_line":"    # all those resource provider internal IDs by set union\u0027ing them together"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_40bfa460","line":2708,"range":{"start_line":2708,"start_character":46,"end_line":2708,"end_character":51},"in_reply_to":"3f4b6375_c0f954c8","updated":"2017-11-02 16:51:51.000000000","message":"sorry, rebase conflict fix fail. done (again)","commit_id":"81d5ec857e37a4e27feb0b624c1f854afca5399c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c4d0240e5121d747a0e4670ab7384a976ce1a11d","unresolved":false,"context_lines":[{"line_number":2715,"context_line":""},{"line_number":2716,"context_line":"    # Grab usage summaries for each provider (local or sharing) and resource"},{"line_number":2717,"context_line":"    # class requested"},{"line_number":2718,"context_line":"    requested_rc_ids \u003d list(requested_resources.keys())"},{"line_number":2719,"context_line":"    usages \u003d _get_usages_by_provider_and_rc(ctx, all_rp_ids, requested_rc_ids)"},{"line_number":2720,"context_line":""},{"line_number":2721,"context_line":"    # Get a dict, keyed by resource provider internal ID, of ProviderSummary"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_60fce0b4","line":2718,"range":{"start_line":2718,"start_character":47,"end_line":2718,"end_character":54},"updated":"2017-11-02 16:46:06.000000000","message":"not done","commit_id":"81d5ec857e37a4e27feb0b624c1f854afca5399c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b975041aeeeef60c9fedc4c3af283242d2e88693","unresolved":false,"context_lines":[{"line_number":2715,"context_line":""},{"line_number":2716,"context_line":"    # Grab usage summaries for each provider (local or sharing) and resource"},{"line_number":2717,"context_line":"    # class requested"},{"line_number":2718,"context_line":"    requested_rc_ids \u003d list(requested_resources.keys())"},{"line_number":2719,"context_line":"    usages \u003d _get_usages_by_provider_and_rc(ctx, all_rp_ids, requested_rc_ids)"},{"line_number":2720,"context_line":""},{"line_number":2721,"context_line":"    # Get a dict, keyed by resource provider internal ID, of ProviderSummary"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_20c4a8f4","line":2718,"range":{"start_line":2718,"start_character":47,"end_line":2718,"end_character":54},"in_reply_to":"3f4b6375_60fce0b4","updated":"2017-11-02 16:51:51.000000000","message":"Done","commit_id":"81d5ec857e37a4e27feb0b624c1f854afca5399c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c4d0240e5121d747a0e4670ab7384a976ce1a11d","unresolved":false,"context_lines":[{"line_number":2763,"context_line":"        # alternative containing this resource for each sharing provider."},{"line_number":2764,"context_line":"        # NOTE(jaypipes): If a provider has inventory for a resource class and"},{"line_number":2765,"context_line":"        # ALSO has that resource class shared with it, we currently ALWAYS take"},{"line_number":2766,"context_line":"        # the non-shared inventory."},{"line_number":2767,"context_line":"        has_all \u003d len(shared_resources) \u003d\u003d 0"},{"line_number":2768,"context_line":"        if has_all:"},{"line_number":2769,"context_line":"            req \u003d _allocation_request_for_provider(ctx, requested_resources,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_e0857008","line":2766,"updated":"2017-11-02 16:46:06.000000000","message":"Ah.  This is https://bugs.launchpad.net/nova/+bug/1724613","commit_id":"81d5ec857e37a4e27feb0b624c1f854afca5399c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b975041aeeeef60c9fedc4c3af283242d2e88693","unresolved":false,"context_lines":[{"line_number":2763,"context_line":"        # alternative containing this resource for each sharing provider."},{"line_number":2764,"context_line":"        # NOTE(jaypipes): If a provider has inventory for a resource class and"},{"line_number":2765,"context_line":"        # ALSO has that resource class shared with it, we currently ALWAYS take"},{"line_number":2766,"context_line":"        # the non-shared inventory."},{"line_number":2767,"context_line":"        has_all \u003d len(shared_resources) \u003d\u003d 0"},{"line_number":2768,"context_line":"        if has_all:"},{"line_number":2769,"context_line":"            req \u003d _allocation_request_for_provider(ctx, requested_resources,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_0043ec6d","line":2766,"in_reply_to":"3f4b6375_e0857008","updated":"2017-11-02 16:51:51.000000000","message":"Ah, didn\u0027t know about the bug. I\u0027ll link it in to the code comment.","commit_id":"81d5ec857e37a4e27feb0b624c1f854afca5399c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c4d0240e5121d747a0e4670ab7384a976ce1a11d","unresolved":false,"context_lines":[{"line_number":2797,"context_line":"            sharing_resource_requests[shared_rc_id]"},{"line_number":2798,"context_line":"            for shared_rc_id in shared_resources"},{"line_number":2799,"context_line":"        ]"},{"line_number":2800,"context_line":"        for shared_res_requests in itertools.product(*shared_request_groups):"},{"line_number":2801,"context_line":"            resource_requests \u003d ns_res_requests + list(shared_res_requests)"},{"line_number":2802,"context_line":"            req \u003d AllocationRequest(ctx, resource_requests\u003dresource_requests)"},{"line_number":2803,"context_line":"            alloc_requests.append(req)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_000bec7c","line":2800,"range":{"start_line":2800,"start_character":45,"end_line":2800,"end_character":52},"updated":"2017-11-02 16:46:06.000000000","message":"yusssss.","commit_id":"81d5ec857e37a4e27feb0b624c1f854afca5399c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a8ed6dfeb0237d143431e8b8ca91379b0dee7d35","unresolved":false,"context_lines":[{"line_number":2697,"context_line":""},{"line_number":2698,"context_line":"    # We need to grab usage information for all the providers identified as"},{"line_number":2699,"context_line":"    # potentially fulfilling part of the resource request. This includes"},{"line_number":2700,"context_line":"    # non-sharing providers returned from the call to either"},{"line_number":2701,"context_line":"    # _get_all_with_shared() as well as all the providers of shared resources."},{"line_number":2702,"context_line":"    # Here, we simply grab a unique set of all those resource provider internal"},{"line_number":2703,"context_line":"    # IDs by set union\u0027ing them together"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_fb31a15a","line":2700,"range":{"start_line":2700,"start_character":54,"end_line":2700,"end_character":60},"updated":"2017-11-02 17:08:26.000000000","message":"Well, now this can go too.","commit_id":"c5b4bd54293c5a27536e570b6968ae1eb137a770"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"533f0d51b32a67da5d6460b711e71c2153728510","unresolved":false,"context_lines":[{"line_number":2697,"context_line":""},{"line_number":2698,"context_line":"    # We need to grab usage information for all the providers identified as"},{"line_number":2699,"context_line":"    # potentially fulfilling part of the resource request. This includes"},{"line_number":2700,"context_line":"    # non-sharing providers returned from the call to either"},{"line_number":2701,"context_line":"    # _get_all_with_shared() as well as all the providers of shared resources."},{"line_number":2702,"context_line":"    # Here, we simply grab a unique set of all those resource provider internal"},{"line_number":2703,"context_line":"    # IDs by set union\u0027ing them together"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_736dbc30","line":2700,"range":{"start_line":2700,"start_character":54,"end_line":2700,"end_character":60},"in_reply_to":"3f4b6375_fb31a15a","updated":"2017-11-03 15:42:15.000000000","message":"Done","commit_id":"c5b4bd54293c5a27536e570b6968ae1eb137a770"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"49d378e8c64b34f0bf1c6aa88f4fcca0736ce5eb","unresolved":false,"context_lines":[{"line_number":2801,"context_line":"                # list it in provider_summaries."},{"line_number":2802,"context_line":"                continue"},{"line_number":2803,"context_line":""},{"line_number":2804,"context_line":"            # If there are no resource providers sharing resources involved in"},{"line_number":2805,"context_line":"            # this request, there\u0027s no point building a set of allocation"},{"line_number":2806,"context_line":"            # requests that involve resource providers other than the \"root"},{"line_number":2807,"context_line":"            # providers\" that have all the local resources on them"},{"line_number":2808,"context_line":"            if not sharing_resource_requests:"},{"line_number":2809,"context_line":"                continue"},{"line_number":2810,"context_line":""},{"line_number":2811,"context_line":"            # add an AllocationRequest that includes local resources from the"},{"line_number":2812,"context_line":"            # root provider and shared resources from each sharing provider of"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4b6375_742694d0","side":"PARENT","line":2809,"range":{"start_line":2804,"start_character":12,"end_line":2809,"end_character":24},"updated":"2017-11-07 03:31:11.000000000","message":"this is removed, since we never should reach this point after refactor.","commit_id":"3ddb238879afab00633823107fba01cfb4eee6b2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"49d378e8c64b34f0bf1c6aa88f4fcca0736ce5eb","unresolved":false,"context_lines":[{"line_number":2522,"context_line":""},{"line_number":2523,"context_line":"def _build_provider_summaries(context, usages):"},{"line_number":2524,"context_line":"    \"\"\"Given a list of dicts of usage information, returns a dict, keyed by"},{"line_number":2525,"context_line":"    resource provider ID, of ProviderSummary objects."},{"line_number":2526,"context_line":""},{"line_number":2527,"context_line":"    :param context: nova.context.Context object"},{"line_number":2528,"context_line":"    :param usages: A list of dicts with the following format:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4b6375_b4a88c8b","line":2525,"range":{"start_line":2525,"start_character":27,"end_line":2525,"end_character":28},"updated":"2017-11-07 03:31:11.000000000","message":"This isn\u0027t part of this patch :)","commit_id":"e4a002d28b6beae505f1871d407e956e3a9bb7ce"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"49d378e8c64b34f0bf1c6aa88f4fcca0736ce5eb","unresolved":false,"context_lines":[{"line_number":2765,"context_line":"            continue"},{"line_number":2766,"context_line":""},{"line_number":2767,"context_line":"        has_none \u003d len(ns_resources) \u003d\u003d 0"},{"line_number":2768,"context_line":"        if has_none:"},{"line_number":2769,"context_line":"            # This resource provider doesn\u0027t actually provide any requested"},{"line_number":2770,"context_line":"            # resource. It only has requested resources shared *with* it."},{"line_number":2771,"context_line":"            # We do not list this provider in allocation_requests but do"},{"line_number":2772,"context_line":"            # list it in provider_summaries."},{"line_number":2773,"context_line":"            continue"},{"line_number":2774,"context_line":""},{"line_number":2775,"context_line":"        # Add an AllocationRequest that includes resources from the"},{"line_number":2776,"context_line":"        # non-sharing provider AND shared resources from each sharing"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4b6375_2fbd6901","line":2773,"range":{"start_line":2768,"start_character":8,"end_line":2773,"end_character":20},"updated":"2017-11-07 03:31:11.000000000","message":"Trying so hard to think about what is the case for...I removed this check, and the functional test still run correctly.","commit_id":"e4a002d28b6beae505f1871d407e956e3a9bb7ce"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"867a5d4148cb6e480abdbf533c1057baf34e95ca","unresolved":false,"context_lines":[{"line_number":2765,"context_line":"            continue"},{"line_number":2766,"context_line":""},{"line_number":2767,"context_line":"        has_none \u003d len(ns_resources) \u003d\u003d 0"},{"line_number":2768,"context_line":"        if has_none:"},{"line_number":2769,"context_line":"            # This resource provider doesn\u0027t actually provide any requested"},{"line_number":2770,"context_line":"            # resource. It only has requested resources shared *with* it."},{"line_number":2771,"context_line":"            # We do not list this provider in allocation_requests but do"},{"line_number":2772,"context_line":"            # list it in provider_summaries."},{"line_number":2773,"context_line":"            continue"},{"line_number":2774,"context_line":""},{"line_number":2775,"context_line":"        # Add an AllocationRequest that includes resources from the"},{"line_number":2776,"context_line":"        # non-sharing provider AND shared resources from each sharing"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4b6375_916d97cd","line":2773,"range":{"start_line":2768,"start_character":8,"end_line":2773,"end_character":20},"in_reply_to":"3f4b6375_2fbd6901","updated":"2017-11-07 12:59:24.000000000","message":"Suspect that\u0027s a function of missing tests rather than a dead code path.\n\nIn a world where the non-sharing RP isn\u0027t a compute node, it might be possible for *all* the requested resources to come from sharing RPs only.  This condition actually makes sure we *don\u0027t* support that scenario.","commit_id":"e4a002d28b6beae505f1871d407e956e3a9bb7ce"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ddbb1640dbd9057c211eb889804ec0d6edbeab61","unresolved":false,"context_lines":[{"line_number":2765,"context_line":"            continue"},{"line_number":2766,"context_line":""},{"line_number":2767,"context_line":"        has_none \u003d len(ns_resources) \u003d\u003d 0"},{"line_number":2768,"context_line":"        if has_none:"},{"line_number":2769,"context_line":"            # This resource provider doesn\u0027t actually provide any requested"},{"line_number":2770,"context_line":"            # resource. It only has requested resources shared *with* it."},{"line_number":2771,"context_line":"            # We do not list this provider in allocation_requests but do"},{"line_number":2772,"context_line":"            # list it in provider_summaries."},{"line_number":2773,"context_line":"            continue"},{"line_number":2774,"context_line":""},{"line_number":2775,"context_line":"        # Add an AllocationRequest that includes resources from the"},{"line_number":2776,"context_line":"        # non-sharing provider AND shared resources from each sharing"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f485f77_d125d3ac","line":2773,"range":{"start_line":2768,"start_character":8,"end_line":2773,"end_character":20},"in_reply_to":"3f4b6375_916d97cd","updated":"2017-11-14 21:07:27.000000000","message":"From the top of this series, I removed this block, and the test results don\u0027t change.","commit_id":"e4a002d28b6beae505f1871d407e956e3a9bb7ce"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6e77ac9d1429f43d783d8c61ffb12fbdad565b8","unresolved":false,"context_lines":[{"line_number":2841,"context_line":"            provider_summaries\u003dprovider_summaries,"},{"line_number":2842,"context_line":"        )"},{"line_number":2843,"context_line":""},{"line_number":2844,"context_line":"    # TODO(jaypipes): See what we can pull out of here into helper functions to"},{"line_number":2845,"context_line":"    # minimize the complexity of this method."},{"line_number":2846,"context_line":"    @staticmethod"},{"line_number":2847,"context_line":"    @db_api.api_context_manager.reader"},{"line_number":2848,"context_line":"    def _get_by_filters(context, filters):"}],"source_content_type":"text/x-python","patch_set":8,"id":"1f485f77_9bf41ad1","line":2845,"range":{"start_line":2844,"start_character":1,"end_line":2845,"end_character":45},"updated":"2017-11-14 20:11:38.000000000","message":"Reckon this can go away now.","commit_id":"11c78fac74a1762208cf5a3694f038f72ad9fed5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"86f0abdcb2841e01960feaba418895c0b18e75ea","unresolved":false,"context_lines":[{"line_number":2841,"context_line":"            provider_summaries\u003dprovider_summaries,"},{"line_number":2842,"context_line":"        )"},{"line_number":2843,"context_line":""},{"line_number":2844,"context_line":"    # TODO(jaypipes): See what we can pull out of here into helper functions to"},{"line_number":2845,"context_line":"    # minimize the complexity of this method."},{"line_number":2846,"context_line":"    @staticmethod"},{"line_number":2847,"context_line":"    @db_api.api_context_manager.reader"},{"line_number":2848,"context_line":"    def _get_by_filters(context, filters):"}],"source_content_type":"text/x-python","patch_set":8,"id":"1f485f77_7bacbe33","line":2845,"range":{"start_line":2844,"start_character":1,"end_line":2845,"end_character":45},"in_reply_to":"1f485f77_9bf41ad1","updated":"2017-11-14 21:02:45.000000000","message":"Done","commit_id":"11c78fac74a1762208cf5a3694f038f72ad9fed5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d9df947a40679fa85607b35bea5c148e800433be","unresolved":false,"context_lines":[{"line_number":2765,"context_line":"            # resource. It only has requested resources shared *with* it."},{"line_number":2766,"context_line":"            # We do not list this provider in allocation_requests but do"},{"line_number":2767,"context_line":"            # list it in provider_summaries."},{"line_number":2768,"context_line":"            continue"},{"line_number":2769,"context_line":""},{"line_number":2770,"context_line":"        # Add an AllocationRequest that includes resources from the"},{"line_number":2771,"context_line":"        # non-sharing provider AND shared resources from each sharing"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff82abbf_93adfc32","line":2768,"updated":"2017-11-23 16:47:04.000000000","message":"While there is no need to allocate from this RP, the information that the resource is provided _through_ this RP from a sharing RP is important. I think this place is related to the bug 1732731. It is OK to handle this separately in that bugfix.","commit_id":"fd288cd609c3425016d7e8a1563e4d11c85f572e"}],"nova/tests/functional/db/test_allocation_candidates.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d9df947a40679fa85607b35bea5c148e800433be","unresolved":false,"context_lines":[{"line_number":725,"context_line":"            )]"},{"line_number":726,"context_line":"        )"},{"line_number":727,"context_line":""},{"line_number":728,"context_line":"        # TODO(efried): Bug https://bugs.launchpad.net/nova/+bug/1730730"},{"line_number":729,"context_line":"        # We expect two candidates: one that gets all the resources from ss1;"},{"line_number":730,"context_line":"        # and one that gets the DISK_GB from ss2 and the rest from ss1:"},{"line_number":731,"context_line":"        # expected \u003d ["}],"source_content_type":"text/x-python","patch_set":11,"id":"ff82abbf_d33e24d9","side":"PARENT","line":728,"updated":"2017-11-23 16:47:04.000000000","message":"The Closes-Bug: #1730730 tag is missing from the commit message but this commit is actually fixing that bug as the this test case shows.","commit_id":"ffdcd5d6e9de1511679e0c51a806ca8815c2d368"}]}
