From a86e141d8cea79e7883578246675d572b8e34d13 Mon Sep 17 00:00:00 2001 From: jjhua Date: Mon, 20 Dec 2010 09:40:33 +0000 Subject: [PATCH] fixed some uninitialized value git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8479 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPUtils.pm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/FSPUtils.pm b/perl-xCAT/xCAT/FSPUtils.pm index f1fb05ded..44beca78a 100644 --- a/perl-xCAT/xCAT/FSPUtils.pm +++ b/perl-xCAT/xCAT/FSPUtils.pm @@ -126,7 +126,11 @@ sub fsp_api_action { my $password = $password_hash->{password}; $cmd = "$fsp_api -a $action -u $user -p $password -T $tooltype -t $type:$fsp_ip:$id:$node_name:"; } else { - $cmd = "$fsp_api -a $action -T $tooltype -t $type:$fsp_ip:$id:$node_name:$parameter"; + if( defined($parameter) ) { + $cmd = "$fsp_api -a $action -T $tooltype -t $type:$fsp_ip:$id:$node_name:$parameter"; + } else { + $cmd = "$fsp_api -a $action -T $tooltype -t $type:$fsp_ip:$id:$node_name:"; + } } #print "cmd: $cmd\n"; @@ -139,7 +143,9 @@ sub fsp_api_action { # output the prompt ################# #$outhash{ $node_name } = $res; - $res =~ s/$node_name: //; + if(defined($res)) { + $res =~ s/$node_name: //; + } return( [$node_name,$res, $Rc] ); } @@ -219,7 +225,9 @@ sub fsp_state_action { # output the prompt ################# #$outhash{ $node_name } = $res; - $res[0] =~ s/$node_name: //; + if( defined($res) ) { + $res[0] =~ s/$node_name: //; + } return( [$Rc,@res] ); } @@ -373,7 +381,9 @@ sub fsp_api_create_parttion { # output the prompt ################# #$outhash{ $node_name } = $res; - $res =~ s/$fsp_name: //; + if( defined($res) ) { + $res =~ s/$fsp_name: //; + } return( [$fsp_name,$res, $Rc] ); }