summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Helwig <jacob@puppetlabs.com>2011-02-01 14:55:25 -0800
committerJacob Helwig <jacob@puppetlabs.com>2011-02-01 14:55:25 -0800
commitd6572921832cc0df22e13d55c3bc090b74155b91 (patch)
tree1389eb50f7922b263c37d8307660d2acb04a4061
parent3398139f29d26c337476ee36c63d07080c442058 (diff)
downloadpuppet-d6572921832cc0df22e13d55c3bc090b74155b91.tar.gz
puppet-d6572921832cc0df22e13d55c3bc090b74155b91.tar.xz
puppet-d6572921832cc0df22e13d55c3bc090b74155b91.zip
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@puppetlabs.com>
-rw-r--r--lib/puppet/type/file.rb8
1 files 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