added exception
This commit is contained in:
parent
5ded388eb3
commit
9774525d56
@ -13,7 +13,8 @@ clientbucket_path ||= "/var/lib/puppet/clientbucket"
|
||||
|
||||
available_files = Array.new
|
||||
|
||||
Find.find(clientbucket_path) do |file_path|
|
||||
begin
|
||||
Find.find(clientbucket_path) do |file_path|
|
||||
|
||||
# Skip directories and "contents" files
|
||||
next if FileTest.directory?(file_path)
|
||||
@ -39,8 +40,10 @@ Find.find(clientbucket_path) do |file_path|
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
rescue
|
||||
puts "Unable to open file path #{clientbucket_path}"
|
||||
end
|
||||
|
||||
# See if we found any files for the user
|
||||
if available_files.length == 0
|
||||
puts "No files with path #{target_path} exist in the clientbucket"
|
||||
|
Loading…
Reference in New Issue
Block a user