diff options
author | Nick Bofferding <bofferdn@us.ibm.com> | 2013-10-10 09:42:58 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-10-10 21:56:48 -0500 |
commit | 59108ff30a458e124b5d6ab489f7e6d502ff65aa (patch) | |
tree | 6a9d24dc175dfab06513ffb1c673b80ec0bb1053 /src | |
parent | b5ab69e7d4026ff821b1321d599f22d75397756a (diff) | |
download | talos-hostboot-59108ff30a458e124b5d6ab489f7e6d502ff65aa.tar.gz talos-hostboot-59108ff30a458e124b5d6ab489f7e6d502ff65aa.zip |
Tolerate multiple compile attributes per target instance
- Modded attr compiler to support multiple compile attr per target instance
Change-Id: Ifc5b0acbf12b12a635555a4bdbd7fa598983280a
CMVC: 901167
CQ: SW227422
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6613
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/usr/targeting/common/xmltohb/xmltohb.pl | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index 27789bee5..75b37e6ca 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -126,7 +126,8 @@ use Digest::MD5 qw(md5_hex); # use the intermediate representation containing the full host boot model. # Aborts application if file name not found. my $attributes = $xml->XMLin($cfgHbXmlFile, - forcearray => ['enumerationType','attribute','hwpfToHbAttrMap']); + forcearray => ['enumerationType','attribute','hwpfToHbAttrMap', + 'compileAttribute']); my $fapiAttributes = {}; if ($cfgFapiAttributesXmlFile ne "") { @@ -586,25 +587,19 @@ sub getPeerHuid { my($targetInstance) = @_; - my $peerHUID = INVALID_HUID; - if(exists $targetInstance->{compileAttribute}->{id}) + my $peerHUID = PEER_HUID_NOT_PRESENT; + if(exists $targetInstance->{compileAttribute}) { - if ($targetInstance->{compileAttribute}->{id} eq "PEER_HUID") + foreach my $compileAttribute (@{$targetInstance->{compileAttribute}}) { - $peerHUID = $targetInstance->{compileAttribute}->{default}; - } - else - { - fatal("We should have only PEER_HUID as compileAttribute. " - . "Don't know how to handle this Attribute " - . "$targetInstance->{compileAttribute}->{id}\n"); + if($compileAttribute->{id} eq "PEER_HUID") + { + $peerHUID = $compileAttribute->{default}; + last; + } } } - else - { - # PEER HUID doesn't exist, Return an pre-defined HUID which is invalid - $peerHUID = PEER_HUID_NOT_PRESENT; - } + return $peerHUID; } |