mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
update find_files for all other resources
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
parent
165c08799f
commit
2db06783fb
2 changed files with 7 additions and 3 deletions
|
@ -8,6 +8,8 @@ require 'utils/find_files'
|
|||
class ApacheConf < Vulcano.resource(1)
|
||||
name 'apache_conf'
|
||||
|
||||
include FindFiles
|
||||
|
||||
def initialize(conf_path)
|
||||
@conf_path = conf_path
|
||||
@conf_dir = File.dirname(@conf_path)
|
||||
|
@ -87,13 +89,13 @@ class ApacheConf < Vulcano.resource(1)
|
|||
required = []
|
||||
include_files.each do |f|
|
||||
id = File.join(@conf_dir, f)
|
||||
required.push(FindFiles.find(id, depth: 1, type: 'file'))
|
||||
required.push(find_files(id, depth: 1, type: 'file'))
|
||||
end
|
||||
|
||||
optional = []
|
||||
include_files_optional.each do |f|
|
||||
id = File.join(@conf_dir, f)
|
||||
optional.push(FindFiles.find(id, depth: 1, type: 'file'))
|
||||
optional.push(find_files(id, depth: 1, type: 'file'))
|
||||
end
|
||||
|
||||
required.flatten! + optional.flatten!
|
||||
|
|
|
@ -9,6 +9,8 @@ require 'resources/postgres'
|
|||
class PostgresConf < Vulcano.resource(1)
|
||||
name 'postgres_conf'
|
||||
|
||||
include FindFiles
|
||||
|
||||
def initialize(conf_path)
|
||||
@conf_path = conf_path
|
||||
@conf_dir = File.expand_path(File.dirname @conf_path)
|
||||
|
@ -68,7 +70,7 @@ class PostgresConf < Vulcano.resource(1)
|
|||
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')
|
||||
include_files += find_files(dir, depth: 1, type: 'file')
|
||||
end
|
||||
include_files
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue