added fail-retry to lpar_netboot
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3473 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
14509f884e
commit
35c7e5dbe4
@ -191,29 +191,42 @@ sub do_rnetboot {
|
||||
#######################################
|
||||
$cmd.= " -t ent -f \"$name\" \"$pprofile\" \"$fsp\" $id $hcp \"$node\"";
|
||||
|
||||
#######################################
|
||||
# Execute command
|
||||
#######################################
|
||||
if ( !open( OUTPUT, "$cmd 2>&1 |")) {
|
||||
return( [RC_ERROR,"$cmd fork error: $!"] );
|
||||
}
|
||||
#######################################
|
||||
# Get command output
|
||||
#######################################
|
||||
while ( <OUTPUT> ) {
|
||||
$result.=$_;
|
||||
}
|
||||
close OUTPUT;
|
||||
|
||||
#######################################
|
||||
# Get command exit code
|
||||
#######################################
|
||||
my $done = 0;
|
||||
my $Rc = SUCCESS;
|
||||
while ( $done < 2 ) {
|
||||
#######################################
|
||||
# Execute command
|
||||
#######################################
|
||||
if ( !open( OUTPUT, "$cmd 2>&1 |")) {
|
||||
return( [RC_ERROR,"$cmd fork error: $!"] );
|
||||
}
|
||||
#######################################
|
||||
# Get command output
|
||||
#######################################
|
||||
while ( <OUTPUT> ) {
|
||||
$result.=$_;
|
||||
}
|
||||
close OUTPUT;
|
||||
|
||||
foreach ( split /\n/, $result ) {
|
||||
if ( /^lpar_netboot: / ) {
|
||||
$Rc = RC_ERROR;
|
||||
last;
|
||||
#######################################
|
||||
# Get command exit code
|
||||
#######################################
|
||||
|
||||
foreach ( split /\n/, $result ) {
|
||||
if ( /^lpar_netboot: / ) {
|
||||
$Rc = RC_ERROR;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $Rc == SUCCESS ) {
|
||||
$done = 2;
|
||||
} else {
|
||||
if ( !exists( $opt->{f} )) {
|
||||
$cmd.= " -i";
|
||||
}
|
||||
$done = $done + 1;
|
||||
sleep 1;
|
||||
}
|
||||
}
|
||||
return( [$Rc,$result] );
|
||||
|
Loading…
Reference in New Issue
Block a user