summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--osdf/optimizers/placementopt/conductor/translation.py2
-rw-r--r--test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Placement_Optimization_1.json6
-rw-r--r--test/policy-local-files/Placement_Optimization_1.json6
3 files changed, 13 insertions, 1 deletions
diff --git a/osdf/optimizers/placementopt/conductor/translation.py b/osdf/optimizers/placementopt/conductor/translation.py
index 76cbabd..d856a22 100644
--- a/osdf/optimizers/placementopt/conductor/translation.py
+++ b/osdf/optimizers/placementopt/conductor/translation.py
@@ -54,7 +54,7 @@ def gen_optimization_policy(vnf_list, optimization_policy):
for policy in optimization_policy:
content = policy['content']
parameter_list = []
- parameters = ["cloud_version"]
+ parameters = ["cloud_version", "hpa_score"]
for attr in content['objectiveParameter']['parameterAttributes']:
parameter = attr['parameter'] if attr['parameter'] in parameters else attr['parameter']+"_between"
diff --git a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Placement_Optimization_1.json b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Placement_Optimization_1.json
index b81b15f..ab3c586 100644
--- a/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Placement_Optimization_1.json
+++ b/test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Placement_Optimization_1.json
@@ -24,6 +24,12 @@
"parameter": "distance",
"weight": "1",
"operator": "product"
+ },
+ {
+ "resources": ["vG"],
+ "parameter": "hpa_score",
+ "weight": "200",
+ "operator": "product"
}
],
"operator": "sum"
diff --git a/test/policy-local-files/Placement_Optimization_1.json b/test/policy-local-files/Placement_Optimization_1.json
index b81b15f..ab3c586 100644
--- a/test/policy-local-files/Placement_Optimization_1.json
+++ b/test/policy-local-files/Placement_Optimization_1.json
@@ -24,6 +24,12 @@
"parameter": "distance",
"weight": "1",
"operator": "product"
+ },
+ {
+ "resources": ["vG"],
+ "parameter": "hpa_score",
+ "weight": "200",
+ "operator": "product"
}
],
"operator": "sum"