summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRanjib Dey <ranjib@pagerduty.com>2013-12-04 03:31:58 -0800
committerRanjib Dey <ranjib@pagerduty.com>2013-12-05 10:05:08 -0800
commit518d115444923b2e7660316382e4f616fa0570e0 (patch)
tree1d1c0d8d429ca91bbc635128643f7a16fb55cf3d
parent9c1f86712d9982e6ea23f4207224a070d577065d (diff)
downloadchef-518d115444923b2e7660316382e4f616fa0570e0.tar.gz
print total number of resources as well
-rw-r--r--lib/chef/formatters/doc.rb10
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