diff options
author | John Keiser <john@johnkeiser.com> | 2015-07-21 16:47:26 -0600 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-07-27 09:38:25 -0600 |
commit | 9b957381e30423c32a52e3b9bb6ba2a6b0a09b64 (patch) | |
tree | 05305cd9dc6a74e2ab5486fd8b9fe2a2b633d723 /lib/chef/resource.rb | |
parent | 5e1567fdeb2b0693000fde7d702c106dc51b335c (diff) | |
download | chef-9b957381e30423c32a52e3b9bb6ba2a6b0a09b64.tar.gz |
Make "property_name" in actions load current value as default
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r-- | lib/chef/resource.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb index cdb351f643..bb5c6050fe 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -1442,9 +1442,12 @@ class Chef use_inline_resources include_resource_dsl true define_singleton_method(:to_s) { "#{resource_class} action provider" } - define_singleton_method(:inspect) { to_s } - define_method(:load_current_resource) do + def self.inspect + to_s + end + def load_current_resource if new_resource.respond_to?(:load_current_value!) + # dup the resource and then reset desired-state properties. current_resource = new_resource.dup # We clear desired state in the copy, because it is supposed to be actual state. |