summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTravis Fields <travis@puppetlabs.com>2015-01-09 14:09:03 -0800
committerTravis Fields <travis@puppetlabs.com>2015-01-13 16:50:27 -0800
commitb11311ad65c925c074e6a0b34d8182b70c570225 (patch)
tree71413b757c0e0ec4d21727386979354e50099fdc /lib
parent413dafbb524f65ab28366553814e1680aeaab930 (diff)
FM-2130 Move cache file to non temp directory
Diffstat (limited to 'lib')
-rw-r--r--lib/facter/facter_dot_d.rb6
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