summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorDavid Schmitt <david@schmitt.edv-bus.at>2007-11-11 10:18:51 +0100
committerDavid Schmitt <david@schmitt.edv-bus.at>2007-11-11 10:18:51 +0100
commit385141599f7a01687113ff5d8d88d07c64ab6b65 (patch)
tree5e94277559454a8f194ddb17620f92105d9cb118 /lib/puppet
parent3f583dc133ce50ae34bfc151474c6d4196f803ca (diff)
downloadpuppet-385141599f7a01687113ff5d8d88d07c64ab6b65.tar.gz
puppet-385141599f7a01687113ff5d8d88d07c64ab6b65.tar.xz
puppet-385141599f7a01687113ff5d8d88d07c64ab6b65.zip
fix dependency on $HOME, which causes massive failures when running without environment
lib/puppet/defaults.rb:10:in `expand_path': couldn't find HOME environment -- expanding `~/.puppet' (ArgumentError)
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/defaults.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index ce1411b62..5914c3219 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -6,6 +6,10 @@ module Puppet
var = nil
name = $0.gsub(/.+#{File::SEPARATOR}/,'').sub(/\.rb$/, '')
+ # Make File.expand_path happy
+ require 'etc'
+ ENV["HOME"] ||= Etc.getpwuid(Process.uid).dir
+
if name != "puppetmasterd" and Puppet::Util::SUIDManager.uid != 0
conf = File.expand_path("~/.puppet")
var = File.expand_path("~/.puppet/var")