From 35266fadb09d9e986af1af2c03cd979baa2ba8fa Mon Sep 17 00:00:00 2001 From: "Patel, Ankitkumar" Date: Tue, 29 May 2018 12:34:06 -0400 Subject: 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 --- osdf/optimizers/placementopt/conductor/translation.py | 5 +++-- 1 file 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 -- cgit 1.2.3-korg