Validate forwarded ports
This commit is contained in:
parent
1f2856bdf3
commit
c80ad12336
|
@ -245,6 +245,17 @@ module VagrantPlugins
|
|||
end
|
||||
end
|
||||
|
||||
# Validate networks
|
||||
has_fp_port_error = false
|
||||
networks.each do |type, options|
|
||||
if type == :forwarded_port
|
||||
if !has_fp_port_error && (!options[:guest] || !options[:host])
|
||||
errors << I18n.t("vagrant.config.vm.network_fp_requires_ports")
|
||||
has_fp_port_error = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# We're done with VM level errors so prepare the section
|
||||
errors = { "vm" => errors }
|
||||
|
||||
|
|
|
@ -444,6 +444,8 @@ en:
|
|||
nfs_requires_host: |-
|
||||
Using NFS shared folders requires a host to be specified
|
||||
using `config.vagrant.host`.
|
||||
network_fp_requires_ports: |-
|
||||
Forwarded port definitions require a "host" and "guest" value
|
||||
shared_folder_hostpath_missing: |-
|
||||
The host path of the shared folder is missing: %{path}
|
||||
shared_folder_nfs_owner_group: |-
|
||||
|
|
Loading…
Reference in New Issue