On Jun 9, 2010, at 10:32 AM, Markus Roberts wrote:

Hmmm.  The problem should probably be addressed at the creation site,
by making it recursive, since the per-user case:

         conf = File.expand_path("~/.puppet")
         var = File.expand_path("~/.puppet/var")
+        varparent = File.expand_path("~/")

is now a three way race condition and the system-wide case

         # Else, use system-wide directories.
         conf = "/etc/puppet"
         var = "/var/lib/puppet"
+        varparent = "/var/lib"

doesn't handle the (admittedly far less likely) case when /var doesn't
exist.   Also, the varparent would be created even if they changed the
var dir, leading to potentially the same failure as before but now
with the optional creation of a directory at the default location.

I'd advocate a mkdir -p style solution, unless anyone can see problems
with that.


Well, I would say that we should either be localizing or not. We're now defaulting to a value that works great for the linux world but doesn't even work in the non-linux world.

IMO, it's a far larger bug to mkdir -p /var/lib on, say, OS X and AIX than to just have a case statement that localizes for a few basic OS choices.

--
I went to a restaurant that serves "breakfast at anytime". So I
ordered French Toast during the Renaissance. -- Stephen Wright
---------------------------------------------------------------------
Luke Kanies  -|-   http://puppetlabs.com   -|-   +1(615)594-8199

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