summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/fiberdriver.rb
blob: abe8f681f6875d9229a29634b9863cf199745653 (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.each_line.to_a[1..-2].join
  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 on .*$/, ''
    cfg
  end

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