From 14d1b987ae8ec659ebaf234b96b5fec1b656a272 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 28 Aug 2011 00:02:42 -0700 Subject: [PATCH] Add validation to args for shell provisioner --- lib/vagrant/provisioners/shell.rb | 5 +++++ templates/locales/en.yml | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/vagrant/provisioners/shell.rb b/lib/vagrant/provisioners/shell.rb index 2875a0636..393cac506 100644 --- a/lib/vagrant/provisioners/shell.rb +++ b/lib/vagrant/provisioners/shell.rb @@ -39,6 +39,11 @@ module Vagrant if !upload_path errors.add(I18n.t("vagrant.provisioners.shell.upload_path_not_set")) 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 diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 773f0377f..1b77cc819 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -509,6 +509,7 @@ en: running_puppetd: "Running Puppet agent..." shell: + args_not_string: "Shell provisioner `args` must be a string." 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." path_invalid: "`path` for shell provisioner does not exist on the host system: %{path}"