Disabled salt provision required install_type check on Windows where option is not supported. Added test case for salt provisioner config changes.

This commit is contained in:
John Landis 2018-12-23 11:39:58 -05:00
parent 1f565b8f27
commit bd6fa11281
No known key found for this signature in database
GPG Key ID: 7AD7E30685E65491
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