summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbroxio <madpenguin7@gmail.com>2016-05-17 13:31:41 +0800
committerbroxio <madpenguin7@gmail.com>2016-05-17 13:31:41 +0800
commitf42a5020f996d8f587b86baf4492214717d15cba (patch)
treeaa9eede67b091fa96b07365760d7cbf5d00c38b3
parent277428321ee457682805232bf8de43adb12cebdb (diff)
Update acos.rb
Update enable logic suggested by @ytti
-rw-r--r--lib/oxidized/model/acos.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/oxidized/model/acos.rb b/lib/oxidized/model/acos.rb
index 66b62ee..95a6954 100644
--- a/lib/oxidized/model/acos.rb
+++ b/lib/oxidized/model/acos.rb
@@ -58,14 +58,12 @@ class ACOS < Oxidized::Model
end
cfg :telnet, :ssh do
+ # preferred way to handle additional passwords
post_login do
- if vars :enable
- send "enable\r\n"
- send vars(:enable) + "\r\n"
- else
- send "enable\r\n"
- send "\r\n"
- end
+ pw = vars(:enable)
+ pw ||= ""
+ send "enable\r\n"
+ cmd pw
end
post_login 'terminal length 0'
post_login 'terminal width 0'