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:
parent
1f565b8f27
commit
bd6fa11281
|
@ -177,9 +177,12 @@ module VagrantPlugins
|
|||
errors << I18n.t("vagrant.provisioners.salt.python_version")
|
||||
end
|
||||
|
||||
# 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}
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue