summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/common/filter_out_unwanted_attributes.pl
diff options
context:
space:
mode:
authorPrachi Gupta <pragupta@us.ibm.com>2017-05-11 22:33:08 -0500
committerPrachi Gupta <pragupta@us.ibm.com>2017-05-12 14:52:35 -0400
commitbd8f72be81ad3204b0fb7f07d6b4b2a32af96bb5 (patch)
tree089c96428039ccf273338371f6080494fa8a4169 /src/usr/targeting/common/filter_out_unwanted_attributes.pl
parentd0d7f52ac42012646f78a32702ab46b6688fe5ad (diff)
downloadtalos-hostboot-bd8f72be81ad3204b0fb7f07d6b4b2a32af96bb5.tar.gz
talos-hostboot-bd8f72be81ad3204b0fb7f07d6b4b2a32af96bb5.zip
adding IPMI_SENSOR to p9 occ target
Change-Id: I7f86236f2ca4189c028ed30382db0045ee5c81e3 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40426 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Matthew A. Ploetz <maploetz@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.pl32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/usr/targeting/common/filter_out_unwanted_attributes.pl b/src/usr/targeting/common/filter_out_unwanted_attributes.pl
index f8f3d80a0..df4d31c70 100755
--- a/src/usr/targeting/common/filter_out_unwanted_attributes.pl
+++ b/src/usr/targeting/common/filter_out_unwanted_attributes.pl
@@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2016
+# Contributors Listed Below - COPYRIGHT 2016,2017
# [+] International Business Machines Corp.
#
#
@@ -84,7 +84,7 @@ foreach my $i (0 .. $#tgt_files)
print "Loading TGT XML: $tgt_file in $i\n";
$tgt_xmls[$i] =
XMLin($tgt_file,
- forcearray => ['attribute', 'targetType', 'field']);
+ forcearray => ['attribute', 'targetType', 'field', 'targetTypeExtension']);
}
#Load MRW XML
@@ -137,7 +137,21 @@ sub findAttribute
foreach my $i (0 .. $#tgt_xmls)
{
my $tgt_xml = $tgt_xmls[$i];
- if (defined $tgt_xml->{targetType}{$tgt}{attribute}{$attr})
+ my $targetType;
+ if (defined $tgt_xml->{targetType})
+ {
+ $targetType = "targetType";
+ }
+ elsif (defined $tgt_xml->{targetTypeExtension})
+ {
+ $targetType = "targetTypeExtension";
+ }
+ else
+ {
+ next;
+ }
+
+ if (defined $tgt_xml->{$targetType}{$tgt}{attribute}{$attr})
{
#attribute found under the passed in target in this xml
return 1;
@@ -147,7 +161,7 @@ sub findAttribute
my %tgt_hash = %$tgt_xml;
#if not found in this target, look under parent target
#some targets are inherrited
- if (lookAtParentAttributes (\%tgt_hash, $tgt, $attr) eq 1)
+ if (lookAtParentAttributes (\%tgt_hash, $tgt, $attr, $targetType) eq 1)
{
return 1;
}
@@ -165,21 +179,21 @@ sub findAttribute
# retval: true == attr found, false == attr not found
sub lookAtParentAttributes
{
- my ($tgt_xml, $tgt, $attr) = @_;
+ my ($tgt_xml, $tgt, $attr, $targetType) = @_;
- my $parent = $tgt_xml->{targetType}{$tgt}{parent};
+ my $parent = $tgt_xml->{$targetType}{$tgt}{parent};
if ($parent eq "")
{
return 0;
}
elsif ($parent eq "base")
{
- return (defined $tgt_xml->{targetType}{$parent}{attribute}{$attr}) ?
+ return (defined $tgt_xml->{$targetType}{$parent}{attribute}{$attr}) ?
1 : 0;
}
else
{
- if (defined $tgt_xml->{targetType}{$parent}{attribute}{$attr})
+ if (defined $tgt_xml->{$targetType}{$parent}{attribute}{$attr})
{
return 1;
}
@@ -191,7 +205,7 @@ sub lookAtParentAttributes
#We will look until we find the attribute, or there is no parent
#(parent == "") or we have reached the "base" target
#"base" is the topmost target defined in target_type xml
- return lookAtParentAttributes(\%tgt_hash, $parent, $attr);
+ return lookAtParentAttributes(\%tgt_hash, $parent, $attr, $targetType);
}
}
}
OpenPOWER on IntegriCloud