[rancid] Fixed Ciena-ws Rancid 3.6.2

heasley heas at shrubbery.net
Fri Jul 21 15:35:04 UTC 2017


Wed, Jul 19, 2017 at 03:48:28PM +0000, heasley:
> Mon, Jun 19, 2017 at 12:14:37PM -0500, Tanner Lyle:
> > Ciena Engineer provided the changes needed, prompts were not matching make
> > following changes to your wavesvros.pm file in /usr/local/rancid/lib/rancid/
> > 

> > *Line 140*
> > *change this line*
> >        if (/>\s*exit/) {
> > *to this*
> >        if (/\s*exit/) {

This should not be necessary; and would/could be a problem.  if this is
still necesary after the patch I sent, there is another problem that
this change is masking.

> > *Line 207 add *
> >         $found_end = 0;

This is already initialized in rancid.pm.  What is the error that led to
this change?

> > *from this*
> > 
> > # This routine parses "configuration show"
> > sub WriteTerm {
> >     my($INPUT, $OUTPUT, $cmd) = @_;
> >     my($snmp) = 0;
> >     print STDERR "    In ShowConfiguration: $_" if ($debug);
> > 
> >     # include the command
> > 
> > *to this*
> > 
> > # This routine parses "configuration show"
> > sub WriteTerm {
> >     my($INPUT, $OUTPUT, $cmd) = @_;
> >     my($snmp) = 0;
> >         $found_end = 0;
> >     print STDERR "    In ShowConfiguration: $_" if ($debug);
> > 
> >     # include the command
> > 
> > *Original line 212 now line 214*
> > 
> > *from this *
> > 
> >     while (<$INPUT>) {
> >         tr/\015//d;
> >         last if (/^$prompt/);
> >         /no matching entry found/ && return(-1);        # unknown cmd
> > 
> > *to this*
> > 
> >     while (<$INPUT>) {
> >         tr/\015//d;
> >                 return (0) if (/^$prompt/);
> >         /no matching entry found/ && return(-1);        # unknown cmd
> >             return (0) if ($found_end == 1);

Unless the prompt is not being parsed and suffed in $prompt properly, this
shouldn't be necessary.

> > 
> > *Change Line 265*
> > 
> > *from this*
> > 
> >        if (/^! END OF CONFIG:/) {
> > 
> > *to this*
> > 
> >         if (/! END OF CONFIG:/) {

This shouldn't be necessary.  Is there a case where the ! is not at the
beginning of the line?  Is the pager perhaps not being disabled properly?
The command is in the hlogin.

I guess, please try it with just the patch that I sent (or the current
alpha).  if that fails, share the devicename.raw file with me:
	NOPIPE=YES; export NOPIPE
	rancid -t ciena -d devicename

and, i'll go back to look at the one you (i think) already shared.

> > For those of you better at reading diffs than me
> > 
> > [rancid at localhost rancid]$ diff wavesvros.pm wavesvros.pm.orig

diff -u will help you.



More information about the Rancid-discuss mailing list