diff options
Diffstat (limited to 'lib/puppet/file_serving')
-rw-r--r-- | lib/puppet/file_serving/configuration.rb | 7 | ||||
-rw-r--r-- | lib/puppet/file_serving/mount.rb | 9 |
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/puppet/file_serving/configuration.rb b/lib/puppet/file_serving/configuration.rb index bceecc30c..907186ac3 100644 --- a/lib/puppet/file_serving/configuration.rb +++ b/lib/puppet/file_serving/configuration.rb @@ -10,7 +10,10 @@ require 'puppet/util/cacher' class Puppet::FileServing::Configuration require 'puppet/file_serving/configuration/parser' - extend Puppet::Util::Cacher + class << self + include Puppet::Util::Cacher + cached_attr(:configuration) { new() } + end @config_fileuration = nil @@ -18,7 +21,7 @@ class Puppet::FileServing::Configuration # Create our singleton configuration. def self.create - attr_cache(:configuration) { new() } + configuration end private_class_method :new diff --git a/lib/puppet/file_serving/mount.rb b/lib/puppet/file_serving/mount.rb index c52cedbfb..552cf33f2 100644 --- a/lib/puppet/file_serving/mount.rb +++ b/lib/puppet/file_serving/mount.rb @@ -13,16 +13,17 @@ require 'puppet/file_serving/content' # or content objects. class Puppet::FileServing::Mount < Puppet::Network::AuthStore include Puppet::Util::Logging - extend Puppet::Util::Cacher - def self.localmap - attr_cache(:localmap) { + class << self + include Puppet::Util::Cacher + + cached_attr(:localmap) do { "h" => Facter.value("hostname"), "H" => [Facter.value("hostname"), Facter.value("domain")].join("."), "d" => Facter.value("domain") } - } + end end attr_reader :name |