From 2914f792870c9bf5c5b09d41e0f64d86f15403fb Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 22 Sep 2014 22:08:12 +0200 Subject: Fixed small bug in powerconnect enable code --- lib/oxidized/model/powerconnect.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/oxidized/model/powerconnect.rb') diff --git a/lib/oxidized/model/powerconnect.rb b/lib/oxidized/model/powerconnect.rb index 1d0352e..8c677b3 100644 --- a/lib/oxidized/model/powerconnect.rb +++ b/lib/oxidized/model/powerconnect.rb @@ -31,8 +31,10 @@ class PowerConnect < Oxidized::Model cfg :telnet, :ssh do if vars :enable - send "enable\n" - send vars(:enable) + "\n" + post_login do + send "enable\n" + send vars(:enable) + "\n" + end end post_login "terminal length 0" -- cgit v1.2.1 From 49b7ec647b3050d35e8162afb63c7c43333f0ee5 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 26 Sep 2014 09:51:29 +0200 Subject: Removed ever-changing output from powerconnect model, thanks @artmann --- lib/oxidized/model/powerconnect.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/oxidized/model/powerconnect.rb') diff --git a/lib/oxidized/model/powerconnect.rb b/lib/oxidized/model/powerconnect.rb index 8c677b3..6a743db 100644 --- a/lib/oxidized/model/powerconnect.rb +++ b/lib/oxidized/model/powerconnect.rb @@ -18,8 +18,9 @@ class PowerConnect < Oxidized::Model end cmd 'show system' do |cfg| - cfg = cfg.each_line.take_while { |line| not line.match(/uptime/i) } - comment cfg.join "\n" + cfg = cfg.split("\n").select { |line| not line[/Up Time/] } + cfg = cfg[0..-28]<<" " + comment cfg.join("\n") end cmd 'show running-config' -- cgit v1.2.1 From 5bc5aa28a205c300e80956a257372bc2a6fcf6a7 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 2 Oct 2014 11:50:30 +0200 Subject: Fixed more ever changing output in powerconnect model, only shows up on some firmware versions --- lib/oxidized/model/powerconnect.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/oxidized/model/powerconnect.rb') diff --git a/lib/oxidized/model/powerconnect.rb b/lib/oxidized/model/powerconnect.rb index 6a743db..a1fe229 100644 --- a/lib/oxidized/model/powerconnect.rb +++ b/lib/oxidized/model/powerconnect.rb @@ -14,11 +14,12 @@ class PowerConnect < Oxidized::Model end cmd 'show version' do |cfg| - comment cfg + cfg = cfg.split("\n").select { |line| not line[/Up\sTime/] } + comment cfg.join("\n") + "\n" end cmd 'show system' do |cfg| - cfg = cfg.split("\n").select { |line| not line[/Up Time/] } + cfg = cfg.split("\n").select { |line| not line[/Up\sTime/] } cfg = cfg[0..-28]<<" " comment cfg.join("\n") end -- cgit v1.2.1