)]}'
{"nova/api/openstack/placement/objects/resource_provider.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":16,"id":"5f7c97a3_36e8e414","updated":"2018-05-18 21:12:18.000000000","message":"I love that we\u0027ve gotten rid of so much code here.  I am slightly concerned that we\u0027re going to take a performance hit since we\u0027re now funneling everything through the (supposedly) less efficient common path.  But I\u0027m on board with finding that out and re-optimizing as we go forward from here.","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":435,"context_line":""},{"line_number":436,"context_line":""},{"line_number":437,"context_line":"@db_api.api_context_manager.reader"},{"line_number":438,"context_line":"def _anchors_for_sharing_provider(context, rp_ids, get_id\u003dFalse):"},{"line_number":439,"context_line":"    \"\"\"Given a list of internal IDs of sharing providers, returns a set of"},{"line_number":440,"context_line":"    tuples of (sharing provider UUID, anchor provider UUID), each of anchor"},{"line_number":441,"context_line":"    is the unique root providers of trees associated with the same aggregate"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_761adc17","line":438,"range":{"start_line":438,"start_character":4,"end_line":438,"end_character":33},"updated":"2018-05-18 21:12:18.000000000","message":"I guess you should rename this _anchors_for_sharing_providers (plural)","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"bbd1d83541e8a5a2578462b57455e06756f295bb","unresolved":false,"context_lines":[{"line_number":435,"context_line":""},{"line_number":436,"context_line":""},{"line_number":437,"context_line":"@db_api.api_context_manager.reader"},{"line_number":438,"context_line":"def _anchors_for_sharing_provider(context, rp_ids, get_id\u003dFalse):"},{"line_number":439,"context_line":"    \"\"\"Given a list of internal IDs of sharing providers, returns a set of"},{"line_number":440,"context_line":"    tuples of (sharing provider UUID, anchor provider UUID), each of anchor"},{"line_number":441,"context_line":"    is the unique root providers of trees associated with the same aggregate"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_9d36abb4","line":438,"range":{"start_line":438,"start_character":4,"end_line":438,"end_character":33},"in_reply_to":"5f7c97a3_761adc17","updated":"2018-05-21 06:43:39.000000000","message":"Done","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":437,"context_line":"@db_api.api_context_manager.reader"},{"line_number":438,"context_line":"def _anchors_for_sharing_provider(context, rp_ids, get_id\u003dFalse):"},{"line_number":439,"context_line":"    \"\"\"Given a list of internal IDs of sharing providers, returns a set of"},{"line_number":440,"context_line":"    tuples of (sharing provider UUID, anchor provider UUID), each of anchor"},{"line_number":441,"context_line":"    is the unique root providers of trees associated with the same aggregate"},{"line_number":442,"context_line":"    as the sharing provider. (These are the providers that can \"anchor\" a"},{"line_number":443,"context_line":"    single AllocationRequest.)"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_7baac519","line":440,"range":{"start_line":440,"start_character":61,"end_line":440,"end_character":68},"updated":"2018-05-18 21:12:18.000000000","message":"where each","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"bbd1d83541e8a5a2578462b57455e06756f295bb","unresolved":false,"context_lines":[{"line_number":437,"context_line":"@db_api.api_context_manager.reader"},{"line_number":438,"context_line":"def _anchors_for_sharing_provider(context, rp_ids, get_id\u003dFalse):"},{"line_number":439,"context_line":"    \"\"\"Given a list of internal IDs of sharing providers, returns a set of"},{"line_number":440,"context_line":"    tuples of (sharing provider UUID, anchor provider UUID), each of anchor"},{"line_number":441,"context_line":"    is the unique root providers of trees associated with the same aggregate"},{"line_number":442,"context_line":"    as the sharing provider. (These are the providers that can \"anchor\" a"},{"line_number":443,"context_line":"    single AllocationRequest.)"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_bd3927a4","line":440,"range":{"start_line":440,"start_character":61,"end_line":440,"end_character":68},"in_reply_to":"5f7c97a3_7baac519","updated":"2018-05-21 06:43:39.000000000","message":"Done","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":438,"context_line":"def _anchors_for_sharing_provider(context, rp_ids, get_id\u003dFalse):"},{"line_number":439,"context_line":"    \"\"\"Given a list of internal IDs of sharing providers, returns a set of"},{"line_number":440,"context_line":"    tuples of (sharing provider UUID, anchor provider UUID), each of anchor"},{"line_number":441,"context_line":"    is the unique root providers of trees associated with the same aggregate"},{"line_number":442,"context_line":"    as the sharing provider. (These are the providers that can \"anchor\" a"},{"line_number":443,"context_line":"    single AllocationRequest.)"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_3b620d18","line":441,"range":{"start_line":441,"start_character":23,"end_line":441,"end_character":41},"updated":"2018-05-18 21:12:18.000000000","message":"provider of a tree","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"bbd1d83541e8a5a2578462b57455e06756f295bb","unresolved":false,"context_lines":[{"line_number":438,"context_line":"def _anchors_for_sharing_provider(context, rp_ids, get_id\u003dFalse):"},{"line_number":439,"context_line":"    \"\"\"Given a list of internal IDs of sharing providers, returns a set of"},{"line_number":440,"context_line":"    tuples of (sharing provider UUID, anchor provider UUID), each of anchor"},{"line_number":441,"context_line":"    is the unique root providers of trees associated with the same aggregate"},{"line_number":442,"context_line":"    as the sharing provider. (These are the providers that can \"anchor\" a"},{"line_number":443,"context_line":"    single AllocationRequest.)"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_5d401308","line":441,"range":{"start_line":441,"start_character":23,"end_line":441,"end_character":41},"in_reply_to":"5f7c97a3_3b620d18","updated":"2018-05-21 06:43:39.000000000","message":"Done","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":443,"context_line":"    single AllocationRequest.)"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"    The sharing provider may or may not itself be part of a tree; in either"},{"line_number":446,"context_line":"    case, its root provider is included in the result."},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"    If the sharing provider is not part of any aggregate, the empty list is"},{"line_number":449,"context_line":"    returned."}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_bb75bdce","line":446,"range":{"start_line":446,"start_character":10,"end_line":446,"end_character":13},"updated":"2018-05-18 21:12:18.000000000","message":"an entry for its","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"bbd1d83541e8a5a2578462b57455e06756f295bb","unresolved":false,"context_lines":[{"line_number":443,"context_line":"    single AllocationRequest.)"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"    The sharing provider may or may not itself be part of a tree; in either"},{"line_number":446,"context_line":"    case, its root provider is included in the result."},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"    If the sharing provider is not part of any aggregate, the empty list is"},{"line_number":449,"context_line":"    returned."}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_7d438f14","line":446,"range":{"start_line":446,"start_character":10,"end_line":446,"end_character":13},"in_reply_to":"5f7c97a3_bb75bdce","updated":"2018-05-21 06:43:39.000000000","message":"Done","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":451,"context_line":"    If get_id is True, it returns a set of tuples of (sharing provider ID,"},{"line_number":452,"context_line":"    anchor provider ID) instead."},{"line_number":453,"context_line":"    \"\"\""},{"line_number":454,"context_line":"    # SELECT sps.uuid, COALESCE(rps.uuid, shr_with_sps.uuid)"},{"line_number":455,"context_line":"    # FROM resource_providers AS sps"},{"line_number":456,"context_line":"    # INNER JOIN resource_provider_aggregates AS shr_aggs"},{"line_number":457,"context_line":"    #   ON sps.id \u003d shr_aggs.resource_provider_id"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_9b7c81b6","line":454,"range":{"start_line":454,"start_character":13,"end_line":454,"end_character":60},"updated":"2018-05-18 21:12:18.000000000","message":"unless get_id...","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":2941,"context_line":"            rc_trees |\u003d set(p[1] for p in rc_provs_with_inv)"},{"line_number":2942,"context_line":"            provs_with_inv |\u003d rc_provs_with_inv"},{"line_number":2943,"context_line":""},{"line_number":2944,"context_line":"        # Filter trees_with_inv to have only trees with enough amount of"},{"line_number":2945,"context_line":"        # this resource class. Here \"tree\" includes sharing providers in"},{"line_number":2946,"context_line":"        # its terminology"},{"line_number":2947,"context_line":"        if trees_with_inv:"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_1b18717f","line":2944,"range":{"start_line":2944,"start_character":63,"end_line":2944,"end_character":69},"updated":"2018-05-18 21:12:18.000000000","message":"strike","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"bbd1d83541e8a5a2578462b57455e06756f295bb","unresolved":false,"context_lines":[{"line_number":2941,"context_line":"            rc_trees |\u003d set(p[1] for p in rc_provs_with_inv)"},{"line_number":2942,"context_line":"            provs_with_inv |\u003d rc_provs_with_inv"},{"line_number":2943,"context_line":""},{"line_number":2944,"context_line":"        # Filter trees_with_inv to have only trees with enough amount of"},{"line_number":2945,"context_line":"        # this resource class. Here \"tree\" includes sharing providers in"},{"line_number":2946,"context_line":"        # its terminology"},{"line_number":2947,"context_line":"        if trees_with_inv:"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_bd4fe768","line":2944,"range":{"start_line":2944,"start_character":63,"end_line":2944,"end_character":69},"in_reply_to":"5f7c97a3_1b18717f","updated":"2018-05-21 06:43:39.000000000","message":"I googled to know \"enough amount\" is incorrect English. Good to know, thanks!","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":2949,"context_line":"        else:"},{"line_number":2950,"context_line":"            trees_with_inv \u003d rc_trees"},{"line_number":2951,"context_line":""},{"line_number":2952,"context_line":"        if not trees_with_inv:"},{"line_number":2953,"context_line":"            return []"},{"line_number":2954,"context_line":""},{"line_number":2955,"context_line":"    # Select only those tuples where there are providers for all requested"},{"line_number":2956,"context_line":"    # resource classes (trees_with_inv contains the root provider IDs of those"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_9b032110","line":2953,"range":{"start_line":2952,"start_character":0,"end_line":2953,"end_character":21},"updated":"2018-05-18 21:12:18.000000000","message":"Don\u0027t think this needed to move, since you\u0027re still only ORing up to L2942.","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"bbd1d83541e8a5a2578462b57455e06756f295bb","unresolved":false,"context_lines":[{"line_number":2949,"context_line":"        else:"},{"line_number":2950,"context_line":"            trees_with_inv \u003d rc_trees"},{"line_number":2951,"context_line":""},{"line_number":2952,"context_line":"        if not trees_with_inv:"},{"line_number":2953,"context_line":"            return []"},{"line_number":2954,"context_line":""},{"line_number":2955,"context_line":"    # Select only those tuples where there are providers for all requested"},{"line_number":2956,"context_line":"    # resource classes (trees_with_inv contains the root provider IDs of those"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_7d594f33","line":2953,"range":{"start_line":2952,"start_character":0,"end_line":2953,"end_character":21},"in_reply_to":"5f7c97a3_9b032110","updated":"2018-05-21 06:43:39.000000000","message":"Well, if we don\u0027t move this, this would be a bugbear, I guess. Think about the case this for-loop-clause started with a resource class for which there is no resource provider. we should exit this loop returning an empty list but the actual on the base code would be moving to the next loop, which can return something else than an empty list.\n\nUnfortunately, we can\u0027t predict with which resource class this for loop starts (because of the uncertainty of the order of \"resource.items()\"), we can\u0027t create 100% test for this, so it is good to move this here, IMO.","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":3323,"context_line":""},{"line_number":3324,"context_line":"    This is a code path to get results for a RequestGroup with"},{"line_number":3325,"context_line":"    use_same_provider\u003dFalse. In this scenario, we determine requests across"},{"line_number":3326,"context_line":"    multiple providers being aware of both nested resource provider trees and"},{"line_number":3327,"context_line":"    sharing providers."},{"line_number":3328,"context_line":""},{"line_number":3329,"context_line":"    :param ctx: nova.context.RequestContext object"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_b63ab4ca","line":3326,"range":{"start_line":3326,"start_character":43,"end_line":3326,"end_character":50},"updated":"2018-05-18 21:12:18.000000000","message":"strike","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"bbd1d83541e8a5a2578462b57455e06756f295bb","unresolved":false,"context_lines":[{"line_number":3323,"context_line":""},{"line_number":3324,"context_line":"    This is a code path to get results for a RequestGroup with"},{"line_number":3325,"context_line":"    use_same_provider\u003dFalse. In this scenario, we determine requests across"},{"line_number":3326,"context_line":"    multiple providers being aware of both nested resource provider trees and"},{"line_number":3327,"context_line":"    sharing providers."},{"line_number":3328,"context_line":""},{"line_number":3329,"context_line":"    :param ctx: nova.context.RequestContext object"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_9d754b9b","line":3326,"range":{"start_line":3326,"start_character":43,"end_line":3326,"end_character":50},"in_reply_to":"5f7c97a3_b63ab4ca","updated":"2018-05-21 06:43:39.000000000","message":"This is the second strike. Assuming that three strikes I\u0027m out, I will be careful.\n\nDone.","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":3396,"context_line":"                summaries, prov_traits, required_traits, forbidden_traits)"},{"line_number":3397,"context_line":"            if (not all_prov_ids) or (all_prov_ids in alloc_prov_ids):"},{"line_number":3398,"context_line":"                # This combination doesn\u0027t satisfy trait constraints,"},{"line_number":3399,"context_line":"                # ...or we already have this permutation, which happens"},{"line_number":3400,"context_line":"                # when multiple sharing providers with different resource"},{"line_number":3401,"context_line":"                # classes are in one request."},{"line_number":3402,"context_line":"                continue"},{"line_number":3403,"context_line":"            alloc_prov_ids.append(all_prov_ids)"},{"line_number":3404,"context_line":"            alloc_requests.append("}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_96b45837","line":3401,"range":{"start_line":3399,"start_character":18,"end_line":3401,"end_character":45},"updated":"2018-05-18 21:12:18.000000000","message":"Couldn\u0027t there be legitimately distinct allocation requests with the same combination of providers, though?  For example, if we have two sharing providers with the same resource classes:\n\n CN:\n VCPU: 16\n\n SHR1:\n CUSTOM_RC1: 4\n CUSTOM_RC2: 8\n\n SHR2:\n CUSTOM_RC1: 6\n CUSTOM_RC2: 3\n\nWe ask for VCPU:1,CUSTOM_RC1:1,CUSTOM_RC2:1.  We should legitimately get the following two allocation requests (among others):\n\n AR(anchor\u003dCN, resource_requests\u003d[\n     ARR(rp\u003dCN, resources\u003d[VCPU: 1]),\n     ARR(rp\u003dSHR1, resources\u003d[CUSTOM_RC1: 1]),\n     ARR(rp\u003dSHR2, resources\u003d[CUSTOM_RC2: 1]),\n ])\n AR(anchor\u003dCN, resource_requests\u003d[\n     ARR(rp\u003dCN, resources\u003d[VCPU: 1]),\n     ARR(rp\u003dSHR1, resources\u003d[CUSTOM_RC2: 1]),\n     ARR(rp\u003dSHR2, resources\u003d[CUSTOM_RC1: 1]),\n ])\n\n...which will both equate to all_prov_ids of {CN, SHR1, SHR2} - and IIUC this check will filter out whichever one we see second.\n\nAm I missing something?","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"bbd1d83541e8a5a2578462b57455e06756f295bb","unresolved":false,"context_lines":[{"line_number":3396,"context_line":"                summaries, prov_traits, required_traits, forbidden_traits)"},{"line_number":3397,"context_line":"            if (not all_prov_ids) or (all_prov_ids in alloc_prov_ids):"},{"line_number":3398,"context_line":"                # This combination doesn\u0027t satisfy trait constraints,"},{"line_number":3399,"context_line":"                # ...or we already have this permutation, which happens"},{"line_number":3400,"context_line":"                # when multiple sharing providers with different resource"},{"line_number":3401,"context_line":"                # classes are in one request."},{"line_number":3402,"context_line":"                continue"},{"line_number":3403,"context_line":"            alloc_prov_ids.append(all_prov_ids)"},{"line_number":3404,"context_line":"            alloc_requests.append("}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_bd78478f","line":3401,"range":{"start_line":3399,"start_character":18,"end_line":3401,"end_character":45},"in_reply_to":"5f7c97a3_96b45837","updated":"2018-05-21 06:43:39.000000000","message":"OMG, that bug is also on the current master. Good catch.\nReported in https://bugs.launchpad.net/nova/+bug/1772243,\nthe test proposed in https://review.openstack.org/569637,\nthe fix proposed in https://review.openstack.org/#/c/569720/","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"45b13866ac8b7af854903bf77d8a28f1b9cc3fdb","unresolved":false,"context_lines":[{"line_number":430,"context_line":"def _anchors_for_sharing_providers(context, rp_ids, get_id\u003dFalse):"},{"line_number":431,"context_line":"    \"\"\"Given a list of internal IDs of sharing providers, returns a set of"},{"line_number":432,"context_line":"    tuples of (sharing provider UUID, anchor provider UUID), where each of"},{"line_number":433,"context_line":"    anchor is the unique root providers of a tree associated with the same"},{"line_number":434,"context_line":"    aggregate as the sharing provider. (These are the providers that can"},{"line_number":435,"context_line":"    \"anchor\" a single AllocationRequest.)"},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5f7c97a3_8eb981cc","line":433,"range":{"start_line":433,"start_character":30,"end_line":433,"end_character":39},"updated":"2018-06-06 20:39:39.000000000","message":"provider","commit_id":"182946e41062c82ed32eebf6f390056419abe7ba"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"8187922d1c4f884a48874af0c14aeb464c9dbdaa","unresolved":false,"context_lines":[{"line_number":430,"context_line":"def _anchors_for_sharing_providers(context, rp_ids, get_id\u003dFalse):"},{"line_number":431,"context_line":"    \"\"\"Given a list of internal IDs of sharing providers, returns a set of"},{"line_number":432,"context_line":"    tuples of (sharing provider UUID, anchor provider UUID), where each of"},{"line_number":433,"context_line":"    anchor is the unique root providers of a tree associated with the same"},{"line_number":434,"context_line":"    aggregate as the sharing provider. (These are the providers that can"},{"line_number":435,"context_line":"    \"anchor\" a single AllocationRequest.)"},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5f7c97a3_9b53efe2","line":433,"range":{"start_line":433,"start_character":30,"end_line":433,"end_character":39},"in_reply_to":"5f7c97a3_8eb981cc","updated":"2018-06-07 14:14:23.000000000","message":"Done","commit_id":"182946e41062c82ed32eebf6f390056419abe7ba"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ad9c819e3aa9593bd391f69adc82ec8dccf87da9","unresolved":false,"context_lines":[{"line_number":2883,"context_line":"    only provider with enough inventory of SRIOV_NET_VF but it does not have"},{"line_number":2884,"context_line":"    the required HW_NIC_OFFLOAD_GENEVE trait)."},{"line_number":2885,"context_line":""},{"line_number":2886,"context_line":"    :note: This function is used for scenarios that do NOT involve sharing"},{"line_number":2887,"context_line":"    providers AND where there are nested providers present in the deployment."},{"line_number":2888,"context_line":""},{"line_number":2889,"context_line":"    :param ctx: Session context to use"},{"line_number":2890,"context_line":"    :param resources: A dict, keyed by resource class ID, of the amount"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_5613eeb8","line":2887,"range":{"start_line":2886,"start_character":5,"end_line":2887,"end_character":14},"updated":"2018-06-07 16:49:55.000000000","message":"this is no longer correct.","commit_id":"068c56f55dffb60e7dd15b35001c280660c79229"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"9362745bd9896643c8e4936daa1ecfa451eab575","unresolved":false,"context_lines":[{"line_number":2883,"context_line":"    only provider with enough inventory of SRIOV_NET_VF but it does not have"},{"line_number":2884,"context_line":"    the required HW_NIC_OFFLOAD_GENEVE trait)."},{"line_number":2885,"context_line":""},{"line_number":2886,"context_line":"    :note: This function is used for scenarios that do NOT involve sharing"},{"line_number":2887,"context_line":"    providers AND where there are nested providers present in the deployment."},{"line_number":2888,"context_line":""},{"line_number":2889,"context_line":"    :param ctx: Session context to use"},{"line_number":2890,"context_line":"    :param resources: A dict, keyed by resource class ID, of the amount"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_a30c7439","line":2887,"range":{"start_line":2886,"start_character":5,"end_line":2887,"end_character":14},"in_reply_to":"5f7c97a3_5613eeb8","updated":"2018-06-08 01:51:51.000000000","message":"Done in https://review.openstack.org/#/c/573475/","commit_id":"068c56f55dffb60e7dd15b35001c280660c79229"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ad9c819e3aa9593bd391f69adc82ec8dccf87da9","unresolved":false,"context_lines":[{"line_number":2927,"context_line":"        if sharing_providers:"},{"line_number":2928,"context_line":"            # There are sharing providers for this resource class, so we"},{"line_number":2929,"context_line":"            # should also get combinations of (sharing provider, anchor root)"},{"line_number":2930,"context_line":"            # in addition to (nested provider, anchor root) we already have."},{"line_number":2931,"context_line":"            rc_provs_with_inv \u003d _anchors_for_sharing_providers("},{"line_number":2932,"context_line":"                                        ctx, sharing_providers, get_id\u003dTrue)"},{"line_number":2933,"context_line":"            rc_provs_with_inv \u003d set("}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_f666ba55","line":2930,"range":{"start_line":2930,"start_character":30,"end_line":2930,"end_character":36},"updated":"2018-06-07 16:49:55.000000000","message":"s/nested/non-sharing/","commit_id":"068c56f55dffb60e7dd15b35001c280660c79229"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"9362745bd9896643c8e4936daa1ecfa451eab575","unresolved":false,"context_lines":[{"line_number":2927,"context_line":"        if sharing_providers:"},{"line_number":2928,"context_line":"            # There are sharing providers for this resource class, so we"},{"line_number":2929,"context_line":"            # should also get combinations of (sharing provider, anchor root)"},{"line_number":2930,"context_line":"            # in addition to (nested provider, anchor root) we already have."},{"line_number":2931,"context_line":"            rc_provs_with_inv \u003d _anchors_for_sharing_providers("},{"line_number":2932,"context_line":"                                        ctx, sharing_providers, get_id\u003dTrue)"},{"line_number":2933,"context_line":"            rc_provs_with_inv \u003d set("}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_431b2072","line":2930,"range":{"start_line":2930,"start_character":30,"end_line":2930,"end_character":36},"in_reply_to":"5f7c97a3_f666ba55","updated":"2018-06-08 01:51:51.000000000","message":"ditto","commit_id":"068c56f55dffb60e7dd15b35001c280660c79229"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ad9c819e3aa9593bd391f69adc82ec8dccf87da9","unresolved":false,"context_lines":[{"line_number":2970,"context_line":"            return []"},{"line_number":2971,"context_line":"        provs_with_inv \u003d set(p for p in provs_with_inv if p[1] in rps_in_aggs)"},{"line_number":2972,"context_line":""},{"line_number":2973,"context_line":"    if (not required_traits and not forbidden_traits) or ("},{"line_number":2974,"context_line":"            any(sharing.values())):"},{"line_number":2975,"context_line":"        # If there were no traits required, there\u0027s no difference in how we"},{"line_number":2976,"context_line":"        # calculate allocation requests between nested and non-nested"},{"line_number":2977,"context_line":"        # environments, so just short-circuit and return. Or if sharing"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_80fcd7b5","line":2974,"range":{"start_line":2973,"start_character":53,"end_line":2974,"end_character":35},"updated":"2018-06-07 16:49:55.000000000","message":"I don\u0027t understand why this needed to change. If there are required traits or forbidden traits, we need to winnow the results returned by _get_trees_matching_all(). That fact isn\u0027t affected by whether sharing providers exist.\n\nThis is why I had specifically tried to have separate functions that did *not* deal with the complications of sharing providers when there was no need to deal with them, BTW. I had put the logic for handling sharing providers specifically in the _alloc_candidate_with_shared() function and kept that mess out of the other functions.\n\nThis patch (and the merge allocation candidates patches that have already merged) essentially undo that effort and are combining all those purpose-built functions that were made for the specific non-shared scenarios into just two functions for a single provider or multiple providers. This, IMHO, makes the easy path -- trying to find a place for simple request that don\u0027t involve granular request groups, don\u0027t involve nested providers or sharing providers -- virtually impossible to decipher any more. :(","commit_id":"068c56f55dffb60e7dd15b35001c280660c79229"}],"nova/tests/functional/api/openstack/placement/db/test_allocation_candidates.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":16,"id":"5f7c97a3_566480b9","updated":"2018-05-18 21:12:18.000000000","message":"So yeah, I\u0027d like to see a test case for the scenario I mentioned above: namely, where sharing providers have multiple resource classes in common and we ensure that we get all viable combinations.","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":1979,"context_line":"        req_traits \u003d {}"},{"line_number":1980,"context_line":"        forbidden_traits \u003d {}"},{"line_number":1981,"context_line":"        member_of \u003d []"},{"line_number":1982,"context_line":"        sharing \u003d {}"},{"line_number":1983,"context_line":""},{"line_number":1984,"context_line":"        # Before we even set up any providers, verify that the short-circuits"},{"line_number":1985,"context_line":"        # work to return empty lists"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_360464c6","line":1982,"range":{"start_line":1982,"start_character":8,"end_line":1982,"end_character":20},"updated":"2018-05-18 21:12:18.000000000","message":"To be clear, we\u0027re only testing _get_trees_matching_all with a real \u0027sharing\u0027 param via the full get_allocation_candidates tests below, right?","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"bbd1d83541e8a5a2578462b57455e06756f295bb","unresolved":false,"context_lines":[{"line_number":1979,"context_line":"        req_traits \u003d {}"},{"line_number":1980,"context_line":"        forbidden_traits \u003d {}"},{"line_number":1981,"context_line":"        member_of \u003d []"},{"line_number":1982,"context_line":"        sharing \u003d {}"},{"line_number":1983,"context_line":""},{"line_number":1984,"context_line":"        # Before we even set up any providers, verify that the short-circuits"},{"line_number":1985,"context_line":"        # work to return empty lists"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_fd4ebf36","line":1982,"range":{"start_line":1982,"start_character":8,"end_line":1982,"end_character":20},"in_reply_to":"5f7c97a3_360464c6","updated":"2018-05-21 06:43:39.000000000","message":"So far, right. But we need more and more testing work needed.","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":2175,"context_line":"            resources, req_traits, forbidden_traits, sharing, member_of)"},{"line_number":2176,"context_line":"        self.assertEqual([], trees)"},{"line_number":2177,"context_line":""},{"line_number":2178,"context_line":"    def test_simple_tree_with_shared_provider(self):"},{"line_number":2179,"context_line":"        \"\"\"Tests that we properly winnow allocation requests when including"},{"line_number":2180,"context_line":"        shared and nested providers"},{"line_number":2181,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_f6db4c4c","line":2178,"updated":"2018-05-18 21:12:18.000000000","message":"This doesn\u0027t exercise the changes you made to _anchors_for_sharing_provider.  (Perhaps that\u0027s covered implicitly elsewhere?)","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"bbd1d83541e8a5a2578462b57455e06756f295bb","unresolved":false,"context_lines":[{"line_number":2175,"context_line":"            resources, req_traits, forbidden_traits, sharing, member_of)"},{"line_number":2176,"context_line":"        self.assertEqual([], trees)"},{"line_number":2177,"context_line":""},{"line_number":2178,"context_line":"    def test_simple_tree_with_shared_provider(self):"},{"line_number":2179,"context_line":"        \"\"\"Tests that we properly winnow allocation requests when including"},{"line_number":2180,"context_line":"        shared and nested providers"},{"line_number":2181,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_bd6287ac","line":2178,"in_reply_to":"5f7c97a3_f6db4c4c","updated":"2018-05-21 06:43:39.000000000","message":"It does via _get_trees_matching_all() via _get_allocation_candidates(), or am I missing something?","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":2266,"context_line":"            \u0027cn1\u0027: set(["},{"line_number":2267,"context_line":"                (fields.ResourceClass.VCPU, 16, 0)"},{"line_number":2268,"context_line":"            ]),"},{"line_number":2269,"context_line":"        # NOTE(tetsuro): In summary, we\u0027d like to expose all nested providers"},{"line_number":2270,"context_line":"        # in the tree."},{"line_number":2271,"context_line":"        #     \u0027cn1_numa0\u0027: set([])"},{"line_number":2272,"context_line":"        #     \u0027cn1_numa1\u0027: set([])"},{"line_number":2273,"context_line":"            \u0027cn1_numa0_pf0\u0027: set(["},{"line_number":2274,"context_line":"                (fields.ResourceClass.SRIOV_NET_VF, 8, 0)"},{"line_number":2275,"context_line":"            ]),"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_563b209b","line":2272,"range":{"start_line":2269,"start_character":8,"end_line":2272,"end_character":34},"updated":"2018-05-18 21:12:18.000000000","message":"This is a weird indent.  But if pep doesn\u0027t care...","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"bbd1d83541e8a5a2578462b57455e06756f295bb","unresolved":false,"context_lines":[{"line_number":2266,"context_line":"            \u0027cn1\u0027: set(["},{"line_number":2267,"context_line":"                (fields.ResourceClass.VCPU, 16, 0)"},{"line_number":2268,"context_line":"            ]),"},{"line_number":2269,"context_line":"        # NOTE(tetsuro): In summary, we\u0027d like to expose all nested providers"},{"line_number":2270,"context_line":"        # in the tree."},{"line_number":2271,"context_line":"        #     \u0027cn1_numa0\u0027: set([])"},{"line_number":2272,"context_line":"        #     \u0027cn1_numa1\u0027: set([])"},{"line_number":2273,"context_line":"            \u0027cn1_numa0_pf0\u0027: set(["},{"line_number":2274,"context_line":"                (fields.ResourceClass.SRIOV_NET_VF, 8, 0)"},{"line_number":2275,"context_line":"            ]),"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_37cbf053","line":2272,"range":{"start_line":2269,"start_character":8,"end_line":2272,"end_character":34},"in_reply_to":"5f7c97a3_563b209b","updated":"2018-05-21 06:43:39.000000000","message":"Oops. I will be careful next time. This comment out disappears in https://review.openstack.org/#/c/559480/19.","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":2297,"context_line":"        )"},{"line_number":2298,"context_line":""},{"line_number":2299,"context_line":"        # cn1_numa0_pf0 is not in the allocation candidates because it"},{"line_number":2300,"context_line":"        # doesn\u0027t have enough required traits."},{"line_number":2301,"context_line":"        expected \u003d ["},{"line_number":2302,"context_line":"            [(\u0027cn1\u0027, fields.ResourceClass.VCPU, 2),"},{"line_number":2303,"context_line":"             (\u0027cn1_numa1_pf1\u0027, fields.ResourceClass.SRIOV_NET_VF, 1),"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_f6582cfb","line":2300,"range":{"start_line":2300,"start_character":23,"end_line":2300,"end_character":46},"updated":"2018-05-18 21:12:18.000000000","message":"the required trait","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"}],"nova/tests/functional/api/openstack/placement/db/test_resource_provider.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"605cd39107d82841dff62787b7cd72affaaebd35","unresolved":false,"context_lines":[{"line_number":1040,"context_line":"        expected \u003d set([(s5.uuid, rp.uuid) for rp in (s5, r1, r2, s1)])"},{"line_number":1041,"context_line":"        self.assertItemsEqual("},{"line_number":1042,"context_line":"            expected, rp_obj._anchors_for_sharing_provider(self.ctx, [s5.id]))"},{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":""},{"line_number":1045,"context_line":"class TestAllocation(tb.PlacementDbBaseTestCase):"},{"line_number":1046,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_d6f410d2","line":1043,"updated":"2018-05-18 21:12:18.000000000","message":"Need a test where you pass in multiple IDs.  It should be easy to do with the current setup - just pass in [s1..5] and you should get back the union of all the tuples in the previous assertions.","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"bbd1d83541e8a5a2578462b57455e06756f295bb","unresolved":false,"context_lines":[{"line_number":1040,"context_line":"        expected \u003d set([(s5.uuid, rp.uuid) for rp in (s5, r1, r2, s1)])"},{"line_number":1041,"context_line":"        self.assertItemsEqual("},{"line_number":1042,"context_line":"            expected, rp_obj._anchors_for_sharing_provider(self.ctx, [s5.id]))"},{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":""},{"line_number":1045,"context_line":"class TestAllocation(tb.PlacementDbBaseTestCase):"},{"line_number":1046,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_d7babcbe","line":1043,"in_reply_to":"5f7c97a3_d6f410d2","updated":"2018-05-21 06:43:39.000000000","message":"Done.","commit_id":"1a8420648c52f747b98c274132742aae9cf1275c"}]}
