Cleaned up error-handling (particularly for IVM)
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@671 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
4ad34b4565
commit
c075dc5298
@ -226,10 +226,17 @@ sub ivm_getmacs {
|
||||
#######################################
|
||||
# Get command exit code
|
||||
#######################################
|
||||
my $Rc = ( $? ) ? $? >> 8 : SUCCESS;
|
||||
return( [$Rc,$result] );
|
||||
}
|
||||
my $Rc = SUCCESS;
|
||||
|
||||
foreach ( split /\n/, $result ) {
|
||||
if ( /^lpar_netboot: / ) {
|
||||
$Rc = RC_ERROR;
|
||||
last;
|
||||
}
|
||||
}
|
||||
return( [$Rc,$result] );
|
||||
|
||||
}
|
||||
|
||||
|
||||
##########################################################################
|
||||
@ -273,7 +280,7 @@ sub getmacs {
|
||||
$opt );
|
||||
}
|
||||
my $Rc = shift(@$result);
|
||||
|
||||
|
||||
##################################
|
||||
# Form string from array results
|
||||
##################################
|
||||
@ -284,6 +291,9 @@ sub getmacs {
|
||||
# Return error
|
||||
##################################
|
||||
if ( $Rc != SUCCESS ) {
|
||||
if ( @$result[0] =~ /lpar_netboot: (.*)/ ) {
|
||||
return( [[$name,$1]] );
|
||||
}
|
||||
return( [[$name,join( '', @$result )]] );
|
||||
}
|
||||
##################################
|
||||
@ -309,9 +319,9 @@ sub getmacs {
|
||||
#####################################
|
||||
my $values;
|
||||
foreach ( @$result ) {
|
||||
if ( /^#\s*Type/ ) {
|
||||
if ( /^#\s?Type/ ) {
|
||||
$values.= "\n$_\n";
|
||||
} elsif ( /^[^#]/ ) {
|
||||
} elsif ( /^ent:?/ ) {
|
||||
$values.= "$_\n";
|
||||
}
|
||||
}
|
||||
@ -322,3 +332,4 @@ sub getmacs {
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user