lib/hieracles/node.rb in hieracles-0.1.4 vs lib/hieracles/node.rb in hieracles-0.1.5

- old
+ new

@@ -3,10 +3,11 @@ require "yaml" module Hieracles class Node include Hieracles::Utils + include Hieracles::Interpolate attr_reader :hiera_params, :hiera def initialize(fqdn, options) Config.load(options) @@ -26,11 +27,11 @@ raise "Node not found" end end def files(without_common = true) - @hiera.hierarchy.reduce([]) do |a, f| - file = format("#{f}.yaml", @hiera_params) rescue nil + @__files ||= @hiera.hierarchy.reduce([]) do |a, f| + file = parse("#{f}.yaml", @hiera_params, Config.interactive) if file && File.exist?(File.join(@hiera.datapath, file)) && (!without_common || !file[/common/]) a << File.join(@hiera.datadir, file)