From 06705411e28cf747644beb78504c5d2a27713d1c Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Tue, 17 Jul 2018 13:07:50 +0300 Subject: Allow enabling without enable password Fixes #1452 --- lib/oxidized/model/ios.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/oxidized/model/ios.rb b/lib/oxidized/model/ios.rb index 068ae05..73fe114 100644 --- a/lib/oxidized/model/ios.rb +++ b/lib/oxidized/model/ios.rb @@ -132,9 +132,11 @@ class IOS < Oxidized::Model cfg :telnet, :ssh do # preferred way to handle additional passwords - if vars :enable - post_login do - send "enable\n" + post_login do + if vars(:enable) == true + cmd "enable" + elsif vars(:enable) + cmd "enable", /^[pP]assword:/ cmd vars(:enable) end end -- cgit v1.2.1