Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Hash constant construction in Salt provisioner #7986

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/provisioners/salt/provisioner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Provisioner < Vagrant.plugin("2", :provisioner)

# Default path values to set within configuration only
# if configuration value is unset and local path exists
OPTIMISTIC_PATH_DEFAULTS = Hash[[
OPTIMISTIC_PATH_DEFAULTS = Hash[*[
"minion_config", "salt/minion",
"minion_key", "salt/key/minion.key",
"minion_pub", "salt/key/minion.pub",
Expand Down
35 changes: 35 additions & 0 deletions test/unit/plugins/provisioners/salt/provisioner_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
require_relative "../../../base"

require Vagrant.source_root.join("plugins/provisioners/salt/provisioner")

describe VagrantPlugins::Salt::Provisioner do
include_context "unit"

subject { described_class.new(machine, config) }

let(:iso_env) do
# We have to create a Vagrantfile so there is a root path
env = isolated_environment
env.vagrantfile("")
env.create_vagrant_env
end

let(:machine) { iso_env.machine(iso_env.machine_names[0], :dummy) }
let(:config) { double("config") }
let(:communicator) { double("comm") }
let(:guest) { double("guest") }

before do
machine.stub(communicate: communicator)
machine.stub(guest: guest)

communicator.stub(execute: true)
communicator.stub(upload: true)

guest.stub(capability?: false)
end

describe "#provision" do

end
end