[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5
Daniel Pittman
daniel at puppetlabs.com
Tue May 10 08:19:20 UTC 2011
The following commit has been merged in the experimental branch:
commit 5120a95830183fdb30fc178452bfc3e6f44605b7
Author: Daniel Pittman <daniel at puppetlabs.com>
Date: Tue May 3 14:36:13 2011 -0700
(#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 at puppetlabs.com> in
https://github.com/lak/puppet/commit/a61cc770ca9b2cad744b5b21b9776a834d6ca895
Reviewed-By: Pieter van de Bruggen <pieter at puppetlabs.com>
diff --git a/lib/puppet/face/plugin.rb b/lib/puppet/face/plugin.rb
index 1906094..4b45ed3 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
diff --git a/spec/unit/face/file_spec.rb b/spec/unit/face/plugin_spec.rb
similarity index 53%
copy from spec/unit/face/file_spec.rb
copy to spec/unit/face/plugin_spec.rb
index c3f0572..383aaa3 100755
--- a/spec/unit/face/file_spec.rb
+++ b/spec/unit/face/plugin_spec.rb
@@ -2,10 +2,8 @@
require 'spec_helper'
require 'puppet/face'
-describe Puppet::Face[:file, '0.0.1'] do
- it_should_behave_like "an indirector face"
-
- [:download, :store].each do |action|
+describe Puppet::Face[:plugin, '0.0.1'] do
+ [:download].each do |action|
it { should be_action action }
it { should respond_to action }
end
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list