diff --git a/README b/README deleted file mode 100644 index 0696fd032..000000000 --- a/README +++ /dev/null @@ -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 - - - - - - diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 5981f1050..11d9c2085 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -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. diff --git a/xCAT-server/lib/xcat/plugins/mic.pm b/xCAT-server/lib/xcat/plugins/mic.pm index ebc4421e5..3c64260db 100644 --- a/xCAT-server/lib/xcat/plugins/mic.pm +++ b/xCAT-server/lib/xcat/plugins/mic.pm @@ -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 osimage=] or set in the provmethod attribute of the node."], errorcode=>["1"]}, $callback); return; } } diff --git a/xCAT-server/sbin/configmic b/xCAT-server/sbin/configmic index fdcba748c..7eb4d10f3 100755 --- a/xCAT-server/sbin/configmic +++ b/xCAT-server/sbin/configmic @@ -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); diff --git a/xCAT-server/sbin/flashmic b/xCAT-server/sbin/flashmic index 0b0271595..daee9256b 100755 --- a/xCAT-server/sbin/flashmic +++ b/xCAT-server/sbin/flashmic @@ -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); diff --git a/xCAT-test/autotest/testcase/lsdef/cases0 b/xCAT-test/autotest/testcase/lsdef/cases0 index 6f1e3780b..9850384fc 100644 --- a/xCAT-test/autotest/testcase/lsdef/cases0 +++ b/xCAT-test/autotest/testcase/lsdef/cases0 @@ -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