From 06ab2e627dd98d9dff61c41b0c429770e69764ea Mon Sep 17 00:00:00 2001 From: yangsong Date: Mon, 10 Jul 2017 02:57:32 -0500 Subject: [PATCH] fix issue [CORAL]incorrect petitboot configuration for nodeset shell in flat hierarchical #3414 (#3419) --- xCAT-server/lib/xcat/plugins/destiny.pm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index ba55424f8..6d3aaae6f 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -490,12 +490,27 @@ sub setdestiny { my $ent = $resents->{$_}->[0]; #$restab->getNodeAttribs($_,[qw(xcatmaster)]); my $master; my $kcmdline = "quiet "; - if (defined($master_entry)) { - $master = $master_entry; - } + + #the node.xcatmaster take precedence if ($ent and $ent->{xcatmaster}) { $master = $ent->{xcatmaster}; } + + #if node.xcatmaster not specified, take the ip address facing the node + unless($master){ + my @nxtsrvd = xCAT::NetworkUtils->my_ip_facing($_); + unless ($nxtsrvd[0]) { + $master = $nxtsrvd[1]; + } + } + + #the site.master takes the last precedence + unless($master){ + if (defined($master_entry)) { + $master = $master_entry; + } + } + $ent = $hments->{$_}->[0]; #$nodehm->getNodeAttribs($_,['serialport','serialspeed','serialflow']); if ($ent and defined($ent->{serialport})) { if ($arch eq "ppc64") {