summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider.rb14
-rwxr-xr-xlib/puppet/provider/parsedfile.rb2
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/puppet/provider.rb b/lib/puppet/provider.rb
index 5ab2657ba..1f18ae730 100644
--- a/lib/puppet/provider.rb
+++ b/lib/puppet/provider.rb
@@ -12,6 +12,12 @@ class Puppet::Provider
include Puppet::Util, Puppet::Util::Docs
include Puppet::Util::Logging
attr_accessor :name
+
+ # The source parameter exists so that providers using the same
+ # source can specify this, so reading doesn't attempt to read the
+ # same package multiple times.
+ attr_accessor :source
+
# LAK 2007-05-09: Keep the model stuff around for backward compatibility
attr_reader :model
attr_accessor :resource_type
@@ -182,6 +188,14 @@ class Puppet::Provider
end
end
+ # Retrieve the data source. Defaults to the provider name.
+ def self.source
+ unless defined? @source
+ @source = self.name
+ end
+ @source
+ end
+
# Check whether this implementation is suitable for our platform.
def self.suitable?(short = true)
# A single false result is sufficient to turn the whole thing down.
diff --git a/lib/puppet/provider/parsedfile.rb b/lib/puppet/provider/parsedfile.rb
index 3a2acf85f..09233069b 100755
--- a/lib/puppet/provider/parsedfile.rb
+++ b/lib/puppet/provider/parsedfile.rb
@@ -169,7 +169,7 @@ class Puppet::Provider::ParsedFile < Puppet::Provider
end
# Retrieve all of the data from disk. There are three ways to know
- # while files to retrieve: We might have a list of file objects already
+ # which files to retrieve: We might have a list of file objects already
# set up, there might be instances of our associated resource and they
# will have a path parameter set, and we will have a default path
# set. We need to turn those three locations into a list of files,