summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-06-25 11:40:36 +0300
committerGitHub <noreply@github.com>2016-06-25 11:40:36 +0300
commit3932679b86113dcc496575b144cb797eb0c29599 (patch)
treee73801b16b46c952ac11213bc56665c73f42b2b2
parentfd4833c64f18528cf5bbf44f46edef43e61fa2bc (diff)
parent07834a01808bcc38276931001b38c288ec2439b8 (diff)
Merge pull request #480 from cardboardpig/cardboardpig-br6910-patch-1
Add support for Brocade 6910 (br6910)
-rw-r--r--README.md1
-rw-r--r--lib/oxidized/model/br6910.rb45
2 files changed, 46 insertions, 0 deletions
diff --git a/README.md b/README.md
index 6f36fa4..482912c 100644
--- a/README.md
+++ b/README.md
@@ -62,6 +62,7 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen
* Ironware
* NOS (Network Operating System)
* Vyatta
+ * 6910
* Ciena
* SOAS
* Cisco
diff --git a/lib/oxidized/model/br6910.rb b/lib/oxidized/model/br6910.rb
new file mode 100644
index 0000000..b5c9bcf
--- /dev/null
+++ b/lib/oxidized/model/br6910.rb
@@ -0,0 +1,45 @@
+
+class BR6910 < Oxidized::Model
+
+ prompt /^Vty-[0-9]\#$/
+ comment '! '
+
+ # not possible to disable paging prior to show running-config
+ expect /^((.*)Others to exit ---(.*))$/ do |data, re|
+ send 'a'
+ data.sub re, ''
+ end
+
+ cmd :all do |cfg|
+ # sometimes br6910s inserts arbitrary whitespace after commands are
+ # issued on the CLI, from run to run. this normalises the output.
+ cfg.each_line.to_a[1..-2].drop_while { |e| e.match /^\s+$/ }.join
+ end
+
+ cmd 'show version' do |cfg|
+ comment cfg
+ end
+
+ # show flash is not possible on a brocade 6910, do dir instead
+ # to see flash contents (includes config file names)
+ cmd 'dir' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show running-config' do |cfg|
+ arr = cfg.each_line.to_a
+ arr[2..-1].join unless arr.length < 2
+ end
+
+ cfg :telnet do
+ username /^Username:/
+ password /^Password:/
+ end
+
+ # post login and post logout
+ cfg :telnet, :ssh do
+ post_login ''
+ pre_logout 'exit'
+ end
+
+end