Merge branch '2.8' of ssh://git.code.sf.net/p/xcat/xcat-core into 2.8

This commit is contained in:
Jarrod Johnson 2013-08-08 16:26:53 -04:00
commit 18db706c89
6 changed files with 89 additions and 55 deletions

14
README
View File

@ -1,14 +0,0 @@
xCAT - eXtreme Cloud Administration Toolkit
xCAT is a toolkit for the deployment and administration of clusters.
xCAT documentation is available at: http://xcat.sourceforge.net/
xCAT is made available as open source software under the EPL license:
http://www.opensource.org/licenses/eclipse-1.0.php

View File

@ -178,7 +178,7 @@ sub subvars {
my $source_in_pre;
my $c = 0;
foreach my $pkgdir(@pkgdirs) {
if( $platform =~ /^(rh|SL)$/ ) {
if( $platform =~ /^(rh|SL|centos)$/ ) {
if ( $c == 0 ) {
# After some tests, if we put the repo in pre scripts in the kickstart like for rhels6.x
# the rhels5.9 will not be installed successfully. So put in kickstart directly.

View File

@ -596,7 +596,7 @@ sub nodeset {
my $subreq = shift;
my $host2mic = shift;
my $usage_string = "nodeset noderange [osimage=imagename]";
my $usage_string = "nodeset noderange osimage[=imagename]";
my $nodes = $request->{'node'};
my $args = $request->{arg};
@ -604,9 +604,6 @@ sub nodeset {
foreach (@$args) {
if (/osimage=(.*)/) {
$setosimg = $1;
} else {
xCAT::MsgUtils->message("E", {error=>[$usage_string], errorcode=>["1"]}, $callback);
return;
}
}
@ -625,11 +622,12 @@ sub nodeset {
}
$nttab->setNodesAttribs(\%setpmethod);
}
# get the provision method from nodetype table
my $nthash = $nttab->getNodesAttribs($nodes,['provmethod']);
foreach my $node (@$nodes) {
unless (defined ($nthash->{$node}->[0]->{'provmethod'})) {
xCAT::MsgUtils->message("E", {error=>["The provmethod for the node $node must be set before the nodeset."], errorcode=>["1"]}, $callback);
xCAT::MsgUtils->message("E", {error=>["The provmethod for the node $node must be set by [nodeset <node> osimage=<image name>] or set in the provmethod attribute of the node."], errorcode=>["1"]}, $callback);
return;
}
}

View File

@ -35,28 +35,43 @@ unless ($master && $cfgpath) {
}
# get the correct host name for the host
my $nodename;
my ($nodename, $nodename_short);
my $masterip = `getent hosts $master | awk {'print \$1'}`;
chomp($masterip);
my $myip = `ip route get $masterip| head -n 1 | sed 's/^.*src//g' | awk {'print \$1'}`;
my $myipinfo =`getent hosts $myip`;
if ($myipinfo =~ /([^\s]+)\s+([^\s]+)\s+([^\s]+)/) {
my $n1 = $2;
my $n2 = $3;
if (length($n1) > length($n2)) {
$nodename = $n2;
} else {
$nodename = $n1;
if ($masterip) {
chomp($masterip);
my $myip = `ip route get $masterip| head -n 1 | sed 's/^.*src//g' | awk {'print \$1'}`;
if ($myip) {
my $myipinfo =`getent hosts $myip`;
if ($myipinfo && $myipinfo =~ /([^\s]+)\s+([^\s]+)\s+([^\s]+)/) {
my $n1 = $2;
my $n2 = $3;
if (length($n1) > length($n2)) {
$nodename_short = $n2;
} else {
$nodename = $n1;
}
} elsif ($myipinfo && $myipinfo =~ /([^\s]+)\s+([^\s]+)/) {
$nodename_short = $2;
}
}
} elsif ($myipinfo =~ /([^\s]+)\s+([^\s]+)/) {
$nodename = $2;
} else {
outputmsg("Error: cannot get the hostname of the host node\n", 2);
}
unless ($nodename) {
$nodename = `hostname`;
chomp($nodename);
}
unless ($nodename_short) {
$nodename_short = `hostname -s`;
chomp($nodename_short);
}
# download the mic configuration file from master
my $cmd = "wget -N --waitretry=10 --random-wait -T 60 http://$master/$cfgpath/miccfg.$nodename -P $tmppath";
my ($rc, $output) = runsyscmd ($cmd, "Error: failed to download mic configuration file from $master\n", 3);
my $cmd = "wget -N --waitretry=10 --random-wait -T 60 http://$master/$cfgpath/miccfg.$nodename_short -P $tmppath";
my ($rc, $output) = runsyscmd ($cmd);
if ($rc) {
$cmd = "wget -N --waitretry=10 --random-wait -T 60 http://$master/$cfgpath/miccfg.$nodename -P $tmppath";
runsyscmd ($cmd, "Error: failed to download mic configuration file from $master\n", 3);
}
unless (-r "$tmppath/miccfg.$nodename") {
runsyscmd ("Error: cannot get the mic configuration file from http://$master/$cfgpath/miccfg.$nodename\n", 4);

View File

@ -36,28 +36,43 @@ unless ($master && $cfgpath) {
}
# get the correct host name for the host
my $nodename;
my ($nodename, $nodename_short);
my $masterip = `getent hosts $master | awk {'print \$1'}`;
chomp($masterip);
my $myip = `ip route get $masterip| head -n 1 | sed 's/^.*src//g' | awk {'print \$1'}`;
my $myipinfo =`getent hosts $myip`;
if ($myipinfo =~ /([^\s]+)\s+([^\s]+)\s+([^\s]+)/) {
my $n1 = $2;
my $n2 = $3;
if (length($n1) > length($n2)) {
$nodename = $n2;
} else {
$nodename = $n1;
if ($masterip) {
chomp($masterip);
my $myip = `ip route get $masterip| head -n 1 | sed 's/^.*src//g' | awk {'print \$1'}`;
if ($myip) {
my $myipinfo =`getent hosts $myip`;
if ($myipinfo && $myipinfo =~ /([^\s]+)\s+([^\s]+)\s+([^\s]+)/) {
my $n1 = $2;
my $n2 = $3;
if (length($n1) > length($n2)) {
$nodename_short = $n2;
} else {
$nodename = $n1;
}
} elsif ($myipinfo && $myipinfo =~ /([^\s]+)\s+([^\s]+)/) {
$nodename_short = $2;
}
}
} elsif ($myipinfo =~ /([^\s]+)\s+([^\s]+)/) {
$nodename = $2;
} else {
outputmsg("Error: cannot get the hostname of the host node\n", 2);
}
unless ($nodename) {
$nodename = `hostname`;
chomp($nodename);
}
unless ($nodename_short) {
$nodename_short = `hostname -s`;
chomp($nodename_short);
}
# download the mic configuration file from master
my $cmd = "wget -N --waitretry=10 --random-wait -T 60 http://$master/$cfgpath/micflash.$nodename -P $tmppath";
my ($rc, $output) = runsyscmd ($cmd, "Error: failed to download mic configuration file from $master\n", 3);
my $cmd = "wget -N --waitretry=10 --random-wait -T 60 http://$master/$cfgpath/micflash.$nodename_short -P $tmppath";
my ($rc, $output) = runsyscmd ($cmd);
if ($rc) {
$cmd = "wget -N --waitretry=10 --random-wait -T 60 http://$master/$cfgpath/micflash.$nodename -P $tmppath";
runsyscmd ($cmd, "Error: failed to download mic configuration file from $master\n", 3);
}
unless (-r "$tmppath/micflash.$nodename") {
runsyscmd ("Error: cannot get the mic configuration file from http://$master/$cfgpath/micflash.$nodename\n", 4);

View File

@ -189,3 +189,23 @@ cmd:lsdef -t wrongtype -o test
check:rc!=0
check:output=~Error
end
start:lsdef_t_h_i
description:lsdef -t node -h -i status
cmd:lsdef -t node -h -i status
check:rc==0
check:output=~status
end
start:lsdef_nics
description:lsdef --nics
cmd:mkdef -t node -o testnode1 groups=all mgt=ipmi nicips.eth0=1.1.1.1
check:rc==0
cmd:lsdef testnode1 --nics
check:rc==0
check:output=~1.1.1.1
cmd:rmdef testnode1
check:rc==0
cmd:lsdef testnode1
check:output=~Could not find
end