summaryrefslogtreecommitdiff
path: root/lib/oxidized/model
diff options
context:
space:
mode:
authorJason Wendel <wendelj@gmail.com>2017-02-03 23:47:35 -0600
committerJason Wendel <wendelj@gmail.com>2017-02-03 23:47:35 -0600
commitb8fdd1c5d752a0f27a9a4ccab429ba6393450ccd (patch)
tree07633fde3175972283c92f90a879441efc00dcf1 /lib/oxidized/model
parent66911c18259e17e6381517b9a495b61423ed44ad (diff)
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.
Diffstat (limited to 'lib/oxidized/model')
-rw-r--r--lib/oxidized/model/ironware.rb12
1 files 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