Merge branch '2.8' of ssh://git.code.sf.net/p/xcat/xcat-core into 2.8
This commit is contained in:
commit
2374e40b4e
@ -182,6 +182,8 @@ sub mknetboot
|
||||
my $xcatdport = "3001";
|
||||
my $xcatiport = "3002";
|
||||
my $nodestatus = "y";
|
||||
my @myself = xCAT::NetworkUtils->determinehostname();
|
||||
my $myname = $myself[(scalar @myself)-1];
|
||||
|
||||
#if ($sitetab)
|
||||
#{
|
||||
@ -446,7 +448,7 @@ sub mknetboot
|
||||
if ($statelite) {
|
||||
unless ( -r "$rootimgdir/kernel") {
|
||||
$callback->({
|
||||
error=>[qq{Did you run "genimage" before running "liteimg"? kernel cannot be found...}],
|
||||
error=>[qq{Did you run "genimage" before running "liteimg"? kernel cannot be found at $rootimgdir/kernel on $myname}],
|
||||
errorcode=>[1]
|
||||
});
|
||||
next;
|
||||
@ -454,7 +456,7 @@ sub mknetboot
|
||||
if (!-r "$rootimgdir/initrd-statelite.gz") {
|
||||
if (! -r "$rootimgdir/initrd.gz") {
|
||||
$callback->({
|
||||
error=>[qq{Did you run "genimage" before running "liteimg"? initrd.gz or initrd-statelite.gz cannot be found}],
|
||||
error=>[qq{Did you run "genimage" before running "liteimg"? initrd.gz or initrd-statelite.gz cannot be found at $rootimgdir/initrd.gz on $myname}],
|
||||
errorcode=>[1]
|
||||
});
|
||||
next;
|
||||
@ -473,7 +475,7 @@ sub mknetboot
|
||||
} else {
|
||||
unless ( -r "$rootimgdir/kernel") {
|
||||
$callback->({
|
||||
error=>[qq{Did you run "genimage" before running "packimage"? kernel cannot be found}],
|
||||
error=>[qq{Did you run "genimage" before running "packimage"? kernel cannot be found at $rootimgdir/kernel on $myname}],
|
||||
errorcode=>[1]
|
||||
});
|
||||
next;
|
||||
@ -481,7 +483,7 @@ sub mknetboot
|
||||
if (!-r "$rootimgdir/initrd-stateless.gz") {
|
||||
if (! -r "$rootimgdir/initrd.gz") {
|
||||
$callback->({
|
||||
error=>[qq{Did you run "genimage" before running "packimage"? initrd.gz or initrd-stateless.gz cannot be found}],
|
||||
error=>[qq{Did you run "genimage" before running "packimage"? initrd.gz or initrd-stateless.gz cannot be found at $rootimgdir/initrd.gz on $myname}],
|
||||
errorcode=>[1]
|
||||
});
|
||||
next;
|
||||
@ -491,7 +493,7 @@ sub mknetboot
|
||||
}
|
||||
unless ( -r "$rootimgdir/rootimg.gz" or -r "$rootimgdir/rootimg.sfs" ) {
|
||||
$callback->({
|
||||
error=>["No packed image for platform $osver, architecture $arch, and profile $profile, please run packimage (e.g. packimage -o $osver -p $profile -a $arch"],
|
||||
error=>["No packed image for platform $osver, architecture $arch, and profile $profile found at $rootimgdir/rootimg.gz or $rootimgdir/rootimg.sfs on $myname, please run packimage (e.g. packimage -o $osver -p $profile -a $arch"],
|
||||
errorcode => [1]});
|
||||
next;
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ use Sys::Syslog;
|
||||
use xCAT::Scope;
|
||||
use xCAT::Utils;
|
||||
use xCAT::TableUtils;
|
||||
use xCAT::ServiceNodeUtils;
|
||||
use xCAT::NetworkUtils;
|
||||
use xCAT::MsgUtils;
|
||||
use File::Path;
|
||||
@ -334,7 +335,7 @@ sub preprocess_request {
|
||||
@args=($req->{arg});
|
||||
}
|
||||
@ARGV = @args;
|
||||
|
||||
my $nodes = $req->{node};
|
||||
#use Getopt::Long;
|
||||
Getopt::Long::Configure("bundling");
|
||||
Getopt::Long::Configure("pass_through");
|
||||
@ -375,13 +376,23 @@ sub preprocess_request {
|
||||
|
||||
|
||||
#Assume shared tftp directory for boring people, but for cool people, help sync up tftpdirectory contents when
|
||||
#they specify no sharedtftp in site table
|
||||
#my $stab = xCAT::Table->new('site');
|
||||
|
||||
#my $sent = $stab->getAttribs({key=>'sharedtftp'},'value');
|
||||
#if they specify no sharedtftp in site table
|
||||
my @entries = xCAT::TableUtils->get_site_attribute("sharedtftp");
|
||||
my $t_entry = $entries[0];
|
||||
if ( defined($t_entry) and ($t_entry == 0 or $t_entry =~ /no/i)) {
|
||||
# check for computenodes and servicenodes from the noderange, if so error out
|
||||
my @SN;
|
||||
my @CN;
|
||||
xCAT::ServiceNodeUtils->getSNandCPnodes(\@$nodes, \@SN, \@CN);
|
||||
if ((@SN > 0) && (@CN >0 )) { # there are both SN and CN
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] =
|
||||
"Nodeset was run with a noderange containing both service nodes and compute nodes. This is not valid. You must submit with either compute nodes in the noderange or service nodes. \n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback1);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
$req->{'_disparatetftp'}=[1];
|
||||
if ($req->{inittime}->[0]) {
|
||||
return [$req];
|
||||
@ -390,40 +401,6 @@ sub preprocess_request {
|
||||
}
|
||||
return [$req];
|
||||
}
|
||||
#sub preprocess_request {
|
||||
# my $req = shift;
|
||||
# my $callback = shift;
|
||||
# my %localnodehash;
|
||||
# my %dispatchhash;
|
||||
# my $nrtab = xCAT::Table->new('noderes');
|
||||
# foreach my $node (@{$req->{node}}) {
|
||||
# my $nodeserver;
|
||||
# my $tent = $nrtab->getNodeAttribs($node,['tftpserver']);
|
||||
# if ($tent) { $nodeserver = $tent->{tftpserver} }
|
||||
# unless ($tent and $tent->{tftpserver}) {
|
||||
# $tent = $nrtab->getNodeAttribs($node,['servicenode']);
|
||||
# if ($tent) { $nodeserver = $tent->{servicenode} }
|
||||
# }
|
||||
# if ($nodeserver) {
|
||||
# $dispatchhash{$nodeserver}->{$node} = 1;
|
||||
# } else {
|
||||
# $localnodehash{$node} = 1;
|
||||
# }
|
||||
# }
|
||||
# my @requests;
|
||||
# my $reqc = {%$req};
|
||||
# $reqc->{node} = [ keys %localnodehash ];
|
||||
# if (scalar(@{$reqc->{node}})) { push @requests,$reqc }
|
||||
#
|
||||
# foreach my $dtarg (keys %dispatchhash) { #iterate dispatch targets
|
||||
# my $reqcopy = {%$req}; #deep copy
|
||||
# $reqcopy->{'_xcatdest'} = $dtarg;
|
||||
# $reqcopy->{node} = [ keys %{$dispatchhash{$dtarg}}];
|
||||
# push @requests,$reqcopy;
|
||||
# }
|
||||
# return \@requests;
|
||||
#}
|
||||
#
|
||||
|
||||
|
||||
sub process_request {
|
||||
|
Loading…
x
Reference in New Issue
Block a user