Commit 1a835c3a authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Merge branch 'OCF138-fixes-discover-api-supported-feature-negotiation' into 'staging'

Add inversion and change order of supported features in return bracket

See merge request !118
parents 02fd8276 cbf9f71a
Loading
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ def all_service_apis_get(api_invoker_id, api_name=None, api_version=None, comm_t

    if supported_features is not None:
        supp_feat_dict = return_negotiated_supp_feat_dict(supported_features)
        current_app.logger.info(supp_feat_dict)
        if supp_feat_dict['VendSpecQueryParams']:
            for q_params in request.args:
                if "vend-spec" in q_params:
+5 −5
Original line number Diff line number Diff line
@@ -29,13 +29,13 @@ def filter_fields(filtered_apis):

def return_negotiated_supp_feat_dict(supp_feat):

    final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)
    final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1]

    return {
        "ApiSupportedFeatureQuery": True if final_supp_feat[3] == "1" else False,
        "VendSpecQueryParams": True if final_supp_feat[2] == "1" else False,
        "RNAA": True if final_supp_feat[1] == "1" else False,
        "SliceBasedAPIExposure": True if final_supp_feat[0] == "1" else False
        "ApiSupportedFeatureQuery": True if final_supp_feat[0] == "1" else False,
        "VendSpecQueryParams": True if final_supp_feat[1] == "1" else False,
        "RNAA": True if final_supp_feat[2] == "1" else False,
        "SliceBasedAPIExposure": True if final_supp_feat[3] == "1" else False
    }