diff options
author | Dileep Ranganathan <dileep.ranganathan@intel.com> | 2018-09-19 23:14:36 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-09-19 23:14:36 +0000 |
commit | 530f19600fd9ee0f9eeab05473c85a83b61f50c3 (patch) | |
tree | 933e6d00161df898a903f18e77a260a7f31b96a6 | |
parent | 3adff074aceb0b73344820f97833d5526841c403 (diff) | |
parent | 794c278828c1c9682351755984ce5dd79d7c5223 (diff) |
Merge "Changes while processing optimation policy"
-rw-r--r-- | osdf/optimizers/placementopt/conductor/translation.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/osdf/optimizers/placementopt/conductor/translation.py b/osdf/optimizers/placementopt/conductor/translation.py index 6e42ba2..76cbabd 100644 --- a/osdf/optimizers/placementopt/conductor/translation.py +++ b/osdf/optimizers/placementopt/conductor/translation.py @@ -54,12 +54,13 @@ def gen_optimization_policy(vnf_list, optimization_policy): for policy in optimization_policy: content = policy['content'] parameter_list = [] + parameters = ["cloud_version"] for attr in content['objectiveParameter']['parameterAttributes']: - parameter = attr['parameter'] if attr['parameter'] == "cloud_version" else attr['parameter']+"_between" + parameter = attr['parameter'] if attr['parameter'] in parameters else attr['parameter']+"_between" vnfs = get_matching_vnfs(attr['resources'], vnf_list) for vnf in vnfs: - value = [vnf] if attr['parameter'] == "cloud_version" else [attr['customerLocationInfo'], vnf] + value = [vnf] if attr['parameter'] in parameters else [attr['customerLocationInfo'], vnf] parameter_list.append({ attr['operator']: [attr['weight'], {parameter: value}] }) |