kernel/v2: hostnames can be one character [GH-3713]

This commit is contained in:
Mitchell Hashimoto 2014-05-08 09:10:13 -07:00
parent ef132cb84f
commit 338328fa15
3 changed files with 15 additions and 1 deletions

View File

@ -7,6 +7,10 @@ IMPROVEMENTS:
- providers/docker: `build_args` config to specify extra args for
`docker build`. [GH-3684]
BUG FIXES:
- core: Hostnames can be one character. [GH-3713]
## 1.6.1 (May 7, 2014)
IMPROVEMENTS:

View File

@ -480,7 +480,7 @@ module VagrantPlugins
end
errors << I18n.t("vagrant.config.vm.hostname_invalid_characters") if \
@hostname && @hostname !~ /^[a-z0-9][-.a-z0-9]+$/i
@hostname && @hostname !~ /^[a-z0-9][-.a-z0-9]*$/i
if @box_version
@box_version.split(",").each do |v|

View File

@ -134,6 +134,16 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
end
end
describe "#hostname" do
["a", "foo", "foo-bar", "baz0"].each do |valid|
it "is valid: #{valid}" do
subject.hostname = valid
subject.finalize!
assert_valid
end
end
end
describe "#network(s)" do
it "defaults to forwarding SSH" do
subject.finalize!