Add validation to args for shell provisioner

This commit is contained in:
Mitchell Hashimoto 2011-08-28 00:02:42 -07:00
parent bf32fb4de8
commit 14d1b987ae
2 changed files with 6 additions and 0 deletions

View File

@ -39,6 +39,11 @@ module Vagrant
if !upload_path if !upload_path
errors.add(I18n.t("vagrant.provisioners.shell.upload_path_not_set")) errors.add(I18n.t("vagrant.provisioners.shell.upload_path_not_set"))
end end
# If there are args and its not a string, that is a problem
if args && !args.is_a?(String)
errors.add(I18n.t("vagrant.provisioners.shell.args_not_string"))
end
end end
end end

View File

@ -509,6 +509,7 @@ en:
running_puppetd: "Running Puppet agent..." running_puppetd: "Running Puppet agent..."
shell: shell:
args_not_string: "Shell provisioner `args` must be a string."
path_and_inline_set: "Only one of `path` or `inline` may be set." path_and_inline_set: "Only one of `path` or `inline` may be set."
no_path_or_inline: "One of `path` or `inline` must be set." no_path_or_inline: "One of `path` or `inline` must be set."
path_invalid: "`path` for shell provisioner does not exist on the host system: %{path}" path_invalid: "`path` for shell provisioner does not exist on the host system: %{path}"