From 5120a95830183fdb30fc178452bfc3e6f44605b7 Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Tue, 3 May 2011 14:36:13 -0700 Subject: (#7276) Better reporting from the plugin download action. Instead of just returning vague values, return useful information when rendering for a human being. Based on work by Luke Kaines in https://github.com/lak/puppet/commit/a61cc770ca9b2cad744b5b21b9776a834d6ca895 Reviewed-By: Pieter van de Bruggen --- lib/puppet/face/plugin.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/puppet/face/plugin.rb') diff --git a/lib/puppet/face/plugin.rb b/lib/puppet/face/plugin.rb index 19060942a..4b45ed3a1 100644 --- a/lib/puppet/face/plugin.rb +++ b/lib/puppet/face/plugin.rb @@ -7,6 +7,10 @@ Puppet::Face.define(:plugin, '0.0.1') do action :download do summary "Download plugins from the configured master" + returns <<-EOT + An array containing the files actually downloaded. + This will be empty array when everything was in sync. + EOT when_invoked do |options| require 'puppet/configurer/downloader' @@ -15,5 +19,13 @@ Puppet::Face.define(:plugin, '0.0.1') do Puppet[:pluginsource], Puppet[:pluginsignore]).evaluate end + + when_rendering :for_humans do |value| + if value.empty? then + "No plugins downloaded." + else + "Downloaded these plugins: #{value.join(', ')}" + end + end end end -- cgit