[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.5-303-gfcfa26a
Stefan Schulte
stefan.schulte at taunusstein.net
Thu Mar 17 10:46:02 UTC 2011
The following commit has been merged in the upstream branch:
commit 2a0c970b8f91c9687d3f2a1dea5adac44b5f96fb
Author: Stefan Schulte <stefan.schulte at taunusstein.net>
Date: Sun Dec 5 16:25:06 2010 +0100
(#5662) Parsedfile doesnt work with mult keyattr
When one wants to use the parsedfile provider for a type with more than
one key_attribute (e.g. a type for entries in /etc/services with name
and protocol as key_attributes) the provider will not store all
key_attributes in property_hash and not all keyattributes will be
visible in the to_line function.
The create method of parsedfile will only put validproperties into the
propertyhash. As result :name and all the other key_attributes will not
be set.
In the flush method however the :name parameter is put in the
property_hash but the method does not handle other keyattributes.
This patch modifies flush to put all key_attributes into the property
hash
(Note: @resource.name is basically just an alias for @resource[:name])
diff --git a/lib/puppet/provider/parsedfile.rb b/lib/puppet/provider/parsedfile.rb
index ffd36e5..75a215f 100755
--- a/lib/puppet/provider/parsedfile.rb
+++ b/lib/puppet/provider/parsedfile.rb
@@ -334,7 +334,9 @@ class Puppet::Provider::ParsedFile < Puppet::Provider
@property_hash[:target] = @resource.should(:target) || self.class.default_target
self.class.modified(@property_hash[:target])
end
- @property_hash[:name] ||= @resource.name
+ @resource.class.key_attributes.each do |attr|
+ @property_hash[attr] ||= @resource[attr]
+ end
self.class.flush(@property_hash)
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list