Issue #2768 has been updated by Markus Roberts.
Jesse --
Here's my sketch of a solution (this code has never been run or tested, so
beware):
diff --git a/lib/puppet/type/maillist.rb b/lib/puppet/type/maillist.rb
index e2430aa..ce24cb8 100755
--- a/lib/puppet/type/maillist.rb
+++ b/lib/puppet/type/maillist.rb
@@ -38,17 +38,11 @@ module Puppet
def generate
if provider.respond_to?(:aliases)
should = self.should(:ensure) || :present
- if should == :purged
- should = :absent
- end
+ should = :absent if should == :purged
atype = Puppet::Type.type(:mailalias)
- return provider.aliases.collect do |name, recipient|
- if atype[name]
- nil
- else
- malias = Puppet::Type.type(:mailalias).new(:name
=> name, :recipient => recipient, :ensure => should)
- end
- end.compact
+ provider.aliases.
+ reject { |name,recipient| atype.instances.any? { |x|
x.name == name} }.
+ collect { |name,recipient| atype.new(:name => name,
:recipient => recipient, :ensure => should) }
end
end
end
The basic idea is that getting instances of a type by subscripting the type
(Mytype['foo'], like you would in puppet code) is deprecated in the internals
so we have to cook up another way to get the same results.
-- Markus
----------------------------------------
Bug #2768: maillist resource is broken
http://projects.reductivelabs.com/issues/2768
Author: Peter Meier
Status: Accepted
Priority: Normal
Assigned to: Jesse Wolfe
Category: maillist
Target version: 0.25.2
Affected version: 0.25.1
Keywords: maillist
Branch:
running 0.25.1 I get the following error trying to manage maillists:
<pre>
Maillist[foobar]) Failed to generate additional resources using 'generate':
Global resource access is deprecated
</pre>
This seems to be related to #1252
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://reductivelabs.com/redmine/my/account
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---