Class: SonicOS

Inherits:
Oxidized::Model show all
Defined in:
lib/oxidized/model/sonicos.rb

Instance Attribute Summary

Attributes inherited from Oxidized::Model

#input, #node

Instance Method Summary collapse

Methods inherited from Oxidized::Model

cfg, #cfg, cfgs, cmd, #cmd, cmds, comment, #comment, expect, #expect, expects, #expects, #get, inherited, #output, post, pre, prompt, #prompt, #screenscrape, #send, #xmlcomment

Methods included from Oxidized::Config::Vars

#vars

Instance Method Details

#clean(cfg) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oxidized/model/sonicos.rb', line 47

def clean(cfg)
  out = []
  cfg.each_line do |line|
    next if line =~ /date \d{4}:\d{2}:\d{2}/
    next if line =~ /time \d{2}:\d{2}:\d{2}/
    next if line =~ /system-time "\d{2}\/\d{2}\/\d{4} \d{2}:\d{2}:\d{2}.\d+"/
    next if line =~ /system-uptime "((\s+up\s+\d+\s+)|(\d+\s\w+(,\s)?)*)"/
    next if line =~ /checksum \d+/

    line = line[1..-1] if line[0] == "\r"
    out << line.strip
  end
  out = out.join "\n"
  out << "\n"
end