- previously, it was only matching based on the
  name parameter. This caused a few problems.
  - should not have to specify a name param
  - it does not make as much sense with composite
    namevars
- for composite namevars, it needs to match
  records to resources based on all of the
  namevars.

Signed-off-by: Dan Bode <d...@puppetlabs.com>
---
Local-branch: issue/master/7629
 lib/puppet/provider/parsedfile.rb |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/lib/puppet/provider/parsedfile.rb 
b/lib/puppet/provider/parsedfile.rb
index 75a215f..522930e 100755
--- a/lib/puppet/provider/parsedfile.rb
+++ b/lib/puppet/provider/parsedfile.rb
@@ -193,7 +193,12 @@ class Puppet::Provider::ParsedFile < Puppet::Provider
       # Skip things like comments and blank lines
       next if skip_record?(record)
 
-      if name = record[:name] and resource = resources[name]
+      # collect all of the key attribute values from the record to create the 
key
+      key = resource_type.key_attributes.sort_by{ |k| k.to_s }.collect do 
|attr|
+        record[attr] 
+      end
+      key = key.to_s if key.size == 1
+      if resource = resources[key]
         resource.provider = new(record)
       elsif respond_to?(:match)
         if resource = match(record, matchers)
-- 
1.6.5.1

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to