Merge pull request #10539 from jalandis/disable-required-install_type-salt-option-windows

Disabled salt provision required install_type check on Windows
This commit is contained in:
Chris Roberts 2019-01-03 13:44:05 -08:00 committed by GitHub
commit 7fbcb88d82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 2 deletions

View File

@ -177,8 +177,11 @@ module VagrantPlugins
errors << I18n.t("vagrant.provisioners.salt.python_version")
end
if @version && !@install_type
errors << I18n.t("vagrant.provisioners.salt.version_type_missing")
# install_type is not supported in a Windows environment
if machine.config.vm.communicator != :winrm
if @version && !@install_type
errors << I18n.t("vagrant.provisioners.salt.version_type_missing")
end
end
return {"salt provisioner" => errors}

View File

@ -156,5 +156,25 @@ describe VagrantPlugins::Salt::Config do
expect(result[error_key]).to_not be_empty
end
end
context "version" do
it "is valid if is set without install_type on Windows" do
allow(machine.config.vm).to receive(:communicator).and_return(:winrm)
subject.version = "2018.3.3"
subject.finalize!
result = subject.validate(machine)
expect(result[error_key]).to be_empty
end
it "is invalid if is set without install_type on Linux" do
subject.version = "2018.3.3"
subject.finalize!
result = subject.validate(machine)
expect(result[error_key]).to_not be_empty
end
end
end
end