Bug #12485
Don't call Etc.getpwuid(Process.uid).dir on Windows
| Status: | Accepted | Start date: | 02/07/2012 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | windows | |||
| Target version: | 2.7.x | |||
| Affected Puppet version: | 2.7.6 | Branch: | ||
| Keywords: | ||||
| Votes: | 0 |
Description
If ENV[‘HOME’] is not set, then the run mode code will call Etc.getpwuid(Process.uid).dir which doesn’t work on Windows because there is no Process.uid and the ‘etc’ module is not available.
Normally this code path is not executed, because Ruby always sets the HOME environment variable based on the HOMEDRIVE and HOMEPATH environment variables. But I suspect that the recent change to unsetting the HOME (and other POSIX) environment variables in a different test case. This would explain why this failure only occurs in master and not 2.7.x.
2) Puppet::Util::RunMode should have confdir /etc/puppet when run as root
Failure/Error: @run_mode.conf_dir.should == File.expand_path(etcdir)
NoMethodError:
undefined method `dir' for nil:NilClass
# ./lib/puppet/util/run_mode.rb:75:in `expand_path'
# ./lib/puppet/util/run_mode.rb:70:in `which_dir'
# ./lib/puppet/util/run_mode.rb:30:in `conf_dir'
# ./spec/unit/util/run_mode_spec.rb:13
3) Puppet::Util::RunMode should have vardir /var/lib/puppet when run as root
Failure/Error: @run_mode.var_dir.should == File.expand_path(vardir)
NoMethodError:
undefined method `dir' for nil:NilClass
# ./lib/puppet/util/run_mode.rb:75:in `expand_path'
# ./lib/puppet/util/run_mode.rb:70:in `which_dir'
# ./lib/puppet/util/run_mode.rb:37:in `var_dir'
# ./spec/unit/util/run_mode_spec.rb:26