summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2014-07-23 20:43:16 +0300
committerytti <saku@ytti.fi>2014-07-23 20:43:16 +0300
commitce190a6297b72cf33c40df5c726cc1ffea8c413d (patch)
tree16562ccb7e1f5d50e23dfc046b9c74e997c0f2c4
parent0972f5b63434540c64d2ebb9879eee396ad1569d (diff)
parent724607c2942cfde53d9cb6a5d3b189f8ef9d17c0 (diff)
Merge pull request #29 from thakala/master
Brocade Vyatta model added
-rw-r--r--lib/oxidized/model/vyatta.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/oxidized/model/vyatta.rb b/lib/oxidized/model/vyatta.rb
new file mode 100644
index 0000000..8d977aa
--- /dev/null
+++ b/lib/oxidized/model/vyatta.rb
@@ -0,0 +1,27 @@
+class Vyatta < Oxidized::Model
+
+ # Brocade Vyatta / VyOS model #
+
+ prompt /\@.*?\:~\$\s/
+
+ cmd :all do |cfg|
+ cfg = cfg.lines.to_a[1..-2].join
+ end
+
+ cmd :secret do |cfg|
+ cfg.gsub! /community (\S+) {/, 'community <hidden> {'
+ cfg
+ end
+
+ cmd 'show configuration | no-more'
+
+ cfg :telnet do
+ username /login:\s/
+ password /^Password:\s/
+ end
+
+ cfg :telnet, :ssh do
+ pre_logout 'exit'
+ end
+
+end