providers/virtualbox: many `detail` level output
This commit is contained in:
parent
b557ee5625
commit
5b449c8000
|
@ -240,13 +240,9 @@ module Vagrant
|
||||||
opts ||= {}
|
opts ||= {}
|
||||||
opts[:scope] = @scope
|
opts[:scope] = @scope
|
||||||
if !opts.has_key?(:prefix) || opts[:prefix]
|
if !opts.has_key?(:prefix) || opts[:prefix]
|
||||||
first = true
|
|
||||||
prefix = "#{@scope}: "
|
prefix = "#{@scope}: "
|
||||||
prefix_blank = " " * prefix.length
|
|
||||||
message = message.split("\n").map do |line|
|
message = message.split("\n").map do |line|
|
||||||
scope = first ? prefix : prefix_blank
|
"#{prefix}#{line}"
|
||||||
first = false
|
|
||||||
"#{scope}#{line}"
|
|
||||||
end.join("\n")
|
end.join("\n")
|
||||||
end
|
end
|
||||||
@ui.send(method, message, opts)
|
@ui.send(method, message, opts)
|
||||||
|
|
|
@ -7,11 +7,13 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
|
env[:ui].output(I18n.t("vagrant.virtualbox.checking_guest_additions"))
|
||||||
|
|
||||||
# Use the raw interface for now, while the virtualbox gem
|
# Use the raw interface for now, while the virtualbox gem
|
||||||
# doesn't support guest properties (due to cross platform issues)
|
# doesn't support guest properties (due to cross platform issues)
|
||||||
version = env[:machine].provider.driver.read_guest_additions_version
|
version = env[:machine].provider.driver.read_guest_additions_version
|
||||||
if !version
|
if !version
|
||||||
env[:ui].warn I18n.t("vagrant.actions.vm.check_guest_additions.not_detected")
|
env[:ui].detail(I18n.t("vagrant.actions.vm.check_guest_additions.not_detected"))
|
||||||
else
|
else
|
||||||
# Read the versions
|
# Read the versions
|
||||||
versions = [version, env[:machine].provider.driver.version]
|
versions = [version, env[:machine].provider.driver.version]
|
||||||
|
@ -29,7 +31,7 @@ module VagrantPlugins
|
||||||
vb_version = versions[1]
|
vb_version = versions[1]
|
||||||
|
|
||||||
if guest_version != vb_version
|
if guest_version != vb_version
|
||||||
env[:ui].warn(I18n.t("vagrant.actions.vm.check_guest_additions.version_mismatch",
|
env[:ui].detail(I18n.t("vagrant.actions.vm.check_guest_additions.version_mismatch",
|
||||||
:guest_version => version,
|
:guest_version => version,
|
||||||
:virtualbox_version => vb_version))
|
:virtualbox_version => vb_version))
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,7 +25,7 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
env[:ui].info I18n.t("vagrant.actions.vm.forward_ports.forwarding")
|
env[:ui].output(I18n.t("vagrant.actions.vm.forward_ports.forwarding"))
|
||||||
forward_ports
|
forward_ports
|
||||||
|
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
|
@ -47,7 +47,7 @@ module VagrantPlugins
|
||||||
# because the VM is using Virtualbox NAT networking. Host-only
|
# because the VM is using Virtualbox NAT networking. Host-only
|
||||||
# bridged networking don't require port-forwarding and establishing
|
# bridged networking don't require port-forwarding and establishing
|
||||||
# forwarded ports on these attachment types has uncertain behaviour.
|
# forwarded ports on these attachment types has uncertain behaviour.
|
||||||
@env[:ui].info(I18n.t("vagrant.actions.vm.forward_ports.forwarding_entry",
|
@env[:ui].detail(I18n.t("vagrant.actions.vm.forward_ports.forwarding_entry",
|
||||||
message_attributes))
|
message_attributes))
|
||||||
|
|
||||||
# Verify we have the network interface to attach to
|
# Verify we have the network interface to attach to
|
||||||
|
@ -61,7 +61,7 @@ module VagrantPlugins
|
||||||
# Port forwarding requires the network interface to be a NAT interface,
|
# Port forwarding requires the network interface to be a NAT interface,
|
||||||
# so verify that that is the case.
|
# so verify that that is the case.
|
||||||
if interfaces[fp.adapter][:type] != :nat
|
if interfaces[fp.adapter][:type] != :nat
|
||||||
@env[:ui].info(I18n.t("vagrant.actions.vm.forward_ports.non_nat",
|
@env[:ui].detail(I18n.t("vagrant.actions.vm.forward_ports.non_nat",
|
||||||
message_attributes))
|
message_attributes))
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
|
@ -104,7 +104,16 @@ module VagrantPlugins
|
||||||
if !adapters.empty?
|
if !adapters.empty?
|
||||||
# Enable the adapters
|
# Enable the adapters
|
||||||
@logger.info("Enabling adapters...")
|
@logger.info("Enabling adapters...")
|
||||||
env[:ui].info I18n.t("vagrant.actions.vm.network.preparing")
|
env[:ui].output(I18n.t("vagrant.actions.vm.network.preparing"))
|
||||||
|
adapters.each do |adapter|
|
||||||
|
env[:ui].detail(I18n.t(
|
||||||
|
"vagrant.virtualbox.network_adapter",
|
||||||
|
adapter: adapter[:adapter].to_s,
|
||||||
|
type: adapter[:type].to_s,
|
||||||
|
extra: "",
|
||||||
|
))
|
||||||
|
end
|
||||||
|
|
||||||
env[:machine].provider.driver.enable_adapters(adapters)
|
env[:machine].provider.driver.enable_adapters(adapters)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,10 @@ en:
|
||||||
The 'run_file' specified could not be found.
|
The 'run_file' specified could not be found.
|
||||||
|
|
||||||
virtualbox:
|
virtualbox:
|
||||||
|
checking_guest_additions: |-
|
||||||
|
Checking for guest additions in VM...
|
||||||
|
network_adapter: |-
|
||||||
|
Adapter %{adapter}: %{type}%{extra}
|
||||||
config:
|
config:
|
||||||
id_in_pre_import: |-
|
id_in_pre_import: |-
|
||||||
The ':id' parameter is not available in "pre-import" customizations.
|
The ':id' parameter is not available in "pre-import" customizations.
|
||||||
|
@ -1114,7 +1118,7 @@ en:
|
||||||
Fixed port collision for %{guest_port} => %{host_port}. Now on port %{new_port}.
|
Fixed port collision for %{guest_port} => %{host_port}. Now on port %{new_port}.
|
||||||
forwarding: Forwarding ports...
|
forwarding: Forwarding ports...
|
||||||
forwarding_entry: |-
|
forwarding_entry: |-
|
||||||
-- %{guest_port} => %{host_port} (adapter %{adapter})
|
%{guest_port} => %{host_port} (adapter %{adapter})
|
||||||
non_nat: |-
|
non_nat: |-
|
||||||
VirtualBox adapter #%{adapter} not configured as "NAT". Skipping port
|
VirtualBox adapter #%{adapter} not configured as "NAT". Skipping port
|
||||||
forwards on this adapter.
|
forwards on this adapter.
|
||||||
|
|
Loading…
Reference in New Issue