aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatel, Ankitkumar <ankit@research.att.com>2018-05-29 12:34:06 -0400
committerPatel, Ankitkumar <ankit@research.att.com>2018-05-29 12:37:16 -0400
commit35266fadb09d9e986af1af2c03cd979baa2ba8fa (patch)
tree5f001b0e30e616674ca0723529f22f8b515073f5
parent49a0eac16462c04c285125686fb235c22c9ad607 (diff)
Fix to remove resources with no policies
Fix to remove resources with no policies from the HAS template Issue-ID: OPTFRA-247 Change-Id: I8762a5ac13038406d74ee2806a52f78b6df697a2 Signed-off-by: Patel, Ankitkumar <ankit@research.att.com>
-rw-r--r--osdf/optimizers/placementopt/conductor/translation.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/osdf/optimizers/placementopt/conductor/translation.py b/osdf/optimizers/placementopt/conductor/translation.py
index f1c12c8..6e42ba2 100644
--- a/osdf/optimizers/placementopt/conductor/translation.py
+++ b/osdf/optimizers/placementopt/conductor/translation.py
@@ -247,6 +247,7 @@ def gen_demands(req_json, vnf_policies):
"""
demand_dictionary = {}
for demand in req_json['placementInfo']['placementDemands']:
- demand_dictionary.update(
- {demand['resourceModuleName']: get_demand_properties(demand, vnf_policies)})
+ prop = get_demand_properties(demand, vnf_policies)
+ if len(prop) > 0:
+ demand_dictionary.update({demand['resourceModuleName']: prop})
return demand_dictionary