summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/powerconnect.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/model/powerconnect.rb')
-rw-r--r--lib/oxidized/model/powerconnect.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/oxidized/model/powerconnect.rb b/lib/oxidized/model/powerconnect.rb
index f602a36..bf36f65 100644
--- a/lib/oxidized/model/powerconnect.rb
+++ b/lib/oxidized/model/powerconnect.rb
@@ -1,12 +1,11 @@
class PowerConnect < Oxidized::Model
-
prompt /^([\w\s.@-]+[#>]\s?)$/ # allow spaces in hostname..dell does not limit it.. #
- comment '! '
+ comment '! '
expect /^\s*--More--\s+.*$/ do |data, re|
- send ' '
- data.sub re, ''
+ send ' '
+ data.sub re, ''
end
cmd :all do |cfg|
@@ -22,7 +21,7 @@ class PowerConnect < Oxidized::Model
if (@stackable.nil?)
@stackable = true if cfg.match /(U|u)nit\s/
end
- cfg = cfg.split("\n").select { |line| not line[/Up\sTime/] }
+ cfg = cfg.split("\n").reject { |line| line[/Up\sTime/] }
comment cfg.join("\n") + "\n"
end
@@ -52,7 +51,6 @@ class PowerConnect < Oxidized::Model
post_login "terminal length 0"
pre_logout "logout"
pre_logout "exit"
-
end
def clean cfg
@@ -72,9 +70,8 @@ class PowerConnect < Oxidized::Model
end
out << line.strip
end
- out = out.select { |line| not line[/Up\sTime/] }
+ out = out.reject { |line| line[/Up\sTime/] }
out = comment out.join "\n"
out << "\n"
end
-
end