[rancid] [PATCH] hlogin: turn off paging on HP ProCurve 7000dl
heasley
heas at shrubbery.net
Wed Feb 29 01:09:10 UTC 2012
Tue, Feb 28, 2012 at 09:46:08PM +0100, Matej Vela:
> Hi,
>
> hlogin currently disables paging with "no page", which works as expected
> on the 2500, 2600, 2800, and 2900 series. However, the 7000dl series
> expects "terminal length 0", as documented here:
>
> <http://www.hp.com/rnd/support/manuals/7000dl.htm>
>
> (The Command Line Interface Reference Guide from September 2007 has this
> on page 294.)
>
> The attached patch simply sends both "no page" and "terminal length 0".
> It's been included in the Debian package since March 2011:
>
> <http://bugs.debian.org/577111>
>
> I don't have access to a 7000dl, so perhaps someone else can provide
> additional confirmation, but the other models mentioned above continue
> to work fine.
looking at that bug report, i'm guessing that setting length to 0 might
trigger a bug - we've seen that before with other vendors and foundry
nor hp tend to be very resilient. so, this should probably only send
that cmd if 'no page' fails.
however, i'd first ask from whom hp OEM'd that switch. it might be that
it would be better served as a different vendor. if it is an OEM, does
anyone know who made it?
> Thanks,
>
> Matej
> diff -ruN rancid-2.3.8~/bin/hlogin.in rancid-2.3.8/bin/hlogin.in
> --- rancid-2.3.8~/bin/hlogin.in
> +++ rancid-2.3.8/bin/hlogin.in
> @@ -521,11 +521,17 @@
> set in_proc 1
>
> # Turn off the pager and escape regex meta characters in the $prompt
> - send "no page\r"
> regsub -all {[)(]} $prompt {\\&} reprompt
> regsub -all {^(.{1,11}).*([#>])$} $reprompt {\1([^#>\r\n]+)?[#>](\\([^)\\r\\n]+\\))?} reprompt
> + send "no page\r"
> + expect {
> + -re $reprompt {}
> + -re "\[\n\r]+" { exp_continue }
> + }
> + send "terminal length 0\r"
> expect {
> -re $reprompt {}
> + -re "Invalid input: 0\[\n\r]+" { exp_continue }
> -re "\[\n\r]+" { exp_continue }
> }
> # this is the only way i see to get rid of more prompts in o/p..grrrrr
> @@ -780,6 +786,11 @@
> # disable the pager
> send "no page\r"
> expect -re $prompt {}
> + send "terminal length 0\r"
> + expect {
> + -re $prompt {}
> + -re "Invalid input: 0\[\n\r]+" { exp_continue }
> + }
> source $sfile
> catch {close};
> } else {
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
More information about the Rancid-discuss
mailing list