diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2009-11-17 15:58:20 -0800 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-11-20 07:34:55 +1100 |
commit | be7ff82f92a14f4f572d738eeeb2c77437069c49 (patch) | |
tree | e45f0a28b61ddeeb5369b5786f82f48dc3e2f1e6 /lib/puppet | |
parent | 48beabadb6f234e6486cf32eebc389e8faba13f0 (diff) | |
download | puppet-be7ff82f92a14f4f572d738eeeb2c77437069c49.tar.gz puppet-be7ff82f92a14f4f572d738eeeb2c77437069c49.tar.xz puppet-be7ff82f92a14f4f572d738eeeb2c77437069c49.zip |
Fix 2768 maillist resource is broken
Replace deprecated method call. This code was not tested before, so I've
tried to capture what I think the method was trying to do.
This version includes Luke's suggested change to better preserve the
original behavior.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'lib/puppet')
-rwxr-xr-x | lib/puppet/type/maillist.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/puppet/type/maillist.rb b/lib/puppet/type/maillist.rb index e2430aa13..4ab9be252 100755 --- a/lib/puppet/type/maillist.rb +++ b/lib/puppet/type/maillist.rb @@ -42,13 +42,10 @@ module Puppet should = :absent end 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| catalog.resource(:mailalias, name) }. + collect { |name,recipient| atype.new(:name => name, :recipient => recipient, :ensure => should) } end end end |