diff options
author | Colleen Murphy <cmurphy@users.noreply.github.com> | 2015-01-14 16:27:21 -0800 |
---|---|---|
committer | Colleen Murphy <cmurphy@users.noreply.github.com> | 2015-01-14 16:27:21 -0800 |
commit | 7a91f209908f78d305e4de56ccc2f42b2b5953af (patch) | |
tree | 628adc59867c25bd128da0af3f171d622839ecb0 /lib | |
parent | 80f09623b63cf6946b5913b629911e2c49b5d1dd (diff) | |
parent | 9e380b9685edb4eb0209b815a65c696be38fb4d5 (diff) |
Merge pull request #401 from cyberious/FM-2131
FM-2131 Move to non temp directory for factor_dot_d
Diffstat (limited to 'lib')
-rw-r--r-- | lib/facter/facter_dot_d.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/facter/facter_dot_d.rb b/lib/facter/facter_dot_d.rb index 2c096b0..b058437 100644 --- a/lib/facter/facter_dot_d.rb +++ b/lib/facter/facter_dot_d.rb @@ -15,7 +15,7 @@ class Facter::Util::DotD require 'yaml' - def initialize(dir="/etc/facts.d", cache_file="/tmp/facts_cache.yml") + def initialize(dir="/etc/facts.d", cache_file=File.join(Puppet[:libdir], "facts_dot_d.cache")) @dir = dir @cache_file = cache_file @cache = nil @@ -23,7 +23,7 @@ class Facter::Util::DotD end def entries - Dir.entries(@dir).reject{|f| f =~ /^\.|\.ttl$/}.sort.map {|f| File.join(@dir, f) } + Dir.entries(@dir).reject { |f| f =~ /^\.|\.ttl$/ }.sort.map { |f| File.join(@dir, f) } rescue [] end @@ -113,7 +113,7 @@ class Facter::Util::DotD def cache_save! cache = load_cache - File.open(@cache_file, "w", 0600) {|f| f.write(YAML.dump(cache)) } + File.open(@cache_file, "w", 0600) { |f| f.write(YAML.dump(cache)) } rescue end |