Added new options to "lpar_netboot" function - Line #569
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@192 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
b9d1ad084d
commit
3cad519e36
@ -117,6 +117,7 @@ sub connect {
|
||||
##################################################
|
||||
if ( $verbose ) {
|
||||
close STDERR;
|
||||
|
||||
if ( !open( STDERR, '>', \$expect_log )) {
|
||||
return( "Unable to redirect STDERR: $!" );
|
||||
}
|
||||
@ -131,6 +132,7 @@ sub connect {
|
||||
# Redirect STDOUT to variable
|
||||
##################################################
|
||||
close STDOUT;
|
||||
|
||||
if ( !open( STDOUT, '>', \$expect_log )) {
|
||||
return( "Unable to redirect STDOUT: $!" );
|
||||
}
|
||||
@ -212,9 +214,11 @@ sub disconnect {
|
||||
my $exp = shift;
|
||||
my $ssh = @$exp[0];
|
||||
|
||||
$ssh->send( "exit\r" );
|
||||
$ssh->hard_close();
|
||||
|
||||
if ( defined( $ssh )) {
|
||||
$ssh->send( "exit\r" );
|
||||
$ssh->hard_close();
|
||||
@$exp[0] = undef;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -565,15 +569,26 @@ sub lshwres {
|
||||
sub lpar_netboot {
|
||||
|
||||
my $exp = shift;
|
||||
my $verbose = shift;
|
||||
my $name = shift;
|
||||
my $d = shift;
|
||||
my $server = shift;
|
||||
my $gateway = shift;
|
||||
my $client = shift;
|
||||
my $opt = shift;
|
||||
my $mac = shift;
|
||||
my $timeout = 300;
|
||||
my $cmd = "lpar_netboot -t ent";
|
||||
my $cmd = "lpar_netboot -t ent -f";
|
||||
|
||||
#####################################
|
||||
# Verbose output
|
||||
#####################################
|
||||
if ( $verbose ) {
|
||||
$cmd.= " -x -v";
|
||||
}
|
||||
#####################################
|
||||
# Colon seperated output
|
||||
#####################################
|
||||
if ( exists( $opt->{c} )) {
|
||||
$cmd.= " -c";
|
||||
}
|
||||
#####################################
|
||||
# Get MAC-address or network boot
|
||||
#####################################
|
||||
@ -588,9 +603,9 @@ sub lpar_netboot {
|
||||
#####################################
|
||||
# Network specified (-D ping test)
|
||||
#####################################
|
||||
if ( defined( $server )) {
|
||||
if ( exists( $opt->{S} )) {
|
||||
$cmd.= (!defined( $mac )) ? " -D" : "";
|
||||
$cmd.= " -s auto -d auto -S $server -G $gateway -C $client";
|
||||
$cmd.= " -s auto -d auto -S $opt->{S} -G $opt->{G} -C $opt->{C}";
|
||||
}
|
||||
#####################################
|
||||
# Add lpar name, profile, CEC name
|
||||
@ -824,3 +839,4 @@ sub power_cmd {
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user