summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-03-16 17:37:12 -0500
committerLuke Kanies <luke@madstop.com>2008-03-16 17:37:12 -0500
commitf3a304c557c096b5dbf319671cb84e5611eee30f (patch)
treeb6cf562bdd6ff369922f3498fc216a21e1d655c0 /lib
parent80f69ce86d245b45aeb93964aed9b3daca7d0d80 (diff)
downloadpuppet-f3a304c557c096b5dbf319671cb84e5611eee30f.tar.gz
puppet-f3a304c557c096b5dbf319671cb84e5611eee30f.tar.xz
puppet-f3a304c557c096b5dbf319671cb84e5611eee30f.zip
Modifying the yaml terminus base class to use the timestamp
of the yaml file as the version of the object.
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/indirector/yaml.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/puppet/indirector/yaml.rb b/lib/puppet/indirector/yaml.rb
index 16816d941..4baeb38db 100644
--- a/lib/puppet/indirector/yaml.rb
+++ b/lib/puppet/indirector/yaml.rb
@@ -40,6 +40,11 @@ class Puppet::Indirector::Yaml < Puppet::Indirector::Terminus
end
end
+ def version(name)
+ return nil unless FileTest.exist?(path(name))
+ return File.stat(path(name)).mtime
+ end
+
private
def from_yaml(text)