mirror of
https://github.com/inspec/inspec
synced 2024-11-15 01:17:08 +00:00
bugfix: force PTY on SSH connection
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
parent
1570e8e7af
commit
67b5ecc06e
1 changed files with 5 additions and 1 deletions
|
@ -19,11 +19,15 @@ module Vulcano::Backends
|
|||
def run_command(cmd)
|
||||
stdout = stderr = ''
|
||||
exit_status = nil
|
||||
cmd.force_encoding('binary') if cmd.respond_to?(:force_encoding)
|
||||
|
||||
@ssh.open_channel do |channel|
|
||||
channel.request_pty do |ch, success|
|
||||
abort 'Could not obtain pty on SSH channel ' if !success
|
||||
end
|
||||
channel.exec(cmd) do |ch, success|
|
||||
unless success
|
||||
fail "Couldn't execute command on SSH."
|
||||
abort 'Couldn\'t execute command on SSH.'
|
||||
end
|
||||
|
||||
channel.on_data do |ch,data|
|
||||
|
|
Loading…
Reference in a new issue