From ff36832ec1837f300e57bfd37ca877c356e24a8b Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 21 Jul 2008 13:58:33 -0500 Subject: Fixing the renaming code to skip missing directories. I couldn't get this to fail in a targeted regression test, but if it's not working, it causes a failure in the webrick tests. Signed-off-by: Luke Kanies --- lib/puppet/sslcertificates/support.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/puppet') diff --git a/lib/puppet/sslcertificates/support.rb b/lib/puppet/sslcertificates/support.rb index bab250d47..d95944adc 100644 --- a/lib/puppet/sslcertificates/support.rb +++ b/lib/puppet/sslcertificates/support.rb @@ -28,7 +28,6 @@ module Puppet::SSLCertificates::Support # Define the reading method. define_method(reader) do - p Puppet[param] return nil unless FileTest.exists?(Puppet[param]) or rename_files_with_uppercase(Puppet[param]) begin @@ -129,6 +128,10 @@ module Puppet::SSLCertificates::Support def rename_files_with_uppercase(file) dir = File.dirname(file) short = File.basename(file) + + # If the dir isn't present, we clearly don't have the file. + #return nil unless FileTest.directory?(dir) + raise ArgumentError, "Tried to fix SSL files to a file containing uppercase" unless short.downcase == short real_file = Dir.entries(dir).reject { |f| f =~ /^\./ }.find do |other| other.downcase == short -- cgit