From 2db06783fb186d7b445d396d5441f0181ff13c09 Mon Sep 17 00:00:00 2001 From: Dominik Richter Date: Thu, 10 Sep 2015 11:33:41 +0200 Subject: [PATCH] update find_files for all other resources Signed-off-by: Dominik Richter --- lib/resources/apache_conf.rb | 6 ++++-- lib/resources/postgres_conf.rb | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/resources/apache_conf.rb b/lib/resources/apache_conf.rb index 4782e8df2..9d2aacee4 100644 --- a/lib/resources/apache_conf.rb +++ b/lib/resources/apache_conf.rb @@ -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! diff --git a/lib/resources/postgres_conf.rb b/lib/resources/postgres_conf.rb index faf1ba710..c32410263 100644 --- a/lib/resources/postgres_conf.rb +++ b/lib/resources/postgres_conf.rb @@ -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