summaryrefslogtreecommitdiff
path: root/lib/oxidized/input/telnet.rb
diff options
context:
space:
mode:
authorSamer Abdel-Hafez <sam@arahant.net>2015-03-06 12:07:50 +0100
committerSamer Abdel-Hafez <sam@arahant.net>2015-03-06 12:07:56 +0100
commitcb851fdc9bfdeae603f8c56fe5bc69838b01f420 (patch)
tree7fb241645347e45d096d230816c2cd341df4544d /lib/oxidized/input/telnet.rb
parent100c4480aa2f1e6e16e47ac6c1bd85429e2ab6a0 (diff)
Log prompt detection failures
Diffstat (limited to 'lib/oxidized/input/telnet.rb')
-rw-r--r--lib/oxidized/input/telnet.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/oxidized/input/telnet.rb b/lib/oxidized/input/telnet.rb
index 62f361e..13fccf7 100644
--- a/lib/oxidized/input/telnet.rb
+++ b/lib/oxidized/input/telnet.rb
@@ -20,7 +20,11 @@ module Oxidized
@telnet.puts @node.auth[:username]
expect password
@telnet.puts @node.auth[:password]
- expect @node.prompt
+ begin
+ expect @node.prompt
+ rescue Timeout::Error
+ raise PromptUndetect, [ 'unable to detect prompt:', @node.prompt ].join(' ')
+ end
end
def connected?