in reply to Re^4: Problem with Net::SSH::Expect on unavailable hosts
in thread Problem with Net::SSH::Expect on unavailable hosts
$success contains the return value of the spawn method in the Expect object. The spawn method in Expect forks the ssh process. As soon as this method is called, ssh is off and running (and we'd better be thinking in async mode). From what I can tell, the spawn method in Expect only returns undef if fork fails or if it's unable to sync with the child process immediately after the fork (I assume to confirm that the process started). Except for those two instances, the eventual return value of run_ssh is going to be positive.sub run_ssh { my Net::SSH::Expect $self = shift; #(clipped setting up of user options and flags) my $exp = new Expect(); #(clipped setting of Expect options based on user opts/flags) my $success = $exp->spawn($ssh_string); return (defined $success); }
|
|---|