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 <[email protected]>
Signed-off-by: Jacob Helwig <[email protected]>
---
 lib/puppet/type/file.rb |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

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
 
-- 
1.7.3.5

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to