bugfix: force PTY on SSH connection

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
Dominik Richter 2015-09-09 08:52:55 +02:00
parent 1570e8e7af
commit 67b5ecc06e

View file

@ -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|