From f17d4135caab13346ed773f39e064c3e795f8a68 Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Tue, 30 Aug 2011 12:17:23 +0000 Subject: [PATCH] Fixed one issue that in the case of first boot try failed, and second boot try succeed, rnetboot still returns the first try's error. If second try succeed, it means rnetboot succeed, it should return success. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10393 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPboot.pm | 6 ++++-- perl-xCAT/xCAT/PPCboot.pm | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/FSPboot.pm b/perl-xCAT/xCAT/FSPboot.pm index 190a1d4db..bff368d26 100644 --- a/perl-xCAT/xCAT/FSPboot.pm +++ b/perl-xCAT/xCAT/FSPboot.pm @@ -31,8 +31,9 @@ sub do_rnetboot { my $ssh = @$exp[0]; my $userid = @$exp[4]; my $pw = @$exp[5]; + my $result = ""; + my $Rc = SUCCESS; my $cmd; - my $result; ####################################### # Disconnect Expect session @@ -121,8 +122,9 @@ sub do_rnetboot { $cmd.= " -f \"$name\" \"$pprofile\" \"$fsp\" $id $hcp \"$node\""; print "cmd: $cmd\n"; my $done = 0; - my $Rc = SUCCESS; while ( $done < 2 ) { + $result = ""; + $Rc = SUCCESS; ####################################### # Execute command ####################################### diff --git a/perl-xCAT/xCAT/PPCboot.pm b/perl-xCAT/xCAT/PPCboot.pm index cd2f3df64..5fb3d923a 100644 --- a/perl-xCAT/xCAT/PPCboot.pm +++ b/perl-xCAT/xCAT/PPCboot.pm @@ -107,9 +107,10 @@ sub do_rnetboot { my $ssh = @$exp[0]; my $userid = @$exp[4]; my $pw = @$exp[5]; - my $subreq = $request->{subreq}; + my $subreq = $request->{subreq}; + my $Rc = SUCCESS; + my $result = ""; my $cmd; - my $result; ####################################### # Disconnect Expect session @@ -181,7 +182,6 @@ sub do_rnetboot { $cmd.= " -o"; } - my $Rc = SUCCESS; my @macs = split /,/, $opt->{m}; foreach my $mac ( @macs ) { ####################################### @@ -259,6 +259,8 @@ sub do_rnetboot { my $done = 0; while ( $done < 2 ) { + $result = ""; + $Rc = SUCCESS; ####################################### # Execute command #######################################