Skip to content

Commit

Permalink
Fix #14123 for Windows
Browse files Browse the repository at this point in the history
Windows raised a different exception when a home directory doesn't exist, so
we catch that too.
  • Loading branch information
pcarlisle committed Apr 30, 2012
1 parent 7e92a7c commit 7c7d4b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/util.rb
Expand Up @@ -182,7 +182,7 @@ def which(bin)
end
return dest if FileTest.file? dest and FileTest.executable? dest
rescue ArgumentError => e
raise unless e.to_s =~ /doesn't exist/
raise unless e.to_s =~ /doesn't exist|can't find user/
# ...otherwise, we just skip the non-existent entry, and do nothing.
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/util_spec.rb
Expand Up @@ -577,7 +577,7 @@ def stub_process_wait(exitstatus)
# behave consistently. If they ever implement it correctly (eg: to do
# the lookup for real) it should just work transparently.
baduser = 'if_this_user_exists_I_will_eat_my_hat'
Puppet::Util::Execution.withenv("PATH" => "~#{baduser}:#{base}") do
Puppet::Util::Execution.withenv("PATH" => "~#{baduser}#{File::PATH_SEPARATOR}#{base}") do
Puppet::Util.which('foo').should == path
end
end
Expand Down

0 comments on commit 7c7d4b6

Please sign in to comment.