diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-05-03 14:36:13 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-05-03 14:54:38 -0700 |
| commit | 5120a95830183fdb30fc178452bfc3e6f44605b7 (patch) | |
| tree | b285f8ae0a1c7359632e81f5b10655bb64145f36 /lib/puppet | |
| parent | bb889bf287f702e822d384f74af52fe2604ca37f (diff) | |
| download | puppet-5120a95830183fdb30fc178452bfc3e6f44605b7.tar.gz puppet-5120a95830183fdb30fc178452bfc3e6f44605b7.tar.xz puppet-5120a95830183fdb30fc178452bfc3e6f44605b7.zip | |
(#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 <luke@puppetlabs.com> in
https://github.com/lak/puppet/commit/a61cc770ca9b2cad744b5b21b9776a834d6ca895
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/face/plugin.rb | 12 |
1 files changed, 12 insertions, 0 deletions
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 |
