summaryrefslogtreecommitdiff
path: root/lib/oxidized
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2016-03-26 19:45:55 +0200
committerSaku Ytti <saku@ytti.fi>2016-03-26 19:45:55 +0200
commitef121cd327d54ac541c1ce2d029fe1d7d56104d1 (patch)
tree02cfee1d05700ea007d01a6b38a84a3e8fbb15fa /lib/oxidized
parentd674af7098809a6fcfafce93082ceaa3b5309e07 (diff)
closes #370
Diffstat (limited to 'lib/oxidized')
-rw-r--r--lib/oxidized/model/edgeswitch.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/oxidized/model/edgeswitch.rb b/lib/oxidized/model/edgeswitch.rb
index cb921b8..7c82639 100644
--- a/lib/oxidized/model/edgeswitch.rb
+++ b/lib/oxidized/model/edgeswitch.rb
@@ -16,9 +16,17 @@ class EdgeSwitch < Oxidized::Model
end
cfg :telnet, :ssh do
- post_login 'enable'
- post_login 'terminal length 0'
+ post_login do
+ if vars :enable
+ send "enable\n"
+ cmd vars(:enable)
+ else
+ cmd 'enable'
+ end
+ cmd 'terminal length 0'
+ end
pre_logout 'quit'
+ pre_logout 'n'
end
end