From b67a60c42297968fe3afc06d3f4441781296cf02 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sat, 19 May 2012 13:58:10 +0000 Subject: [PATCH] Fix SSHInteract to manuever IMMv2 login git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12821 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/SSHInteract.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/SSHInteract.pm b/xCAT-server/lib/perl/xCAT/SSHInteract.pm index ea7b7d9f9..717dba38b 100644 --- a/xCAT-server/lib/perl/xCAT/SSHInteract.pm +++ b/xCAT-server/lib/perl/xCAT/SSHInteract.pm @@ -63,11 +63,15 @@ sub new { #$self->waitfor("-match" => '/password:/i', -errmode => "return") or die "Unable to reach host ",$self->lastline; $self->print($password); my $nextline = $self->getline(); - if ($nextline eq "\n") { + chomp($nextline); + while ($nextline =~ /^\s*$/) { $nextline = $self->get(); + chomp($nextline); } if ($nextline =~ /^password:/ or $nextline =~ /Permission denied, please try again/) { die "Incorrect Password"; + } elsif ($nextline =~ /$promptex/) { + *$self->{_xcatsshinteract}->{_atprompt}=1; } } elsif ($match =~ /$promptex/) { *$self->{_xcatsshinteract}->{_atprompt}=1;