diff --git a/lib/resources/apache_conf.rb b/lib/resources/apache_conf.rb index 3b6b70ca1..0585eea0c 100644 --- a/lib/resources/apache_conf.rb +++ b/lib/resources/apache_conf.rb @@ -63,7 +63,7 @@ class ApacheConf required = Array.new include_files.each do |f| id = File.join(@conf_dir, f) - required.push(FindFiles.find(id)) + required.push(FindFiles.find(id, depth: 1, type: 'file')) end required.flatten! @@ -74,7 +74,7 @@ class ApacheConf optional = Array.new include_files_optional.each do |f| id = File.join(@conf_dir, f) - optional.push(FindFiles.find(id)) + optional.push(FindFiles.find(id, depth: 1, type: 'file')) end optional.flatten! diff --git a/lib/resources/postgres_conf.rb b/lib/resources/postgres_conf.rb index 6ce52ec8d..029c44377 100644 --- a/lib/resources/postgres_conf.rb +++ b/lib/resources/postgres_conf.rb @@ -3,6 +3,7 @@ # license: All rights reserved require 'utils/simpleconfig' +require 'utils/find_files' require 'resources/postgres' class PostgresConf @@ -45,9 +46,10 @@ class PostgresConf # see if there is more config files to include include_files = params['include'] || [] include_files += params['include_if_exists'] || [] - (params['include_dir'] || []).each do |id| - id = File.join(@conf_dir, id) if id[0] != '/' - include_files += Dir.glob(File.join id, '*') + dirs = params['include_dir'] || [] + dirs.each do |dir| + dir = File.join(@conf_dir, dir) if dir[0] != '/' + include_files += FindFiles.find(dir, depth: 1, type: 'file') end to_read += include_files.find_all do |fp| not @files_contents.key? fp