From f42a5020f996d8f587b86baf4492214717d15cba Mon Sep 17 00:00:00 2001 From: broxio Date: Tue, 17 May 2016 13:31:41 +0800 Subject: Update acos.rb Update enable logic suggested by @ytti --- lib/oxidized/model/acos.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'lib') 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' -- cgit v1.2.1