Chef server validation key path now expands
This commit is contained in:
parent
1d518e2693
commit
5bbb84efa7
|
@ -6,7 +6,7 @@ module Vagrant
|
|||
def prepare
|
||||
if env.config.chef.validation_key_path.nil?
|
||||
raise Actions::ActionException.new(:chef_server_validation_key_required)
|
||||
elsif !File.file?(env.config.chef.validation_key_path)
|
||||
elsif !File.file?(validation_key_path)
|
||||
raise Actions::ActionException.new(:chef_server_validation_key_doesnt_exist)
|
||||
end
|
||||
|
||||
|
|
|
@ -54,8 +54,9 @@ class ChefServerProvisionerTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
@action.stubs(:env).returns(@env)
|
||||
@action.stubs(:validation_key_path).returns("9")
|
||||
|
||||
File.expects(:file?).with(@env.config.chef.validation_key_path).returns(true)
|
||||
File.expects(:file?).with(@action.validation_key_path).returns(true)
|
||||
assert_nothing_raised { @action.prepare }
|
||||
end
|
||||
|
||||
|
@ -65,8 +66,9 @@ class ChefServerProvisionerTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
@action.stubs(:env).returns(@env)
|
||||
@action.stubs(:validation_key_path).returns("9")
|
||||
|
||||
File.expects(:file?).with(@env.config.chef.validation_key_path).returns(false)
|
||||
File.expects(:file?).with(@action.validation_key_path).returns(false)
|
||||
assert_raises(Vagrant::Actions::ActionException) {
|
||||
@action.prepare
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue