From 9de512614320a604098fe0630077054ab6bf03b9 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Tue, 22 Dec 2015 14:23:56 -0500 Subject: [PATCH] Convert env values to strings before escaping --- plugins/provisioners/shell/provisioner.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/provisioners/shell/provisioner.rb b/plugins/provisioners/shell/provisioner.rb index a04d80c92..13d4d112e 100644 --- a/plugins/provisioners/shell/provisioner.rb +++ b/plugins/provisioners/shell/provisioner.rb @@ -47,7 +47,8 @@ module VagrantPlugins # This is the provision method called if SSH is what is running # on the remote end, which assumes a POSIX-style host. def provision_ssh(args) - env = config.env.map { |k,v| "#{k}=#{quote_and_escape(v)}" }.join(" ") + env = config.env.map { |k,v| "#{k}=#{quote_and_escape(v.to_s)}" } + env = env.join(" ") command = "chmod +x '#{config.upload_path}'" command << " &&" @@ -113,7 +114,8 @@ module VagrantPlugins comm.upload(path.to_s, upload_path) # Build the environment - env = config.env.map { |k,v| "$env:#{k} = #{quote_and_escape(v)}" }.join("; ") + env = config.env.map { |k,v| "$env:#{k} = #{quote_and_escape(v.to_s)}" } + env = env.join("; ") # Calculate the path that we'll be executing exec_path = upload_path