diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-14 16:07:39 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-20 14:38:05 -0700 |
commit | c9148d23547ef42a1ef8b077d2d3fd2b56c55112 (patch) | |
tree | b799e347aaeef3adf861bf6d9706c283ca41d920 /lib | |
parent | 31c218ce09ead9036c033b868571a4d4dd75b110 (diff) | |
download | chef-c9148d23547ef42a1ef8b077d2d3fd2b56c55112.tar.gz |
Don't test the current state of the resource until the action is run
`load_current_resource` is not guarded by `define_resource_requirements`.
This means that we would try to load the resource even if we didn't
have a valid version of Powershell.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/dsc_resource.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/chef/provider/dsc_resource.rb b/lib/chef/provider/dsc_resource.rb index bd72131e67..c9b35fc089 100644 --- a/lib/chef/provider/dsc_resource.rb +++ b/lib/chef/provider/dsc_resource.rb @@ -31,12 +31,11 @@ class Chef def initialize(new_resource, run_context) super @new_resource = new_resource - @resource_converged = false @module_name = new_resource.module_name end def action_run - if ! @resource_converged + if ! test_resource converge_by(generate_description) do result = set_resource end @@ -44,9 +43,8 @@ class Chef end def load_current_resource - @resource_converged = test_resource end - + def whyrun_supported? true end |