summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2016-01-25 13:17:09 +0200
committerSaku Ytti <saku@ytti.fi>2016-01-25 13:17:09 +0200
commitc39e8ebb2e19d718d039dc0c659d76b4469a750f (patch)
tree9a0d803daaecf61c130b9e2f9c6127c8028ef379
parent3356902f975712e5b6352edb9849c98952fd1dea (diff)
SSH does not prompt for username/password
Some devices, like Cisco WLC do not authenticate using SSH (ssh is noauth) and actually prompt for auth via shell. CiscoSMB is not one of those kits. We probably should do sepearate bug for the error messages this caused. ``` begin @username ? shell_login : expect(@node.prompt) rescue Timeout::Error raise PromptUndetect, [ @output, 'not matching configured prompt', @node.prompt ].join(' ') end ``` Here Timeout:Error is not raised by ```expect(@node-prompt)``` it is raised by ```shell-login```, which is triggered due to @username prompt set. Potential fixes 1. change the error to more generic one, covering both cases 2. add rescue in 'def shell_login' for Timeout::Error and report it there
-rw-r--r--lib/oxidized/model/ciscosmb.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/oxidized/model/ciscosmb.rb b/lib/oxidized/model/ciscosmb.rb
index 47e8391..3ef9a85 100644
--- a/lib/oxidized/model/ciscosmb.rb
+++ b/lib/oxidized/model/ciscosmb.rb
@@ -33,9 +33,12 @@ class CiscoSMB < Oxidized::Model
cfg
end
- cfg :telnet, :ssh do
+ cfg :telnet do
username /^User Name:/
password /^\r?Password:$/
+ end
+
+ cfg :telnet, :ssh do
post_login 'terminal datadump' # Disable pager
post_login 'terminal width 0'
pre_logout 'exit'