diff options
author | broxio <madpenguin7@gmail.com> | 2016-05-17 13:31:41 +0800 |
---|---|---|
committer | broxio <madpenguin7@gmail.com> | 2016-05-17 13:31:41 +0800 |
commit | f42a5020f996d8f587b86baf4492214717d15cba (patch) | |
tree | aa9eede67b091fa96b07365760d7cbf5d00c38b3 /lib/oxidized/model/acos.rb | |
parent | 277428321ee457682805232bf8de43adb12cebdb (diff) |
Update acos.rb
Update enable logic suggested by @ytti
Diffstat (limited to 'lib/oxidized/model/acos.rb')
-rw-r--r-- | lib/oxidized/model/acos.rb | 12 |
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' |