diff options
author | Wild Kat <wk@users.noreply.github.com> | 2018-05-26 23:49:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-26 23:49:29 +0200 |
commit | 39dbb74c527c054007e26ad34c8921d4be6cb638 (patch) | |
tree | d55745153153450fb40e1f591eb861495a6068d9 /lib/oxidized/model/powerconnect.rb | |
parent | defdc69f92b3bcf62b1fd3b5ceac63a7a4e637ae (diff) | |
parent | 42bf10b7bce34ff577c469f6c2f659f3913cbf4a (diff) |
Merge branch 'master' into FortiOS-Push
Diffstat (limited to 'lib/oxidized/model/powerconnect.rb')
-rw-r--r-- | lib/oxidized/model/powerconnect.rb | 13 |
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 |