Skip Menu |

This queue is for tickets about the Net-SSH-Expect CPAN distribution.

Report information
The Basics
Id: 35141
Status: resolved
Priority: 0/
Queue: Net-SSH-Expect

People
Owner: Nobody in particular
Requestors: ptian [...] sonicwall.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Could you add a customizable prompt feature?
Hi Bruno, Thanks for your effort in Net::SSH::Expect, I'm using it in automation test on our hardware firewall, and we found it very useful. But we have to change a little bit as following patch to make it work for our firewall: --- Expect.pm.old 2008-04-11 20:47:26.000000000 +0800 +++ Expect.pm 2008-04-11 20:50:13.000000000 +0800 @@ -161,7 +161,7 @@ $self->_sec_expect($timeout, [ qr/\(yes\/no\)\?\s*$/ => sub { $exp->send("yes$t"); exp_continue; } ], [ qr/[Pp]assword.*?:|[Pp]assphrase.*?:/ => sub { $exp->send("$password$t"); } ], - [ qr/ogin:\s*$/ => sub { $exp->send("$user$t"); exp_continue; } ], + [ qr/ogin:\s*$|[Uu]ser:\s*$/ => sub { $exp->send("$user$t"); exp_continue; } ], [ qr/REMOTE HOST IDEN/ => sub { print "FIX: .ssh/known_hosts\n"; exp_continue; } ], [ timeout => sub { You see, you have the common prompt included in _sec_expect, but there are still many places we have some other prompts. I think it would be better to allow the user specify the login prompt in new(), both user name and password fields. They can have some default values if the user doesn't specify one.
Subject: Re: [rt.cpan.org #35141] Could you add a customizable prompt feature?
Date: Thu, 17 Apr 2008 09:13:05 -0300
To: bug-Net-SSH-Expect [...] rt.cpan.org
From: "Bruno Negrao" <bnegrao [...] gmail.com>
you're right. i'll try to add that this week. thanks. bruno On Thu, Apr 17, 2008 at 1:20 AM, Phio Tian via RT <bug-Net-SSH-Expect@rt.cpan.org> wrote: Show quoted text
> > Thu Apr 17 00:20:13 2008: Request 35141 was acted upon. > Transaction: Ticket created by phio > Queue: Net-SSH-Expect > Subject: Could you add a customizable prompt feature? > Broken in: (no value) > Severity: Normal > Owner: Nobody > Requestors: ptian@sonicwall.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=35141 > > > > Hi Bruno, > > Thanks for your effort in Net::SSH::Expect, I'm using it in automation > test on our hardware firewall, and we found it very useful. But we have > to change a little bit as following patch to make it work for our firewall: > > --- Expect.pm.old 2008-04-11 20:47:26.000000000 +0800 > +++ Expect.pm 2008-04-11 20:50:13.000000000 +0800 > > @@ -161,7 +161,7 @@ > $self->_sec_expect($timeout, > [ qr/\(yes\/no\)\?\s*$/ => sub { $exp->send("yes$t"); > exp_continue; } ], > [ qr/[Pp]assword.*?:|[Pp]assphrase.*?:/ => sub { > $exp->send("$password$t"); } ], > - [ qr/ogin:\s*$/ => sub { $exp->send("$user$t"); > exp_continue; } ], > + [ qr/ogin:\s*$|[Uu]ser:\s*$/ => sub { > $exp->send("$user$t"); exp_continue; } ], > [ qr/REMOTE HOST IDEN/ => sub { print "FIX: .ssh/known_hosts\n"; > exp_continue; } ], > [ timeout => sub > { > > You see, you have the common prompt included in _sec_expect, but there > are still many places we have some other prompts. I think it would be > better to allow the user specify the login prompt in new(), both user > name and password fields. They can have some default values if the user > doesn't specify one. >