move the special case for rflash from PPC.pm to PPCrflash.pm
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3768 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
a8bc224fb2
commit
116368143d
@ -151,21 +151,25 @@ sub parse_args {
|
||||
}
|
||||
|
||||
#############################################
|
||||
# Option -V for verbose output
|
||||
#############################################
|
||||
if ( exists( $opt{V} )) {
|
||||
# Option -V for verbose output
|
||||
############################################
|
||||
if ( exists( $opt{V} )) {
|
||||
$verbose = 1;
|
||||
}
|
||||
}
|
||||
|
||||
####################
|
||||
#suport for "rflash", copy the rpm and xml packages from user-spcefied-directory to /install/packages_fw
|
||||
#####################
|
||||
if ( (!exists($opt{commit})) && (!exists($opt{ recover }))) {
|
||||
if( preprocess_for_rflash($request, \%opt) == -1) {
|
||||
####################
|
||||
#suport for "rflash", copy the rpm and xml packages from user-spcefied-directory to /install/packages_fw
|
||||
#####################
|
||||
if ( (!exists($opt{commit})) && (!exists($opt{ recover }))) {
|
||||
if( preprocess_for_rflash($request, \%opt) == -1) {
|
||||
return( usage() );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(noderange_validate($request) == -1) {
|
||||
return(usage());
|
||||
}
|
||||
|
||||
send_msg($request, 1, "It may take considerable time to complete, depending on the number of systems being updated and the workload on the target HMC. In particular, power subsystem updates may take an hour or more if there are many attached managed systems. Please waiting.");
|
||||
|
||||
####################################
|
||||
@ -207,7 +211,54 @@ sub send_msg {
|
||||
}
|
||||
}
|
||||
|
||||
#####################################
|
||||
#When run rflash with the \"commit\" or \"recover\" operation, the noderange cannot be BPA and can only be CEC or LPAR.
|
||||
#####################################
|
||||
sub noderange_validate {
|
||||
my $request = shift;
|
||||
#my $opt = shift;
|
||||
my $noderange = $request->{node};
|
||||
#my $t = print_var($request, "request");
|
||||
#print $t;
|
||||
####################
|
||||
## $f1 and $f2 are the flags for rflash, to check if there are BPAs and CECs at the same time.
|
||||
##################
|
||||
my $f1 = 0;
|
||||
my $f2 = 0;
|
||||
|
||||
###########################################
|
||||
# Group nodes
|
||||
###########################################
|
||||
foreach my $node ( @$noderange ) {
|
||||
my $type = undef;
|
||||
my $sitetab = xCAT::Table->new( 'nodetype' );
|
||||
if ( defined( $sitetab )) {
|
||||
my ($ent) = $sitetab->getAttribs({ node=>$node},'nodetype');
|
||||
if ( defined($ent) ) {
|
||||
$type = $ent->{nodetype};
|
||||
}
|
||||
}
|
||||
#print "type:$type\n";
|
||||
if( $type =~/^(fsp|lpar)$/) {
|
||||
$f1 = 1;
|
||||
} else {
|
||||
$f2 = 1;
|
||||
my $exargs=$request->{arg};
|
||||
#my $t = print_var($exargs, "exargs");
|
||||
#print $t;
|
||||
if ( grep(/commit/,@$exargs) != 0 || grep(/recover/,@$exargs) != 0) {
|
||||
send_msg( $request, 1, "When run \"rflash\" with the \"commit\" or \"recover\" operation, the noderange cannot be BPA and can only be CEC or LPAR.");
|
||||
send_msg( $request, 1, "And then, it will do the operation for both managed systems and power subsystems.");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($f1 * $f2) {
|
||||
send_msg( $request, 1, "The argument noderange of rflash can't be BPA and CEC(or LPAR) at the same time");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub preprocess_for_rflash {
|
||||
|
@ -530,11 +530,6 @@ sub preprocess_nodes {
|
||||
}
|
||||
}
|
||||
|
||||
####################
|
||||
# $f1 and $f2 are the flags for rflash, to check if there are BPAs and CECs at the same time.
|
||||
#################
|
||||
my $f1 = 0;
|
||||
my $f2 = 0;
|
||||
##########################################
|
||||
# Group nodes
|
||||
##########################################
|
||||
@ -553,24 +548,7 @@ sub preprocess_nodes {
|
||||
######################################
|
||||
my $hcp = @$d[3];
|
||||
my $mtms = @$d[2];
|
||||
######################################
|
||||
# Special case for rflash
|
||||
######################################
|
||||
if ( $request->{command} eq "rflash" ) {
|
||||
if(@$d[4] =~/^(fsp|lpar)$/) {
|
||||
$f1 = 1;
|
||||
} else {
|
||||
$f2 = 1;
|
||||
my $exargs=$request->{arg};
|
||||
my $t= xCAT::PPCrflash::print_var($exargs, "exargs");
|
||||
if ( grep(/commit/,@$exargs) != 0 || grep(/recover/,@$exargs) != 0) {
|
||||
send_msg( $request, 1, "When run \"rflash\" with the \"commit\" or \"recover\" operation, the noderange cannot be BPA and can only be CEC or LPAR.");
|
||||
send_msg( $request, 1, "And then, it will do the operation for both managed systems and power subsystems.");
|
||||
return undef;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
######################################
|
||||
# Special case for mkconn
|
||||
######################################
|
||||
@ -588,11 +566,6 @@ sub preprocess_nodes {
|
||||
}
|
||||
}
|
||||
|
||||
if($f1 * $f2) {
|
||||
send_msg( $request, 1, "The argument noderange of rflash can't be BPA and CEC(or LPAR) at the same time");
|
||||
return undef;
|
||||
}
|
||||
|
||||
##########################################
|
||||
# Get userid and password
|
||||
##########################################
|
||||
|
Loading…
Reference in New Issue
Block a user