summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/common/filter_out_unwanted_attributes.pl
diff options
context:
space:
mode:
authorSantosh Puranik <santosh.puranik@in.ibm.com>2017-09-06 14:19:06 +0530
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-09-06 11:21:31 -0400
commit9e01538769fb0365fc07e1b9c3dcfa7a12ed953b (patch)
treed1319ee0200bc49250c3480a460b3c497112be7a /src/usr/targeting/common/filter_out_unwanted_attributes.pl
parent072958051766cb5839ea39584c713697966f40a4 (diff)
downloadtalos-hostboot-9e01538769fb0365fc07e1b9c3dcfa7a12ed953b.tar.gz
talos-hostboot-9e01538769fb0365fc07e1b9c3dcfa7a12ed953b.zip
Fix empty targets from filter script
Do not output target to the output XML if the target type is not found in input filter XMLs. Change-Id: I668145528b0128ce134b0fcfe2e9f9f623297ded Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45691 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Sakethan R. Kotta <sakkotta@in.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/common/filter_out_unwanted_attributes.pl')
-rwxr-xr-xsrc/usr/targeting/common/filter_out_unwanted_attributes.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/usr/targeting/common/filter_out_unwanted_attributes.pl b/src/usr/targeting/common/filter_out_unwanted_attributes.pl
index 1c3397a96..ab6ab99c8 100755
--- a/src/usr/targeting/common/filter_out_unwanted_attributes.pl
+++ b/src/usr/targeting/common/filter_out_unwanted_attributes.pl
@@ -233,6 +233,14 @@ foreach my $tgt
{
my $tgt_type = $tgt->findnodes('./type');
+ if(!defined $tgt_xmls->{'targetType'}->{$tgt_type})
+ {
+ print "Target of type: $tgt_type not found in the merged target XML!\n";
+ print "Removing target $tgt\n";
+ $tgt->unbindNode();
+ next;
+ }
+
#foreach attribute defined in this target
foreach my $attr ($tgt->findnodes('./attribute'))
{
OpenPOWER on IntegriCloud