diff options
author | nimisha <nimisha.sharad@clogeny.com> | 2016-09-01 16:07:00 +0530 |
---|---|---|
committer | nimisha <nimisha.sharad@clogeny.com> | 2016-09-16 14:02:49 +0530 |
commit | cf35dffacad11a139e363f22162c8477a402f917 (patch) | |
tree | a20bf87b6f3b42cfb261696722dca28312012a0c | |
parent | e50207b4315823954a8826fff57ee54140ffc8e2 (diff) | |
download | chef-cf35dffacad11a139e363f22162c8477a402f917.tar.gz |
Added update_resource_count attribute in log resource
-rw-r--r-- | lib/chef/provider/log.rb | 2 | ||||
-rw-r--r-- | lib/chef/resource/log.rb | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/chef/provider/log.rb b/lib/chef/provider/log.rb index eef4077c07..2045918e27 100644 --- a/lib/chef/provider/log.rb +++ b/lib/chef/provider/log.rb @@ -45,7 +45,7 @@ class Chef # true:: Always return true def action_write Chef::Log.send(@new_resource.level, @new_resource.message) - @new_resource.updated_by_last_action(true) + @new_resource.updated_by_last_action(true) if @new_resource.update_resource_count end end diff --git a/lib/chef/resource/log.rb b/lib/chef/resource/log.rb index 8f7879872f..56ab87f8d1 100644 --- a/lib/chef/resource/log.rb +++ b/lib/chef/resource/log.rb @@ -52,6 +52,7 @@ class Chef super @level = :info @message = name + @update_resource_count = true end def message(arg = nil) @@ -71,6 +72,14 @@ class Chef ) end + def update_resource_count(arg = nil) + set_or_return( + :update_resource_count, + arg, + :kind_of => [TrueClass, FalseClass] + ) + end + end end end |