Merge pull request #2358 from sgronblo/disallow_dots_and_hyphens_at_start_of_hostname

core: disallow dot and hyphen as first character of hostnames
This commit is contained in:
Mitchell Hashimoto 2013-10-14 19:59:22 -07:00
commit cb74d208ea
2 changed files with 2 additions and 2 deletions

View File

@ -353,7 +353,7 @@ module VagrantPlugins
errors << I18n.t("vagrant.config.vm.box_not_found", :name => box) if \ errors << I18n.t("vagrant.config.vm.box_not_found", :name => box) if \
box && !box_url && !machine.box box && !box_url && !machine.box
errors << I18n.t("vagrant.config.vm.hostname_invalid_characters") if \ errors << I18n.t("vagrant.config.vm.hostname_invalid_characters") if \
@hostname && @hostname !~ /^[-.a-z0-9]+$/i @hostname && @hostname !~ /^[a-z0-9][-.a-z0-9]+$/i
has_nfs = false has_nfs = false
used_guest_paths = Set.new used_guest_paths = Set.new

View File

@ -691,7 +691,7 @@ en:
box_not_found: "The box '%{name}' could not be found." box_not_found: "The box '%{name}' could not be found."
hostname_invalid_characters: |- hostname_invalid_characters: |-
The hostname set for the VM should only contain letters, numbers, The hostname set for the VM should only contain letters, numbers,
and hyphens. hyphens or dots. It cannot start with a hyphen or dot.
network_invalid: |- network_invalid: |-
The network type '%{type}' is not valid. Please use The network type '%{type}' is not valid. Please use
'hostonly' or 'bridged'. 'hostonly' or 'bridged'.