Sha256: 8c73b9f4dd77bf6d87c3a0071aae95fbf2b0353f862d35c635188822354a41a3

Contents?: true

Size: 764 Bytes

Versions: 3

Compression:

Stored size: 764 Bytes

Contents

class H3C < Oxidized::Model
  using Refinements

  # H3C

  prompt /^.*(<[\w.-]+>)$/
  comment '# '

  cmd :secret do |cfg|
    cfg.gsub! /(pin verify (?:auto|)).*/, '\\1 <PIN hidden>'
    cfg.gsub! /(%\^%#.*%\^%#)/, '<secret hidden>'
    cfg
  end

  cmd :all do |cfg|
    cfg.cut_both
  end

  cfg :telnet do
    username /^Username:$/
    password /^Password:$/
  end

  cfg :telnet, :ssh do
    post_login 'screen-length disable'
    pre_logout 'quit'
  end

  cmd 'display version' do |cfg|
    cfg = cfg.each_line.reject { |l| l.match /uptime/ }.join
    cfg = cfg.each_line.reject { |l| l.match /Uptime is/ }.join
    comment cfg
  end

  cmd 'display device' do |cfg|
    comment cfg
  end

  cmd 'display current-configuration' do |cfg|
    cfg
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
oxidized-0.30.1 lib/oxidized/model/h3c.rb
oxidized-0.30.0 lib/oxidized/model/h3c.rb
oxidized-0.29.1 lib/oxidized/model/h3c.rb