From f7c5ceb325da912e05457cd69eb74e03f541cc9f Mon Sep 17 00:00:00 2001 From: Jesse Wolfe Date: Mon, 23 Nov 2009 16:57:04 -0800 Subject: Fixing 2725 Error message when permissions incorrect on file server directory No message was being displayed on the server if a file could not be opened by the file server. Signed-off-by: Jesse Wolfe --- lib/puppet/file_serving/mount/file.rb | 5 ++++- lib/puppet/network/http/handler.rb | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/file_serving/mount/file.rb b/lib/puppet/file_serving/mount/file.rb index bf7ddda45..4309ef79a 100644 --- a/lib/puppet/file_serving/mount/file.rb +++ b/lib/puppet/file_serving/mount/file.rb @@ -25,7 +25,10 @@ class Puppet::FileServing::Mount::File < Puppet::FileServing::Mount file = ::File.join(full_path, relative_path) - return nil unless FileTest.exist?(file) + if ! FileTest.exist?(file) + Puppet.info("File does not exist or is not accessible: #{file}") + return nil + end return file end diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb index 817661db1..65bb0f82c 100644 --- a/lib/puppet/network/http/handler.rb +++ b/lib/puppet/network/http/handler.rb @@ -97,6 +97,7 @@ module Puppet::Network::HTTP::Handler # Execute our find. def do_find(indirection_request, request, response) unless result = indirection_request.model.find(indirection_request.key, indirection_request.to_hash) + Puppet.info("Could not find %s for '%s'" % [indirection_request.indirection_name, indirection_request.key]) return do_exception(response, "Could not find %s %s" % [indirection_request.indirection_name, indirection_request.key], 404) end -- cgit