summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2009-11-17 15:58:20 -0800
committerJames Turnbull <james@lovedthanlost.net>2009-11-20 07:34:55 +1100
commitbe7ff82f92a14f4f572d738eeeb2c77437069c49 (patch)
treee45f0a28b61ddeeb5369b5786f82f48dc3e2f1e6 /lib/puppet
parent48beabadb6f234e6486cf32eebc389e8faba13f0 (diff)
downloadpuppet-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-xlib/puppet/type/maillist.rb11
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