summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/common/xmltohb/xmltohb.pl
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2013-11-22 11:10:04 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-12-03 13:50:28 -0600
commitc38de5ef9f27b3d6f21d838597adcbf1aec15ab7 (patch)
treed06e24bc7ac2fc8d9dc76ea108aa99ce0fe18425 /src/usr/targeting/common/xmltohb/xmltohb.pl
parent73f53442ca13fdfef1225fa0e761e066c3623454 (diff)
downloadtalos-hostboot-c38de5ef9f27b3d6f21d838597adcbf1aec15ab7.tar.gz
talos-hostboot-c38de5ef9f27b3d6f21d838597adcbf1aec15ab7.zip
Fix ordering of targets in multi-node
Change-Id: I5ec4300a351315572f90f83914e3b664b495f8bd CQ: SW235426 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7392 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.pl30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl
index 2a59338b8..0a64c5b08 100755
--- a/src/usr/targeting/common/xmltohb/xmltohb.pl
+++ b/src/usr/targeting/common/xmltohb/xmltohb.pl
@@ -5042,28 +5042,34 @@ sub generateTargetingImage {
my @targetsAoH = ();
my $targetCount = 0;
my $moveSysTarget = 0;
+ my $targetSystemInstance = 0;
+ my $targetNodeInstance = 0;
+ my $targetSysCnt = 0;
+ my $targetNodeCnt = 0;
# To support the iterator code, we dont want sys target to be the
# first in order. So we have specifically moved system target to second,
- # if it is in first place.
+ # and the first place has been reserved by a node target for all binaries.
foreach my $targetInstance (@{$attributes->{targetInstance}})
{
- # for the first Target, check if Sys Target
- if(($targetCount == 0) && ($targetInstance->{id} eq "sys0"))
+ if(($targetInstance->{type} =~ m/^sys-sys-/) && ($targetSysCnt == 0))
{
- # mark a flag here that we need to interchange 1&2 targets,
- # so as to push system target to second place
- $moveSysTarget = 1;
- $targetCount = $targetCount + 1;
+ $targetSysCnt = 1;
+ $targetSystemInstance = $targetInstance;
+ next;
+ }
+ elsif(($targetInstance->{type} eq "enc-node-power8") && ($targetNodeCnt == 0))
+ {
+ $targetNodeCnt = 1;
+ $targetNodeInstance = $targetInstance;
+ next;
}
push(@targetsAoH, $targetInstance);
}
- if($moveSysTarget == 1)
- {
- @targetsAoH[0,1] = @targetsAoH[1,0];
- }
- my $numTargets = @targetsAoH;
+ unshift(@targetsAoH, $targetSystemInstance);
+ unshift(@targetsAoH, $targetNodeInstance);
+ my $numTargets = @targetsAoH;
my $numAttributes = 0;
foreach my $targetInstance (@targetsAoH)
{
OpenPOWER on IntegriCloud