diff options
author | Luke Kanies <luke@madstop.com> | 2008-10-27 23:37:33 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-10-28 15:49:58 +1100 |
commit | 57e791b9e7da931e61dd8dfc0f68bd13cf2e6449 (patch) | |
tree | f977f402239399595090ee85ff3a318b80502968 /lib/puppet | |
parent | 42cac73a7ce531e125c1c94f7bd942d9002e5445 (diff) | |
download | puppet-57e791b9e7da931e61dd8dfc0f68bd13cf2e6449.tar.gz puppet-57e791b9e7da931e61dd8dfc0f68bd13cf2e6449.tar.xz puppet-57e791b9e7da931e61dd8dfc0f68bd13cf2e6449.zip |
Fixing #1660 - Adding specifically supported values for tidy recursion.
Basically just copied the code for the recurse parameter from 'file'.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rwxr-xr-x | lib/puppet/type/tidy.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/puppet/type/tidy.rb b/lib/puppet/type/tidy.rb index 7a464323f..c352ec85b 100755 --- a/lib/puppet/type/tidy.rb +++ b/lib/puppet/type/tidy.rb @@ -252,6 +252,23 @@ module Puppet newparam(:recurse) do desc "If target is a directory, recursively descend into the directory looking for files to tidy." + + newvalues(:true, :false, :inf, /^[0-9]+$/) + + # Replace the validation so that we allow numbers in + # addition to string representations of them. + validate { |arg| } + munge do |value| + newval = super(value) + case newval + when :true, :inf: true + when :false: false + when Integer, Fixnum, Bignum: value + when /^\d+$/: Integer(value) + else + raise ArgumentError, "Invalid recurse value %s" % value.inspect + end + end end newparam(:rmdirs) do |