From 7c02a230dc970c2946770f6893e35c627b6b1ec0 Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Wed, 12 Sep 2018 11:23:45 +0200 Subject: add a new line after guard clauses for better visual flow (#1520) --- lib/oxidized/input/ssh.rb | 2 ++ lib/oxidized/input/telnet.rb | 1 + 2 files changed, 3 insertions(+) (limited to 'lib/oxidized/input') diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb index 11b0ae6..a2e049c 100644 --- a/lib/oxidized/input/ssh.rb +++ b/lib/oxidized/input/ssh.rb @@ -85,6 +85,7 @@ module Oxidized end ch.request_pty (@pty_options) do |_ch, success_pty| raise NoShell, "Can't get PTY" unless success_pty + ch.send_channel_request 'shell' do |_ch, success_shell| raise NoShell, "Can't get shell" unless success_shell end @@ -112,6 +113,7 @@ module Oxidized sleep 0.1 match = regexps.find { |regexp| @output.match regexp } return match if match + true end end diff --git a/lib/oxidized/input/telnet.rb b/lib/oxidized/input/telnet.rb index 63d811f..17fad53 100644 --- a/lib/oxidized/input/telnet.rb +++ b/lib/oxidized/input/telnet.rb @@ -34,6 +34,7 @@ module Oxidized def cmd cmd_str, expect = @node.prompt return send(cmd_str + "\n") unless expect + Oxidized.logger.debug "Telnet: #{cmd_str} @#{@node.name}" args = { 'String' => cmd_str, 'Match' => expect, -- cgit v1.2.1