diff --git a/xCAT-server/share/xcat/cons/multiple b/xCAT-server/share/xcat/cons/multiple index 9b47a486d..ffcb3f72e 100755 --- a/xCAT-server/share/xcat/cons/multiple +++ b/xCAT-server/share/xcat/cons/multiple @@ -129,20 +129,6 @@ sub invoke_fsp { my $fsp_name = shift; my $id = shift; - ################################## - # Get node power type - ################################## - my $hwtype = "fsp"; - - my %objhash = (); - $objhash{$fsp_name} = "node"; - my %myhash = xCAT::DBobjUtils->getobjdefs(\%objhash); - my $password = $myhash{$fsp_name}{"passwd.HMC"}; - if(!$password ) { - return "The password.HMC of $fsp_name in ppcdirect table is empty"; - } - - my $username = "hscroot"; my $fsp_api = ($::XCATROOT) ? "$::XCATROOT/sbin/fsp-api" : "/opt/xcat/sbin/fsp-api"; my $action = "console"; my $type = "0"; @@ -152,21 +138,13 @@ sub invoke_fsp { if( !(-e $fsp_api) && !(-x $fsp_api) ) { return "please check the $fsp_api"; } - - my $hosttab = xCAT::Table->new( 'hosts' ); - if ( $hosttab) { - my $node_ip_hash = $hosttab->getNodeAttribs( $fsp_name,[qw(ip)]); - $fsp_ip = $node_ip_hash->{ip}; + + $fsp_ip = xCAT::Utils::getNodeIPaddress( $fsp_name ); + if(!defined($fsp_ip)) { + return "Failed to get the $fsp_name\'s ip"; } - if (!$fsp_ip) { - my $ip_tmp_res = xCAT::Utils::toIP($fsp_name); - ($Rc, $fsp_ip) = @$ip_tmp_res; - if ( $Rc ) { - return "Failed to get the $fsp_name\'s ip"; - } - } - - my $cmd = "$fsp_api -a $action -u $username -p $password -t $type:$fsp_ip:$id:$node:\r"; + + my $cmd = "$fsp_api -a $action -t $type:$fsp_ip:$id:$node:\r"; # print "cmd: $cmd\n"; my $running_failed_code = "Reason code: 0x1000000"; my $fsp_standby_msg = "Reason code: 0x1300"; @@ -360,7 +338,7 @@ sub invoke_cmd { my $Rc; my $c = @hcp_list; foreach my $thishcp ( @hcp_list ) { - my $thishcp_type = xCAT::FSPUtils->getTypeOfHcp($thishcp); + my $thishcp_type = xCAT::FSPUtils->getTypeOfNode($thishcp); if(!defined($thishcp_type)) { next; }