Sha256: efa2a6d2537200b41d3b9eef09098035c54ea0d89cd1acea221a2ad7adb5404f

Contents?: true

Size: 1013 Bytes

Versions: 3

Compression:

Stored size: 1013 Bytes

Contents

class BR6910 < Oxidized::Model
  using Refinements

  prompt /^([\w.@()-]+[#>]\s?)$/
  comment '! '

  # not possible to disable paging prior to show running-config
  expect /^((.*)Others to exit ---(.*))$/ do |data, re|
    send 'a'
    data.sub re, ''
  end

  cmd :all do |cfg|
    # sometimes br6910s inserts arbitrary whitespace after commands are
    # issued on the CLI, from run to run.  this normalises the output.
    cfg.each_line.to_a[1..-2].drop_while { |e| e.match /^\s+$/ }.join
  end

  cmd 'show version' do |cfg|
    comment cfg
  end

  # show flash is not possible on a brocade 6910, do dir instead
  # to see flash contents (includes config file names)
  cmd 'dir' do |cfg|
    comment cfg
  end

  cmd 'show running-config' do |cfg|
    arr = cfg.each_line.to_a
    arr[2..-1].join unless arr.length < 2
  end

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

  # post login and post logout
  cfg :telnet, :ssh do
    post_login ''
    pre_logout 'exit'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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