summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettcave <brett@cave.za.net>2014-06-13 09:47:42 +0200
committerbrettcave <brett@cave.za.net>2014-06-13 09:47:42 +0200
commit3de901156fddfe33ffa30c73c4d36d9bc288ab6d (patch)
treef55b4bff15a7d0cd22c54f62889548d322991e91
parentac0a8930dca1f26cbddff75741c8ff5f5f47eac7 (diff)
downloadchef-3de901156fddfe33ffa30c73c4d36d9bc288ab6d.tar.gz
CHEF-5365 - if user home directory is not set via environment, then default user_home to the current directory.
-rw-r--r--lib/chef/config.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/config.rb b/lib/chef/config.rb
index a908fb83d4..0ac82cc5ac 100644
--- a/lib/chef/config.rb
+++ b/lib/chef/config.rb
@@ -552,8 +552,8 @@ class Chef
windows_home_path = env['SYSTEMDRIVE'] + env['HOMEPATH'] if env['SYSTEMDRIVE'] && env['HOMEPATH']
end
- # returns a platform specific path to the user home dir
- default( :user_home ) { env['HOME'] || windows_home_path || env['USERPROFILE'] }
+ # returns a platform specific path to the user home dir if set, otherwise default to current directory.
+ default( :user_home ) { env['HOME'] || windows_home_path || env['USERPROFILE'] || Dir.pwd }
# Enable file permission fixup for selinux. Fixup will be done
# only if selinux is enabled in the system.