diff options
author | ytti <saku@ytti.fi> | 2014-07-23 20:43:16 +0300 |
---|---|---|
committer | ytti <saku@ytti.fi> | 2014-07-23 20:43:16 +0300 |
commit | ce190a6297b72cf33c40df5c726cc1ffea8c413d (patch) | |
tree | 16562ccb7e1f5d50e23dfc046b9c74e997c0f2c4 /lib/oxidized/model/vyatta.rb | |
parent | 0972f5b63434540c64d2ebb9879eee396ad1569d (diff) | |
parent | 724607c2942cfde53d9cb6a5d3b189f8ef9d17c0 (diff) |
Merge pull request #29 from thakala/master
Brocade Vyatta model added
Diffstat (limited to 'lib/oxidized/model/vyatta.rb')
-rw-r--r-- | lib/oxidized/model/vyatta.rb | 27 |
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 |