summaryrefslogtreecommitdiff
path: root/lib/oxidized
diff options
context:
space:
mode:
authorKoen van den Heuvel <hello@koenvdheuvel.me>2017-08-01 12:37:29 +0200
committerGitHub <noreply@github.com>2017-08-01 12:37:29 +0200
commit903cbd16e53b0339aac7a1192b3bd129ce552565 (patch)
treead88dd5a75a1997855102918bca3582dfbadda71 /lib/oxidized
parentff1a54102606dfc47d7fb33036ccbb3cb2edde2a (diff)
Update enterasys.rb remove empty and comment lines
Diffstat (limited to 'lib/oxidized')
-rw-r--r--lib/oxidized/model/enterasys.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/oxidized/model/enterasys.rb b/lib/oxidized/model/enterasys.rb
index fb5a501..708d380 100644
--- a/lib/oxidized/model/enterasys.rb
+++ b/lib/oxidized/model/enterasys.rb
@@ -1,20 +1,25 @@
class Enterasys < Oxidized::Model
- # Enterasys B3 model #
+ # Enterasys B3/C3 models #
prompt /^.+\w\(su\)->\s?$/
comment '!'
cmd :all do |cfg|
- cfg.each_line.to_a[1..-2].join
+ cfg.each_line.to_a[2..-3].map{|line|line.delete("\r").rstrip}.join("\n") + "\n"
end
cmd 'show system hardware' do |cfg|
- cfg
+ comment cfg
end
cmd 'show config' do |cfg|
+ cfg.gsub! /^This command shows non-default configurations only./, ''
+ cfg.gsub! /^Use 'show config all' to show both default and non-default configurations./, ''
+ cfg.gsub! /^!|#.*/, ''
+ cfg.gsub! /^$\n/, ''
+
cfg
end