From d6572921832cc0df22e13d55c3bc090b74155b91 Mon Sep 17 00:00:00 2001 From: Jacob Helwig Date: Tue, 1 Feb 2011 14:55:25 -0800 Subject: 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 --- lib/puppet/type/file.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb index a91e7a504..7c4280bee 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 -- cgit