From b603c20370c7548739f90f2b92ffa066d59446ab Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Sun, 13 Apr 2014 10:45:36 +0300 Subject: smarter match for IP address in nodes - add 'connnected?' method to ssh/telnet to query if or not we're connected - subclass OxidizedError from StandardError, all future OxidizedErrors should be subclasssed from this. --- lib/oxidized/input/ssh.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/oxidized/input/ssh.rb') diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb index a858213..bd0a459 100644 --- a/lib/oxidized/input/ssh.rb +++ b/lib/oxidized/input/ssh.rb @@ -27,6 +27,10 @@ module Oxidized shell_open @ssh @username ? shell_login : expect(@node.prompt) end + connected? + end + + def connected? @ssh and not @ssh.closed? end -- cgit v1.2.1