From: Chayal, Avteet (ac229e) Date: Tue, 12 Feb 2019 18:37:26 +0000 (+0000) Subject: Fix to populate missing fields in request to HAS X-Git-Tag: 1.3.0~16 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F26%2F78326%2F1;p=optf%2Fosdf.git Fix to populate missing fields in request to HAS Populate requiredCandidates and excludedCandidates for HAS Issue-ID: OPTFRA-438 Change-Id: I23702a572ce3645aa52d27e7a8d58f775349cbb8 Signed-off-by: Chayal, Avteet (ac229e) --- diff --git a/config/has_config.yaml b/config/has_config.yaml index 9200daf..cf8a80c 100644 --- a/config/has_config.yaml +++ b/config/has_config.yaml @@ -18,9 +18,9 @@ policy_config_mapping: model-version-id: modelVersionId candidates: # for (k1, v1), if k1 is in demand, set prop[k2] = _get_candidates(demand[k1]) - exclusionCandidateInfo: excluded_candidates, - requiredCandidateInfo: required_candidates + excludedCandidates: excluded_candidates, + requiredCandidates: required_candidates extra_fields: # we have [k1, k2, k3, k4] type items and x is policy-content-properties # if x[k1] == k2: set prop[k3] = k4 - - [inventoryType, cloud, region, {get_param: CHOSEN_REGION}] \ No newline at end of file + - [inventoryType, cloud, region, {get_param: CHOSEN_REGION}] diff --git a/osdf/optimizers/placementopt/conductor/translation.py b/osdf/optimizers/placementopt/conductor/translation.py index f74f461..93b80bf 100644 --- a/osdf/optimizers/placementopt/conductor/translation.py +++ b/osdf/optimizers/placementopt/conductor/translation.py @@ -205,7 +205,7 @@ def get_candidates_demands(demand): for k, v in policy_config_mapping['candidates'].items(): if k not in demand: continue - res[v] = [{'inventory_type': x['candidateType'], 'candidate_id': x['candidates']} for x in demand[k]] + res[v] = [{'inventory_type': x['identifierType'], 'candidate_id': x['identifiers']} for x in demand[k]] return res