From 3ff3b0d63c16a650c7ff453ec901244d08ccba7f Mon Sep 17 00:00:00 2001 From: broxio Date: Mon, 16 May 2016 13:08:32 +0800 Subject: Update acos.rb Update enable logic to support enable without password on ACOS device. --- lib/oxidized/model/acos.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/oxidized/model/acos.rb b/lib/oxidized/model/acos.rb index e686a59..fa38a60 100644 --- a/lib/oxidized/model/acos.rb +++ b/lib/oxidized/model/acos.rb @@ -58,16 +58,18 @@ class ACOS < Oxidized::Model end cfg :telnet, :ssh do - # preferred way to handle additional passwords - if vars :enable - post_login do + post_login do + if vars :enable send "enable\r\n" send vars(:enable) + "\r\n" + else + send "enable\r\n" + send "\r\n" end end - post_login "en\r\n" post_login 'terminal length 0' - post_login 'terminal width 0' + post_login 'terminal width 0' pre_logout "exit\nexit\nY\r\n" end + end -- cgit v1.2.1