diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index 07489e977..5ff3d0ebd 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -160,6 +160,9 @@ module Vagrant # Extra env keys are the remaining opts extra_env = opts.dup + # Convert the extra keys back to strings + extra_env = extra_env.inject({}) { |h,(k,v)| h[k.to_s] = v; h } + # Create a deterministic ID for this machine vf = nil vf = @env.vagrantfile_name[0] if @env.vagrantfile_name diff --git a/plugins/commands/package/command.rb b/plugins/commands/package/command.rb index e54335475..fb9ad705f 100644 --- a/plugins/commands/package/command.rb +++ b/plugins/commands/package/command.rb @@ -80,6 +80,9 @@ module VagrantPlugins acc end + # Symbolize all keys + opts = opts.inject({}) { |h,(k,v)| h[k.to_sym] = v; h } + vm.action(:package, **opts) end end diff --git a/test/unit/plugins/pushes/ftp/push_test.rb b/test/unit/plugins/pushes/ftp/push_test.rb index 25d6e1229..1f6773e24 100644 --- a/test/unit/plugins/pushes/ftp/push_test.rb +++ b/test/unit/plugins/pushes/ftp/push_test.rb @@ -17,12 +17,19 @@ describe VagrantPlugins::FTPPush::Push do destination: "/var/www/site", ) end + let(:ui) do + double("ui", + info: nil, + ) + end subject { described_class.new(env, config) } before do allow(env).to receive(:root_path) .and_return(File.expand_path("..", __FILE__)) + allow(env).to receive(:ui) + .and_return(ui) end describe "#push" do diff --git a/test/unit/vagrant/machine_test.rb b/test/unit/vagrant/machine_test.rb index 128df3d6f..22e3a13ca 100644 --- a/test/unit/vagrant/machine_test.rb +++ b/test/unit/vagrant/machine_test.rb @@ -252,10 +252,10 @@ describe Vagrant::Machine do expect(machine).to eql(instance) end - it "should pass any extra options to the environment" do + it "should pass any extra options to the environment as strings" do action_name = :up foo = nil - callable = lambda { |env| foo = env[:foo] } + callable = lambda { |env| foo = env["foo"] } allow(provider).to receive(:action).with(action_name).and_return(callable) instance.action(:up, foo: :bar)