Changes of Revision 40
[-] | Changed | rancid.changes |
1
2 ------------------------------------------------------------------- 3 +Sat Sep 10 00:26:31 UTC 2016 - cs@linux-administrator.com 4 + 5 +- added initial patches for brocadevdx module 6 + 7 +------------------------------------------------------------------- 8 Thu Sep 8 18:58:32 UTC 2016 - cs@linux-administrator.com 9 10 - update to release 3.5.1 11 |
||
[-] | Changed | rancid.spec ^ |
21 1
2 Source1: %{name}-dell.tar.bz2 3 Source2: rancid.types.conf 4 Patch0: rancid-skip-ping-test.patch 5 -Patch8: rancid-3.2-brocadevdx.patch 6 +Patch8: rancid-3.2-brocadevdx.patch 7 +Patch9: rancid-3.5.1-brocadevdx.patch 8 +Patch10: rancid-3.5.1-brocadevdx_makefile.patch 9 10 BuildRoot: %{_tmppath}/%{name}-%{version}-build 11 BuildRequires: glibc-devel libgcc gcc gcc-c++ expect >= 5.40 mailx iputils autoconf automake 12
13 %patch0 14 %endif 15 %patch8 16 +%patch9 17 +%patch10 18 19 %build 20 %if 0%{?rhel} >= 7 21 |
||
[+] | Changed | rancid-3.2-brocadevdx.patch ^ |
@@ -17,19 +17,3 @@ } expect -re $prompt {} } else { ---- lib/foundry.pm.in.orig 2015-05-29 15:24:49.881449738 +0200 -+++ lib/foundry.pm.in 2015-05-29 17:12:23.678241627 +0200 -@@ -355,7 +355,12 @@ - return(1); - } - } -- return(0); -+ if ( $devtype eq "brocadevdx" ) { -+ $found_end = 1; -+ return(1); -+ } else { -+ return(0); -+ } - } - - 1; | ||
[+] | Added | rancid-3.5.1-brocadevdx.patch ^ |
@@ -0,0 +1,411 @@ +--- lib/brocadevdx.pm.in.orig 2016-09-10 02:02:33.289414464 +0200 ++++ lib/brocadevdx.pm.in 2016-09-10 02:19:59.648346737 +0200 +@@ -0,0 +1,408 @@ ++package brocadevdx; ++## ++## $Id: foundry.pm.in 3424 2016-07-12 14:43:44Z heas $ ++## ++## @PACKAGE@ @VERSION@ ++@copyright@ ++# ++# RANCID - Really Awesome New Cisco confIg Differ ++# ++# foundry.pm - Foundry rancid procedures ++ ++use 5.010; ++use strict 'vars'; ++use warnings; ++no warnings 'uninitialized'; ++require(Exporter); ++our @ISA = qw(Exporter); ++ ++use rancid @VERSION@; ++ ++@ISA = qw(Exporter rancid main); ++#XXX @Exporter::EXPORT = qw($VERSION @commandtable %commands @commands); ++ ++# load-time initialization ++sub import { ++ 0; ++} ++ ++# post-open(collection file) initialization ++sub init { ++ # add content lines and separators ++ ProcessHistory("","","","!RANCID-CONTENT-TYPE: $devtype\n!\n"); ++ ++ 0; ++} ++ ++# main loop of input of device output ++sub inloop { ++ my($INPUT, $OUTPUT) = @_; ++ my($cmd, $rval); ++ ++TOP: while(<$INPUT>) { ++ tr/\015//d; ++ if (/^Error:/) { ++ print STDOUT ("$host flogin error: $_"); ++ print STDERR ("$host flogin error: $_") if ($debug); ++ $clean_run = 0; ++ last; ++ } ++ while (/[>#]\s*($cmds_regexp)\s*$/) { ++ $cmd = $1; ++ # Some devices can give an error that looks a lot like a prompt ++ # for deprecated commands like "write term". Ignore that. ++ if (/^invalid input -> /i) { ++ print STDERR ("Ignoring invalid command: $cmd\n") if ($debug); ++ last; ++ } ++ if (!defined($prompt)) { ++ $prompt = ($_ =~ /^([^#]+#)/)[0]; ++ $prompt =~ s/([][}{)(\\])/\\$1/g; ++ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug); ++ } ++ print STDERR ("HIT COMMAND:$_") if ($debug); ++ if (! defined($commands{$cmd})) { ++ print STDERR "$host: found unexpected command - \"$cmd\"\n"; ++ $clean_run = 0; ++ last TOP; ++ } ++ if (! defined(&{$commands{$cmd}})) { ++ printf(STDERR "$host: undefined function - \"%s\"\n", ++ $commands{$cmd}); ++ $clean_run = 0; ++ last TOP; ++ } ++ $rval = &{$commands{$cmd}}($INPUT, $OUTPUT, $cmd); ++ delete($commands{$cmd}); ++ if ($rval == -1) { ++ $clean_run = 0; ++ last TOP; ++ } ++ } ++ if (/\#exit$/) { ++ $clean_run = 1; ++ last; ++ } ++ } ++} ++ ++# This routine parses "show version" ++sub ShowVersion { ++ my($INPUT, $OUTPUT) = @_; ++ my($slot); ++ ++ print STDERR " In ShowVersion: $_" if ($debug); ++ ++ while (<$INPUT>) { ++ tr/\015//d; ++ next if /^\s*$/; ++ last if (/^$prompt/); ++ ++ next if (/^(The system |Crash time)/); ++ next if (/^(System|(Active|Standby) Management|LP Slot \d+|Switch Fabric Module \d+) (uptime|Up Time) is/); ++ # remove uptime on newer switches ++ s/(STACKID \d+)\s+system uptime is.*$/$1/; ++ ++ s/^\s*(HW|SW)/$1/; ++ s/^\s*(Compiled on)/SW: $1/; ++ s/^\s*(\(\d+ bytes\) from )/SW: $1/; ++ ++ #s/^(HW.*)/$1\n/; ++ if (/^SL (\d+)/) { ++ $slot = "Slot $1"; ++ s/^SL \d+/$slot/; ++ } ++ if (/MHz .* processor/) { ++ $slot = "MGMT"; ++ } ++ s/^(\s*\d+ )/$slot:$1/; ++ s/^===*//; ++ ++ ProcessHistory("VERSION","","","!$_"); ++ } ++ ProcessHistory("VERSION","","","!\n"); ++ return(0); ++} ++ ++# This routine parses "show chassis" ++sub ShowChassis { ++ my($INPUT, $OUTPUT) = @_; ++ my($skip) = 0; ++ ++ print STDERR " In ShowChassis: $_" if ($debug); ++ ++ while (<$INPUT>) { ++ tr/\015//d; ++ last if (/^$prompt/); ++ next if (/ from /); ++ next if (/current temperature/i); ++ return(1) if (/^\s+\^$/); # edgeiron invalid command ++ ++ if (/^---/ || /^$/) { # next section reached ++ $skip = 0; ++ } ++ if (/(POWERS|TEMPERATURE READINGS)/) { ++ $skip = 1; ++ } ++ if (/fan controlled temperature:/i || ++ /fan speed switching temperature thresholds/i) { ++ $skip = 1; ++ } ++ if (/THERMAL PLANE/) { ++ $skip = 1; ++ } ++ if (/(pressure|altitude|temperature):/i) { ++ $skip = 1; ++ } ++ s/(Fan \d+ \S+), speed .*/$1/; ++ if (/speed/i) { ++ $skip = 1; ++ } ++ next if $skip; ++ ++ ProcessHistory("CHASSIS","","","! $_"); ++ } ++ ProcessHistory("CHASSIS","","","!\n"); ++ return(0); ++} ++ ++# This routine parses "show flash" ++sub ShowFlash { ++ my($INPUT, $OUTPUT) = @_; ++ print STDERR " In ShowFlash: $_" if ($debug); ++ ++ while (<$INPUT>) { ++ tr/\015//d; ++ last if (/^$prompt/); ++ next if (/^\s*$/); ++ return(1) if (/^\s+\^$/); # edgeiron invalid command ++ ++ if (/code flash free space = (\d+)/i) { ++ my($tmp) = $1; ++ if ($tmp >= (1024 * 1024 * 1024)) { ++ $tmp = int($tmp / (1024 * 1024 * 1024)); ++ $_ = "code flash free space = $tmp GB\n"; ++ } elsif ($tmp >= (1024 * 1024)) { ++ $tmp = int($tmp / (1024 * 1024)); ++ $_ = "code flash free space = $tmp MB\n"; ++ } elsif ($tmp >= (1024)) { ++ $tmp = int($tmp / 1024); ++ $_ = "code flash free space = $tmp KB\n"; ++ } elsif ($tmp > 0) { ++ $_ = "code flash free space = < 1KB\n"; ++ } else { ++ $_ = "code flash free space = 0 bytes\n"; ++ } ++ } | ||
[+] | Added | rancid-3.5.1-brocadevdx_makefiles.patch ^ |
@@ -0,0 +1,35 @@ +--- lib/Makefile.in.orig 2016-09-10 02:21:13.620344188 +0200 ++++ lib/Makefile.in 2016-09-10 02:22:01.536342988 +0200 +@@ -273,7 +273,7 @@ + my_pkglib_DATA = rancid.pm acos.pm aeos.pm arbor.pm bigip.pm ciscowlc.pm \ + dell.pm edgemax.pm edgerouter.pm eos.pm exos.pm foundry.pm \ + ios.pm iosxr.pm junos.pm mrv.pm nxos.pm panos.pm rbt.pm \ +- wavesvros.pm ++ wavesvros.pm brocadevdx.pm + + pkglib_in = $(my_pkglib_DATA:%=%.in) + RANLIB = : +@@ -544,6 +544,7 @@ + panos.pm: panos.pm.in + rbt.pm: rbt.pm.in + wavesvros.pm: wavesvros.pm.in ++brocadevdx.pm: brocadevdx.pm.in + + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. +--- lib/Makefile.am.orig 2016-09-10 02:21:22.860343473 +0200 ++++ lib/Makefile.am 2016-09-10 02:22:37.136343266 +0200 +@@ -10,7 +10,7 @@ + my_pkglib_DATA = rancid.pm acos.pm aeos.pm arbor.pm bigip.pm ciscowlc.pm \ + dell.pm edgemax.pm edgerouter.pm eos.pm exos.pm foundry.pm \ + ios.pm iosxr.pm junos.pm mrv.pm nxos.pm panos.pm rbt.pm \ +- wavesvros.pm ++ wavesvros.pm brocadevdx.pm + pkglib_in = $(my_pkglib_DATA:%=%.in) + + RANLIB= : +@@ -74,3 +74,4 @@ + panos.pm: panos.pm.in + rbt.pm: rbt.pm.in + wavesvros.pm: wavesvros.pm.in ++brocadevdx.pm: brocadevdx.pm.in | ||
[+] | Changed | rancid.types.conf ^ |
@@ -1,11 +1,11 @@ # BROCADE VDX 6740 brocadevdx;script;rancid -t brocadevdx brocadevdx;login;clogin -brocadevdx;module;foundry -brocadevdx;inloop;foundry::inloop -brocadevdx;command;foundry::ShowVersion;show version all-partitions -brocadevdx;command;foundry::ShowChassis;show chassis -brocadevdx;command;foundry::WriteTerm;show running-config +brocadevdx;module;brocadevdx +brocadevdx;inloop;brocadevdx::inloop +brocadevdx;command;brocadevdx::ShowVersion;show version all-partitions +brocadevdx;command;brocadevdx::ShowChassis;show chassis +brocadevdx;command;brocadevdx::ShowConfiguration;show running-config # # DELL Powerconnect switches powerconnect;script;drancid |