summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/fiberdriver.rb
blob: bdfe903a43e0bfdb9c8e7508c46a39c080a5efd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class FiberDriver < Oxidized::Model
  prompt /\w+#/
  comment "! "

  cmd :all do |cfg|
    cfg.cut_both
  end
  cmd 'show inventory' do |cfg|
    comment cfg
  end

  cmd "show running-config" do |cfg|
    cfg.each_line.to_a[3..-1].join
    cfg.gsub! /^Building configuration.*$/, ''
    cfg.gsub! /^Current configuration:.*$$/, ''
    cfg.gsub! /^! Configuration (saved|generated) on .*$/, ''
    cfg
  end

  cfg :ssh do
    post_login 'terminal length 0'
    post_login 'terminal width 512'
    pre_logout 'exit'
  end
end