summaryrefslogtreecommitdiffstats
path: root/spec/lib/puppet_spec/files.rb
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-09-17 17:59:56 -0700
committerJames Turnbull <james@lovedthanlost.net>2010-09-23 09:21:09 +1000
commit2b50f30c703aca5c4f3e89961d64a94d886296bd (patch)
tree1a3ab423cf49ae44dca69cb7b88904a1b615b3de /spec/lib/puppet_spec/files.rb
parent7b8cb741596c7a20a25caf4250d86d7e1c24f319 (diff)
downloadpuppet-2b50f30c703aca5c4f3e89961d64a94d886296bd.tar.gz
puppet-2b50f30c703aca5c4f3e89961d64a94d886296bd.tar.xz
puppet-2b50f30c703aca5c4f3e89961d64a94d886296bd.zip
[#4771] Import of manifests with the same name only happens once
The function import_if_possible, which was supposed to be responsible for making sure that no two threads tried to import the same file at the same time, was not making this decision based on the full pathname of the file, since it was being invoked before pathnames were resolved. As a result, if we attempted to import two distinct files with the same name at the same time (either in two threads or in a single thread due to recursion), one of the files would not always get imported. Fixed this problem by moving the thread-safety logic to happen after filenames are resolved to absolute paths. This made it possible to simplify the thread-safety logic significantly.
Diffstat (limited to 'spec/lib/puppet_spec/files.rb')
-rw-r--r--spec/lib/puppet_spec/files.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/spec/lib/puppet_spec/files.rb b/spec/lib/puppet_spec/files.rb
index cab4a1e47..52ed903ec 100644
--- a/spec/lib/puppet_spec/files.rb
+++ b/spec/lib/puppet_spec/files.rb
@@ -1,4 +1,5 @@
require 'fileutils'
+require 'tempfile'
# A support module for testing files.
module PuppetSpec::Files