From b8fdd1c5d752a0f27a9a4ccab429ba6393450ccd Mon Sep 17 00:00:00 2001 From: Jason Wendel Date: Fri, 3 Feb 2017 23:47:35 -0600 Subject: Restore compatibility with older versions of IronWare Remove \r from the "enable" command. Both \r and \n are interpreted the same on older versions, causing a blank line to be sent as the enable password. Add a delay between the sending of the "logout" command and each "exit" command. Older devices don't seem to be able to keep up with the speed the commands are sent without a delay. --- lib/oxidized/model/ironware.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index 5b58f22..bfcd3a4 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -74,16 +74,20 @@ class IronWare < Oxidized::Model cfg :telnet, :ssh do if vars :enable post_login do - send "enable\r\n" + send "enable\n" cmd vars(:enable) end end post_login '' post_login 'skip-page-display' post_login 'terminal length 0' - pre_logout 'logout' - pre_logout 'exit' - pre_logout 'exit' + pre_logout do + send "logout\n" + sleep 0.01 + send "exit\n" + sleep 0.01 + send "exit\n" + end end end -- cgit v1.2.1