Made specific choice about preprocess_nodes for rspconfig resetnet.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@13281 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
yinle 2012-07-12 07:51:11 +00:00
parent af362d39fa
commit d6e8424836

View File

@ -225,9 +225,13 @@ sub process_command {
#######################################
# Group nodes based on command
#######################################
my $nodes = preprocess_nodes( $request, $hcps_will );
if ( !defined( $nodes )) {
return(1);
my $nodes;
unless ($request->{command} =~ /^rspconfig$/&& exists( $request->{opt}->{resetnet})){
$nodes = preprocess_nodes( $request, $hcps_will );
if ( !defined( $nodes )) {
return(1);
}
}
#get new node status
@ -2434,77 +2438,6 @@ sub sshcmds_on_hmc
return ([0, undef, \@data]);
}
##########################################################################
# logon asm and update configuration
##########################################################################
sub updconf_in_asm
{
my $ip = shift;
my $target_dev = shift;
my @cmds = @_;
eval { require xCAT::PPCfsp };
if ( $@ ) {
return ([1,@cmds]);
}
my %handled;
for my $cmd (@cmds)
{
if ( $cmd =~ /(.+?)=(.*)/)
{
my ($command,$value) = ($1,$2);
$handled{$command} = $value;
}
}
my %request = (
ppcretry => 1,
verbose => 0,
ppcmaxp => 64,
ppctimeout => 0,
fsptimeout => 0,
ppcretry => 3,
maxssh => 8,
arg => \@cmds,
method => \%handled,
command => 'rspconfig',
hwtype => lc($target_dev->{'type'}),
);
my $valid_ip;
my @exp;
foreach my $individual_ip ( split /,/, $ip ) {
################################
# Get userid and password
################################
my @cred = ($target_dev->{'username'},$target_dev->{'password'});
$request{$individual_ip}{cred} = \@cred;
$request{node} = [$individual_ip];
@exp = xCAT::PPCfsp::connect(\%request, $individual_ip);
####################################
# Successfully connected
####################################
if ( ref($exp[0]) eq "LWP::UserAgent" ) {
$valid_ip = $individual_ip;
last;
}
}
####################################
# Error connecting
####################################
if ( ref($exp[0]) ne "LWP::UserAgent" ) {
return ([1,@cmds]);
}
my $result = xCAT::PPCfsp::handler( $valid_ip, \%request, \@exp );
my $RC = shift( @$result);
my @data;
push @data, @$result[0];
return ([0, undef, \@data]);
}
sub check_fsp_api
{