defect 3750

This commit is contained in:
lissav 2013-09-12 09:24:20 -04:00
parent ffc621cf29
commit 1b5cf5e044

View File

@ -6,6 +6,7 @@ use Socket;
use File::Copy;
use Getopt::Long;
use xCAT::MsgUtils;
use xCAT::ServiceNodeUtils;
use xCAT::TableUtils qw(get_site_attribute);
my $addkcmdlinehandled;
@ -210,6 +211,7 @@ sub preprocess_request {
my $callback1 = shift;
my $command = $req->{command}->[0];
my $sub_req = shift;
my $nodes = $req->{node};
my @args=();
if (ref($req->{arg})) {
@args=@{$req->{arg}};
@ -254,10 +256,22 @@ sub preprocess_request {
return;
}
#my $sent = $stab->getAttribs({key=>'sharedtftp'},'value');
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];