vagrant ssh -c no longer emits prefix and newlines [closes GH-462]

This commit is contained in:
Mitchell Hashimoto 2011-08-14 13:51:20 -07:00
parent 9680f3f9d4
commit 3c1b16f286
4 changed files with 10 additions and 5 deletions

View File

@ -9,6 +9,8 @@
- Chef solo `roles_path` and `data_bags_path` can only be be single paths. [GH-446]
- Fix `virtualbox_not_detected` error message to require 4.1.x. [GH-458]
- Add shortname (`hostname -s`) for hostname setting on RHEL systems. [GH-456]
- `vagrant ssh -c` output no longer has a prefix and respects newlines
from the output. [GH-462]
## 0.8.2 (July 22, 2011)

View File

@ -16,9 +16,12 @@ module Vagrant
def ssh_execute
ssh_vm.ssh.execute do |ssh|
ssh_vm.env.ui.info I18n.t("vagrant.commands.ssh.command", :command => options[:command])
ssh.exec!(options[:command]) do |channel, type, data|
ssh_vm.env.ui.info "#{data}"
if type != :exit_status
# Print the SSH output as it comes in, but don't prefix it and don't
# force a new line so that the output is properly preserved
ssh_vm.env.ui.info(data.to_s, :prefix => false, :new_line => false)
end
end
end
end

View File

@ -34,7 +34,9 @@ module Vagrant
class_eval <<-CODE
def #{method}(message, opts=nil)
super(message)
@shell.say("\#{format_message(message, opts)}", #{color.inspect})
opts ||= {}
opts[:new_line] = true if !opts.has_key?(:new_line)
@shell.say("\#{format_message(message, opts)}", #{color.inspect}, opts[:new_line])
end
CODE
end

View File

@ -185,8 +185,6 @@ en:
vm_not_running: "VM is not currently running. Please bring it up to run this command."
box:
no_installed_boxes: "There are no installed boxes! Use `vagrant box add` to add some."
ssh:
command: "Command: %{command}"
status:
aborted: |-
The VM is in an aborted state. This means that it was abruptly