From cb851fdc9bfdeae603f8c56fe5bc69838b01f420 Mon Sep 17 00:00:00 2001 From: Samer Abdel-Hafez Date: Fri, 6 Mar 2015 12:07:50 +0100 Subject: Log prompt detection failures --- lib/oxidized/input/telnet.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/oxidized/input/telnet.rb') 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? -- cgit v1.2.1