summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2015-03-08 13:30:03 +0200
committerytti <saku@ytti.fi>2015-03-08 13:30:03 +0200
commitcc8f8cccbcff60bb534d0b708ec8e4b67a3183ab (patch)
treef5f52bf39735370926f87e933236c2e9c720a35e
parentdc9309935ff129d39be985efc78858aeb11e8496 (diff)
parentc17d8d48e44fd3277554e03469183fd20f2eefc7 (diff)
Merge pull request #88 from brandt/interpret_true_as_no_password
Add back ability to use passwordless enable on EOS
-rw-r--r--lib/oxidized/model/eos.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/oxidized/model/eos.rb b/lib/oxidized/model/eos.rb
index 98a8c28..c1bc23a 100644
--- a/lib/oxidized/model/eos.rb
+++ b/lib/oxidized/model/eos.rb
@@ -28,8 +28,11 @@ class EOS < Oxidized::Model
if vars :enable
post_login do
send "enable\n"
- expect /[pP]assword:\s?$/
- send vars(:enable) + "\n"
+ # Interpret enable: true as meaning we won't be prompted for a password
+ unless vars(:enable).is_a? TrueClass
+ expect /[pP]assword:\s?$/
+ send vars(:enable) + "\n"
+ end
expect /^.+[#>]\s?$/
end
post_login 'terminal length 0'
@@ -38,4 +41,3 @@ class EOS < Oxidized::Model
end
end
-