Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix #14123 for Windows

Windows raised a different exception when a home directory doesn't exist, so
we catch that too.
  • Loading branch information...
commit 7c7d4b690c2554949e731e13a76546a2de2915f4 1 parent 7e92a7c
@pcarlisle authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  lib/puppet/util.rb
  2. +1 −1  spec/unit/util_spec.rb
View
2  lib/puppet/util.rb
@@ -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
View
2  spec/unit/util_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.