summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/common/xmltohb/xmltohb.pl
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2014-04-04 18:52:27 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-04-05 10:28:47 -0500
commit57d3aca70243a1bd42467e204e90e7e528a7a514 (patch)
treeca51b5b936c8fe28bfaddfee6ffc4a38708203e8 /src/usr/targeting/common/xmltohb/xmltohb.pl
parent51122a9be84c74006c73009c706d726664c79cd8 (diff)
downloadtalos-hostboot-57d3aca70243a1bd42467e204e90e7e528a7a514.tar.gz
talos-hostboot-57d3aca70243a1bd42467e204e90e7e528a7a514.zip
Handle strings in Targeting XML <default> fields appropriately
Change-Id: I1acafe4f7623b5220a2f1dad11f8570af4bd44ca CQ: SW255643 Backport: release-fips810 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/10162 Tested-by: Jenkins Server Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/common/xmltohb/xmltohb.pl')
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/xmltohb.pl22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl
index 695ade7f5..843bdd0eb 100755
--- a/src/usr/targeting/common/xmltohb/xmltohb.pl
+++ b/src/usr/targeting/common/xmltohb/xmltohb.pl
@@ -4517,6 +4517,28 @@ sub packSingleSimpleTypeAttribute {
$simpleTypeProperties->{$typeName}{specialPolicies}->($$attributeRef,
$value);
+ if ($value eq 'true')
+ {
+ $value = 1;
+ }
+ elsif ($value eq 'false')
+ {
+ $value = 0;
+ }
+
+ if( ($simpleTypeProperties->{$typeName}{complexTypeSupport}) &&
+ ($value =~ m/[^0-9]/) )
+ {
+ # This is a type that supports complex types - i.e. an integer and
+ # the value is a string. Look for an enumeration named after the
+ # attribute id, if one is not found then one of the function calls
+ # below will exit with error
+ my $enumeration = getEnumerationType($$attributesRef,
+ $$attributeRef->{id});
+
+ $value = enumNameToValue($enumeration, $value);
+ }
+
if(ref ($simpleTypeProperties->{$typeName}{packfmt}) eq "CODE")
{
$$binaryDataRef .= $simpleTypeProperties->{$typeName}{packfmt}->
OpenPOWER on IntegriCloud