fix defect 3942

This commit is contained in:
lissav 2013-12-12 11:20:40 -05:00
parent 55f981ea47
commit 5585b97e18
4 changed files with 28 additions and 20 deletions

View File

@ -330,17 +330,19 @@ sub preprocess_request {
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 @SN;
my @CN;
xCAT::ServiceNodeUtils->getSNandCPnodes(\@$nodes, \@SN, \@CN);
unless (($args[0] eq 'stat') or ($args[0] eq 'enact')) { # ok for these options
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]) {

View File

@ -262,17 +262,19 @@ sub preprocess_request {
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 @SN;
my @CN;
xCAT::ServiceNodeUtils->getSNandCPnodes(\@$nodes, \@SN, \@CN);
unless (($args[0] eq 'stat') or ($args[0] eq 'enact')) { # mix is ok for these options
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]) {

View File

@ -350,17 +350,19 @@ sub preprocess_request {
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 @SN;
my @CN;
xCAT::ServiceNodeUtils->getSNandCPnodes(\@$nodes, \@SN, \@CN);
unless (($args[0] eq 'stat') or ($args[0] eq 'enact')) { # mix is ok for these options
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]) {

View File

@ -381,17 +381,19 @@ sub preprocess_request {
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 @SN;
my @CN;
xCAT::ServiceNodeUtils->getSNandCPnodes(\@$nodes, \@SN, \@CN);
unless (($args[0] eq 'stat') or ($args[0] eq 'enact')) {
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]) {