From 5585b97e184027d916cb98b3edc78a40cc170abb Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 12 Dec 2013 11:20:40 -0500 Subject: [PATCH] fix defect 3942 --- xCAT-server/lib/xcat/plugins/pxe.pm | 12 +++++++----- xCAT-server/lib/xcat/plugins/vsmppxe.pm | 12 +++++++----- xCAT-server/lib/xcat/plugins/xnba.pm | 12 +++++++----- xCAT-server/lib/xcat/plugins/yaboot.pm | 12 +++++++----- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/pxe.pm b/xCAT-server/lib/xcat/plugins/pxe.pm index 23aa71ec4..0e69e63d7 100644 --- a/xCAT-server/lib/xcat/plugins/pxe.pm +++ b/xCAT-server/lib/xcat/plugins/pxe.pm @@ -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]) { diff --git a/xCAT-server/lib/xcat/plugins/vsmppxe.pm b/xCAT-server/lib/xcat/plugins/vsmppxe.pm index 4d157ccd5..89e7b1485 100644 --- a/xCAT-server/lib/xcat/plugins/vsmppxe.pm +++ b/xCAT-server/lib/xcat/plugins/vsmppxe.pm @@ -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]) { diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index 651eb2bad..8ce1c116a 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -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]) { diff --git a/xCAT-server/lib/xcat/plugins/yaboot.pm b/xCAT-server/lib/xcat/plugins/yaboot.pm index 36bb47372..b90c6df25 100644 --- a/xCAT-server/lib/xcat/plugins/yaboot.pm +++ b/xCAT-server/lib/xcat/plugins/yaboot.pm @@ -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]) {