summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2014-08-16 11:11:10 +0300
committerytti <saku@ytti.fi>2014-08-16 11:11:10 +0300
commit4bfd3efe9268493dfe4d988157fab03d8b7ebf5e (patch)
tree69df67ad314e2f8d20d9bdca856db473ae165ad5
parent8244ac7a5d6f5e2f7e6de361402f602bfa308978 (diff)
parent78066ec67b7e935764c93d3f52d145760e2eab32 (diff)
Merge pull request #42 from emjemj/master
Added enable magic for powerconnect model, fixed pagination issues
-rw-r--r--lib/oxidized/model/powerconnect.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/oxidized/model/powerconnect.rb b/lib/oxidized/model/powerconnect.rb
index 4f90b77..1d0352e 100644
--- a/lib/oxidized/model/powerconnect.rb
+++ b/lib/oxidized/model/powerconnect.rb
@@ -19,7 +19,7 @@ class PowerConnect < Oxidized::Model
cmd 'show system' do |cfg|
cfg = cfg.each_line.take_while { |line| not line.match(/uptime/i) }
- comment cfg
+ comment cfg.join "\n"
end
cmd 'show running-config'
@@ -30,9 +30,14 @@ class PowerConnect < Oxidized::Model
end
cfg :telnet, :ssh do
- post_login 'terminal datadump'
- post_login 'enable'
- pre_logout 'exit'
+ if vars :enable
+ send "enable\n"
+ send vars(:enable) + "\n"
+ end
+
+ post_login "terminal length 0"
+ pre_logout "logout"
+
end
end