[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.5rc1-120-g2247c80

Jacob Helwig jacob at puppetlabs.com
Mon Feb 7 06:42:05 UTC 2011


The following commit has been merged in the upstream branch:
commit d6572921832cc0df22e13d55c3bc090b74155b91
Author: Jacob Helwig <jacob at puppetlabs.com>
Date:   Tue Feb 1 14:55:25 2011 -0800

    Rename variable used in File type validation to be more clear
    
    The 'count' variable is used to keep track of how many 'creator'
    parameters are set on the Type in order to raise an exception if this is
    greater than one.  Be explicit about this.
    
    Paired-with: Jesse Wolfe <jesse at puppetlabs.com>

diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb
index a91e7a5..7c4280b 100644
--- a/lib/puppet/type/file.rb
+++ b/lib/puppet/type/file.rb
@@ -273,12 +273,12 @@ Puppet::Type.newtype(:file) do
   CREATORS = [:content, :source, :target]
 
   validate do
-    count = 0
+    creator_count = 0
     CREATORS.each do |param|
-      count += 1 if self.should(param)
+      creator_count += 1 if self.should(param)
     end
-    count += 1 if @parameters.include?(:source)
-    self.fail "You cannot specify more than one of #{CREATORS.collect { |p| p.to_s}.join(", ")}" if count > 1
+    creator_count += 1 if @parameters.include?(:source)
+    self.fail "You cannot specify more than one of #{CREATORS.collect { |p| p.to_s}.join(", ")}" if creator_count > 1
 
     self.fail "You cannot specify a remote recursion without a source" if !self[:source] and self[:recurse] == :remote
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list