[rancid] Fixed Ciena-ws Rancid 3.6.2

heasley heas at shrubbery.net
Mon Jul 31 21:24:49 UTC 2017


Fri, Jul 28, 2017 at 12:50:51PM -0500, Chris Wopat:
> I'm not sure what it is. Confirm that it is indeed in the .raw files I
> sent you a while back.
> 
> The configuration guide doesn't mention it at all, it does specify
> what we already know about > vs #:
> 
>     "When a user with super access privileges is logged in,
>     the CLI prompt for that session contains a # (hash
>     or pound) character (for example, Waveserver #)."

hrm, well, its clearly there.  would you try the patch below (or the
current alpha)?  based on the examples that i have, it ought to work.

> On Fri, Jul 28, 2017 at 12:31 PM, heasley <heas at shrubbery.net> wrote:
> > Tue, Jul 25, 2017 at 06:53:55PM +0000, heasley:
> >> Fri, Jul 21, 2017 at 02:37:08PM -0500, Chris Wopat:
> >> > On 07/21/2017 09:22 AM, heasley wrote:
> >> >
> >> > > great; thanks for testing that.  Just addressing that one point, the patch
> >> > > is:
> >> >
> >> > I tested this patch against the stock wavesvros.pm, did not work, it
> >> > goes back to 'end of run not found' as it was always doing.
> >> >
> >> > Keeping that patch in place, I stepped through the changes from Tanner's
> >> > patch and find that it works with only one change, the addition of this
> >> > line where it is originally stated in context (in sub WriteTerm)
> >> >
> >> >     return (0) if ($found_end == 1)
> >> >
> >> > I did a test run on several Waveservers it seems to work consistently. I
> >> > did not test with a superuser account that would use the # prompt, just
> >> > my limited user with > prompt.
> >>
> >> somehostname-11^>logout
> >>
> >> can you tell me what the ^ is in that prompt?  in 3 of the 5 examples
> >> folks have sent to me, the prompt has this ^ in it after the show
> >> configuration command has run.  This would cause a problem, which is
> >> probably easy to fix if i understand the cause.
> >
> > anyone?

Index: lib/wavesvros.pm.in
===================================================================
--- lib/wavesvros.pm.in	(revision 3720)
+++ lib/wavesvros.pm.in	(working copy)
@@ -65,10 +65,13 @@
 	while (/[>#]\s*($cmds_regexp)\s*$/) {
 	    $cmd = $1;
 	    if (!defined($prompt)) {
-		$prompt = ($_ =~ /^([^>#]+[>#])/)[0];
+		$_ =~ /^([^>#*^]+)([*^])?([>#])/;
+		$prompt = $1;
+		my($tail) = $3;
 		$prompt =~ s/([][}{)(\\])/\\$1/g;
-		# prompt changes when config is unsaved - "foo*> "
-		$prompt =~ s/\*/\\\*/;
+		# prompt changes when config is unsaved - "foo*> " and may be
+		# "foo$> " for some unknown reason.
+		$prompt .= "[*^]?" . $tail . " ?";
 		print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
 	    }
 	    print STDERR ("HIT COMMAND:$_") if ($debug);



More information about the Rancid-discuss mailing list