summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting
diff options
context:
space:
mode:
authorBill Schwartz <whs@us.ibm.com>2014-01-20 20:25:11 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-01-23 20:52:08 -0600
commite7edc42226e4febc01c1936b67e38ac40479e704 (patch)
tree007e541e2b9f79723427561a48747e23e108d9eb /src/usr/targeting
parentfdddc4a4fd53786c2b0ba3566789ccba4499f5d3 (diff)
downloadtalos-hostboot-e7edc42226e4febc01c1936b67e38ac40479e704.tar.gz
talos-hostboot-e7edc42226e4febc01c1936b67e38ac40479e704.zip
Catch duplicate attributes defined in _fsp.xml/_hb.xml and common xml
Add error check in xmltohb.pl to catch IDs defined multiple times. Change-Id: I5b246325b873498791a53d0f255b0c2c0339df83 RTC: 90389 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/8168 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/targeting')
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/xmltohb.pl14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl
index a79655409..19a004463 100755
--- a/src/usr/targeting/common/xmltohb/xmltohb.pl
+++ b/src/usr/targeting/common/xmltohb/xmltohb.pl
@@ -6,7 +6,7 @@
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011,2013
+# COPYRIGHT International Business Machines Corp. 2011,2014
#
# p1
#
@@ -3440,15 +3440,25 @@ sub getAttributeIdEnumeration {
{
my $attributeHexVal28bit = getAttributeIdHashStr($attribute->{id});
+ # check if this Id has already been processed
if(exists($attrValHash{$attributeHexVal28bit}))
{
- # if the name is the same, skip it
+ # fatal error if multiple IDs hash to same value
if ( $attribute->{id} ne $attrValHash{$attributeHexVal28bit} )
{
fatal(
"Error:Duplicate AttributeId hashvalue for $attribute->{id} "
. "and $attrValHash{$attributeHexVal28bit}");
}
+ # fatal error if attribute has been defined more than once.
+ # Could be defined twice in same file or defined in two files
+ # that have been merged, such as attributes_types.xml and
+ # attribute_types_hb.xml or attributes_types_fsp.
+ else
+ {
+ fatal("Error: AttributeId $attribute->{id} "
+ . "defined multiple times");
+ }
}
else
{
OpenPOWER on IntegriCloud