summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBrad Searle <bobthebutcher@users.noreply.github.com>2018-07-01 19:57:38 +1000
committerWild Kat <wk@users.noreply.github.com>2018-07-01 11:57:38 +0200
commitae2d1a202cdfa3c8dd488b8be045e025234913ae (patch)
tree5eaef511ee3624b7c3aa1d0da6460dbb6dc4a1a1 /lib
parent80885e508a41e11c30a31431c6791fcdc4c90220 (diff)
Add Viptela model (closes #1376) (#1427)
Diffstat (limited to 'lib')
-rw-r--r--lib/oxidized/model/viptela.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/oxidized/model/viptela.rb b/lib/oxidized/model/viptela.rb
new file mode 100644
index 0000000..f08e1b4
--- /dev/null
+++ b/lib/oxidized/model/viptela.rb
@@ -0,0 +1,29 @@
+class Viptela < Oxidized::Model
+ # Cisco Vipetla
+
+ prompt /[-\w]+#\s$/
+ comment '! '
+
+ cmd :all do |cfg|
+ cfg.each_line.to_a[1..-2].join
+ end
+
+ cmd :secret do |cfg|
+ cfg.gsub! /(^\s+secret-key|password|auth-password|priv-password)\s+.*$/, '\\1 <secret hidden>'
+ cfg.gsub! /(^\s+community)\s.*$/, '\\1 <secret hidden>'
+ cfg
+ end
+
+ cmd 'show running-config' do |cfg|
+ cfg
+ end
+
+ cmd 'show version' do |cfg|
+ comment cfg
+ end
+
+ cfg :ssh do
+ post_login 'paginate false'
+ pre_logout 'exit'
+ end
+end