Permalink
Browse files

Use head method to determine if file is in file bucket

This call was using find, but wasn't doing anything with the result,
only checking whether the file existed. Using head here is more
semantic and saves the trouble of reading the file if it does
exist.
  • Loading branch information...
1 parent 40ee670 commit 2d01c2bde3ea104f04565c124755850b466a8bcd @nicklewis nicklewis committed Jun 22, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/puppet/face/file/download.rb
View
2 lib/puppet/face/file/download.rb
@@ -35,7 +35,7 @@
key = "#{type}/#{sumdata}"
Puppet::FileBucket::File.indirection.terminus_class = :file
- if Puppet::FileBucket::File.indirection.find(key)
+ if Puppet::FileBucket::File.indirection.head(key)
Puppet.info "Content for '#{sum}' already exists"
return
end

0 comments on commit 2d01c2b

Please sign in to comment.