diff options
author | lamont-granquist <lamont@scriptkiddie.org> | 2013-12-05 15:18:54 -0800 |
---|---|---|
committer | lamont-granquist <lamont@scriptkiddie.org> | 2013-12-05 15:18:54 -0800 |
commit | d85df00ffbedfa440ea529d96a8dc9245fbe44ed (patch) | |
tree | 1d1c0d8d429ca91bbc635128643f7a16fb55cf3d | |
parent | 9c1f86712d9982e6ea23f4207224a070d577065d (diff) | |
parent | 518d115444923b2e7660316382e4f616fa0570e0 (diff) | |
download | chef-d85df00ffbedfa440ea529d96a8dc9245fbe44ed.tar.gz |
Merge pull request #1162 from ranjib/CHEF-4852
[CHEF-4852]Print total number of resources in doc formatter
-rw-r--r-- | lib/chef/formatters/doc.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/chef/formatters/doc.rb b/lib/chef/formatters/doc.rb index d8d8f43691..689c6ab99a 100644 --- a/lib/chef/formatters/doc.rb +++ b/lib/chef/formatters/doc.rb @@ -16,6 +16,7 @@ class Chef super @updated_resources = 0 + @up_to_date_resources = 0 @start_time = Time.now @end_time = @start_time end @@ -28,12 +29,16 @@ class Chef puts "Starting Chef Client, version #{version}" end + def total_resources + @up_to_date_resources + @updated_resources + end + def run_completed(node) @end_time = Time.now if Chef::Config[:why_run] - puts "Chef Client finished, #{@updated_resources} resources would have been updated" + puts "Chef Client finished, #{@updated_resources}/#{total_resources} resources would have been updated" else - puts "Chef Client finished, #{@updated_resources} resources updated in #{elapsed_time} seconds" + puts "Chef Client finished, #{@updated_resources}/#{total_resources} resources updated in #{elapsed_time} seconds" end end @@ -181,6 +186,7 @@ class Chef # Called when a resource has no converge actions, e.g., it was already correct. def resource_up_to_date(resource, action) + @up_to_date_resources+= 1 puts " (up to date)" end |