Fixup docker config update

This commit is contained in:
Brian Cain 2018-09-19 10:52:59 -07:00
parent 29128e73b9
commit 4612619dc4
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
2 changed files with 10 additions and 11 deletions

View File

@ -297,9 +297,8 @@ module VagrantPlugins
def validate(machine)
errors = _detected_errors
# FIXME: is there a more ruby-elegant way to write this?
if (@build_dir? 1 : 0) + (@git_repo? 1 : 0) + (@image? 1 : 0) > 1
errors << I18n.t("docker_provider.errors.config.both_build_and_image")
if [@build_dir, @git_repo, @image].compact.size > 1
errors << I18n.t("docker_provider.errors.config.both_build_and_image_and_git")
end
if !@build_dir && !@git_repo && !@image

View File

@ -141,7 +141,7 @@ en:
and notify them to not use this communicator for anything except the
"docker" provider.
config:
both_build_and_image: |-
both_build_and_image_and_git: |-
Only one of "build_dir", "git_repo" or "image" can be set
build_dir_invalid: |-
"build_dir" must exist and contain a Dockerfile