Cleaned up most command string literals and SSH
This commit is contained in:
parent
12ce76ffd0
commit
ce080e908f
|
@ -9,7 +9,7 @@ module Vagrant
|
||||||
if vm.created?
|
if vm.created?
|
||||||
vm.destroy
|
vm.destroy
|
||||||
else
|
else
|
||||||
vm.env.ui.info "VM not created. Moving on..."
|
vm.env.ui.info "vagrant.commands.common.vm_not_created"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,7 +10,7 @@ module Vagrant
|
||||||
if vm.created?
|
if vm.created?
|
||||||
vm.halt(options)
|
vm.halt(options)
|
||||||
else
|
else
|
||||||
vm.env.ui.info "VM not created. Moving on..."
|
vm.env.ui.info "vagrant.commands.common.vm_not_created"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Vagrant
|
||||||
if vm.created? && vm.vm.running?
|
if vm.created? && vm.vm.running?
|
||||||
vm.provision
|
vm.provision
|
||||||
else
|
else
|
||||||
vm.env.ui.info "VM not created. Moving on..."
|
vm.env.ui.info "vagrant.commands.common.vm_not_created"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Vagrant
|
||||||
if vm.created?
|
if vm.created?
|
||||||
vm.reload
|
vm.reload
|
||||||
else
|
else
|
||||||
vm.env.ui.info "VM not created. Moving on..."
|
vm.env.ui.info "vagrant.commands.common.vm_not_created"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Vagrant
|
||||||
if vm.created?
|
if vm.created?
|
||||||
vm.resume
|
vm.resume
|
||||||
else
|
else
|
||||||
vm.env.ui.info "VM not created. Moving on..."
|
vm.env.ui.info "vagrant.commands.common.vm_not_created"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,7 +17,7 @@ module Vagrant
|
||||||
|
|
||||||
def ssh_execute
|
def ssh_execute
|
||||||
ssh_vm.ssh.execute do |ssh|
|
ssh_vm.ssh.execute do |ssh|
|
||||||
ssh_vm.env.ui.info "Execute: #{options[:execute]}"
|
ssh_vm.env.ui.info "vagrant.commands.ssh.execute", :command => options[:execute]
|
||||||
ssh.exec!(options[:execute]) do |channel, type, data|
|
ssh.exec!(options[:execute]) do |channel, type, data|
|
||||||
ssh_vm.env.ui.info "#{data}"
|
ssh_vm.env.ui.info "#{data}"
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Vagrant
|
||||||
if vm.created?
|
if vm.created?
|
||||||
vm.suspend
|
vm.suspend
|
||||||
else
|
else
|
||||||
vm.env.ui.info "VM not created. Moving on..."
|
vm.env.ui.info "vagrant.commands.common.vm_not_created"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Vagrant
|
||||||
# TODO: Make the options[:provision] actually mean something
|
# TODO: Make the options[:provision] actually mean something
|
||||||
target_vms.each do |vm|
|
target_vms.each do |vm|
|
||||||
if vm.created?
|
if vm.created?
|
||||||
vm.env.ui.info "VM already created. Booting if its not already running..."
|
vm.env.ui.info "vagrant.commands.up.vm_created"
|
||||||
vm.start
|
vm.start
|
||||||
else
|
else
|
||||||
vm.up
|
vm.up
|
||||||
|
|
|
@ -5,7 +5,9 @@ module Vagrant
|
||||||
register "version", :alias => %w(-v --version)
|
register "version", :alias => %w(-v --version)
|
||||||
|
|
||||||
def version
|
def version
|
||||||
env.ui.info "Vagrant version #{Vagrant::VERSION}"
|
env.ui.info("vagrant.commands.version.output",
|
||||||
|
:version => Vagrant::VERSION,
|
||||||
|
:_prefix => false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -115,7 +115,6 @@ module Vagrant
|
||||||
stat = File.stat(key_path)
|
stat = File.stat(key_path)
|
||||||
|
|
||||||
if stat.owned? && file_perms(key_path) != "600"
|
if stat.owned? && file_perms(key_path) != "600"
|
||||||
env.ui.info "Permissions on private key incorrect, fixing..."
|
|
||||||
File.chmod(0600, key_path)
|
File.chmod(0600, key_path)
|
||||||
|
|
||||||
raise Errors::SSHKeyBadPermissions.new(:key_path => key_path) if file_perms(key_path) != "600"
|
raise Errors::SSHKeyBadPermissions.new(:key_path => key_path) if file_perms(key_path) != "600"
|
||||||
|
|
|
@ -58,8 +58,12 @@ en:
|
||||||
# Translations for commands. e.g. `vagrant x`
|
# Translations for commands. e.g. `vagrant x`
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
commands:
|
commands:
|
||||||
|
common:
|
||||||
|
vm_not_created: "VM not created. Moving on..."
|
||||||
box:
|
box:
|
||||||
no_installed_boxes: There are no installed boxes! Use `vagrant box add` to add some.
|
no_installed_boxes: "There are no installed boxes! Use `vagrant box add` to add some."
|
||||||
|
ssh:
|
||||||
|
execute: "Execute: %{command}"
|
||||||
status:
|
status:
|
||||||
output: |-
|
output: |-
|
||||||
Current VM states:
|
Current VM states:
|
||||||
|
@ -81,6 +85,10 @@ en:
|
||||||
This environment represents multiple VMs. The VMs are all listed
|
This environment represents multiple VMs. The VMs are all listed
|
||||||
above with their current state. For more information about a specific
|
above with their current state. For more information about a specific
|
||||||
VM, run `vagrant status NAME`.
|
VM, run `vagrant status NAME`.
|
||||||
|
up:
|
||||||
|
vm_created: "VM already created. Booting if its not already running..."
|
||||||
|
version:
|
||||||
|
output: "Vagrant version %{version}"
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Translations for Vagrant middleware acions
|
# Translations for Vagrant middleware acions
|
||||||
|
|
Loading…
Reference in New Issue