From 8f7089b0c3d5094a267ea1932804614bfd410e4a Mon Sep 17 00:00:00 2001 From: sakolish Date: Tue, 22 Apr 2008 15:51:48 +0000 Subject: [PATCH] Added site.ppctimeout to control connect/command timeout git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1152 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/PPCcli.pm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/perl-xCAT-2.0/xCAT/PPCcli.pm b/perl-xCAT-2.0/xCAT/PPCcli.pm index 974520fbd..8277f35e7 100644 --- a/perl-xCAT-2.0/xCAT/PPCcli.pm +++ b/perl-xCAT-2.0/xCAT/PPCcli.pm @@ -66,13 +66,19 @@ sub connect { my $hwtype = shift; my $server = shift; my $verbose = shift; + my $timeout = shift; my $pwd_prompt = 'assword: $'; my $continue = 'continue connecting (yes/no)?'; - my $timeout = 30; my $success = 0; my $pwd_sent = 0; my $expect_log; + ################################################## + # Use timeout from site table (if defined) + ################################################## + if ( !defined( $timeout )) { + $timeout = DEFAULT_TIMEOUT; + } ################################################## # Shell prompt regexp based on HW Type ################################################## @@ -184,6 +190,7 @@ sub connect { # UserId # Password # Redirected STDERR/STDOUT + # Connect/Command timeout ########################################## if ( $success ) { return( $ssh, @@ -192,7 +199,8 @@ sub connect { $server, $cred[0], $cred[1], - \$expect_log ); + \$expect_log, + $timeout ); } ########################################## # Failed logon - kill ssh process @@ -748,10 +756,10 @@ sub send_cmd { my $prompt = @$exp[1]; ########################################## - # Set default Expect timeout + # Use timeout from site table (if defined) ########################################## if ( !defined( $timeout )) { - $timeout = DEFAULT_TIMEOUT; + $timeout = @$exp[7]; } ########################################## # Send command @@ -880,3 +888,4 @@ sub power_cmd { +