Sha256: fe4c4cad1c50f7b2f34b9055b328c7bb40494c343cdf5f71023ed3d8e7cf5043

Contents?: true

Size: 812 Bytes

Versions: 4

Compression:

Stored size: 812 Bytes

Contents

class Comware < Oxidized::Model
  # HP (A-series)/H3C/3Com Comware
  
  prompt /^(<[\w.-]+>)$/
  comment '# '

  # example how to handle pager
  #expect /^\s*---- More ----$/ do |data, re|
  #  send ' '
  #  data.sub re, ''
  #end

  cmd :all do |cfg|
    #cfg.gsub! /^.*\e\[42D/, ''        # example how to handle pager
    cfg.each_line.to_a[1..-2].join
  end
 
  cfg :telnet do
    username /^Username:$/
    password /^Password:$/
  end

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

  cmd 'display version' do |cfg|
    cfg = cfg.each_line.select {|l| not l.match /uptime/ }.join
    comment cfg
  end

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
oxidized-0.5.0 lib/oxidized/model/comware.rb
oxidized-0.4.1 lib/oxidized/model/comware.rb
oxidized-0.4.0 lib/oxidized/model/comware.rb
oxidized-0.3.0 lib/oxidized/model/comware.rb