summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-21 22:30:35 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-21 22:30:35 +0000
commit0bd3055d29f9ee7785a8664360b89fc015a83a4e (patch)
tree648e99da321985cced163022ce7c3485f7b31cfd
parenteecc7cc99835b70867197991efff3c5103185326 (diff)
downloadpuppet-0bd3055d29f9ee7785a8664360b89fc015a83a4e.tar.gz
puppet-0bd3055d29f9ee7785a8664360b89fc015a83a4e.tar.xz
puppet-0bd3055d29f9ee7785a8664360b89fc015a83a4e.zip
Switching Autoload#loadall from using "load" to using "require", so it will not reload already-loaded files. Also updating the checksum docs a bit.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1657 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--lib/puppet/autoload.rb4
-rwxr-xr-xlib/puppet/type/pfile/checksum.rb11
-rw-r--r--test/other/autoload.rb3
3 files changed, 12 insertions, 6 deletions
diff --git a/lib/puppet/autoload.rb b/lib/puppet/autoload.rb
index 7e880b922..2604b3c91 100644
--- a/lib/puppet/autoload.rb
+++ b/lib/puppet/autoload.rb
@@ -76,8 +76,10 @@ class Puppet::Autoload
# aren't used.
name = File.basename(file).sub(".rb", '').intern
next if @loaded.include? name
+ next if $".include?(File.join(@path, name.to_s + ".rb"))
+ filepath = File.join(@path, name.to_s + ".rb")
begin
- Kernel.load file, @wrap
+ Kernel.require filepath
@loaded[name] = true
rescue => detail
if Puppet[:trace]
diff --git a/lib/puppet/type/pfile/checksum.rb b/lib/puppet/type/pfile/checksum.rb
index cd82a4439..a37ccf9dc 100755
--- a/lib/puppet/type/pfile/checksum.rb
+++ b/lib/puppet/type/pfile/checksum.rb
@@ -4,8 +4,13 @@
# changes on its own.
module Puppet
Puppet.type(:file).newstate(:checksum) do
- desc "How to check whether a file has changed. **md5**/*lite-md5*/
- *time*/*mtime*"
+ desc "How to check whether a file has changed. This state is used internally
+ for file copying, but it can also be used to monitor files somewhat
+ like Tripwire without managing the file contents in any way. You can
+ specify that a file's checksum should be monitored and then subscribe to
+ the file from another object and receive events to signify
+ checksum changes, for instance."
+
@event = :file_changed
@unmanaged = true
@@ -24,6 +29,8 @@ module Puppet
str = @validtypes.join("|")
+ # This is here because Puppet sets this internally, using
+ # {md5}......
newvalue(/^\{#{str}\}/) do
handlesum()
end
diff --git a/test/other/autoload.rb b/test/other/autoload.rb
index 7cbb11c1a..f561a81a9 100644
--- a/test/other/autoload.rb
+++ b/test/other/autoload.rb
@@ -98,7 +98,4 @@ TestAutoload.newthing(:#{name.to_s})
"Did not get loaded #{thing.to_s}")
end
end
-
- def test_loadall
- end
end