summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorNigel Kersten <nigel@puppetlabs.com>2010-11-15 12:36:34 -0800
committerNick Lewis <nick@puppetlabs.com>2010-11-17 15:29:34 -0800
commit28e5772d035057e1fe80e6092d8c1b463613e9f8 (patch)
treef95aa518fb3235d407781ecd8167d6e495588e6e /lib/puppet
parente6ec6468c4a9eec58dc155858665a70eee4dfb8c (diff)
downloadpuppet-28e5772d035057e1fe80e6092d8c1b463613e9f8.tar.gz
puppet-28e5772d035057e1fe80e6092d8c1b463613e9f8.tar.xz
puppet-28e5772d035057e1fe80e6092d8c1b463613e9f8.zip
(#5304) Use internal_name rather than real_name for maillist provider
We've switched to using list_lists --bare which shows the internal_name rather than "real_name", which is the authoritative identifier. Doing this also means we have less output to scrub, so the code is simpler. Signed-off-by: Nigel Kersten <nigel@puppetlabs.com>
Diffstat (limited to 'lib/puppet')
-rwxr-xr-xlib/puppet/provider/maillist/mailman.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/puppet/provider/maillist/mailman.rb b/lib/puppet/provider/maillist/mailman.rb
index 4fdc20a69..633642af7 100755
--- a/lib/puppet/provider/maillist/mailman.rb
+++ b/lib/puppet/provider/maillist/mailman.rb
@@ -2,11 +2,11 @@ require 'puppet/provider/parsedfile'
Puppet::Type.type(:maillist).provide(:mailman) do
if [ "CentOS", "RedHat", "Fedora" ].any? { |os| Facter.value(:operatingsystem) == os }
- commands :list_lists => "/usr/lib/mailman/bin/list_lists", :rmlist => "/usr/lib/mailman/bin/rmlist", :newlist => "/usr/lib/mailman/bin/newlist"
+ commands :list_lists => "/usr/lib/mailman/bin/list_lists --bare", :rmlist => "/usr/lib/mailman/bin/rmlist", :newlist => "/usr/lib/mailman/bin/newlist"
commands :mailman => "/usr/lib/mailman/mail/mailman"
else
# This probably won't work for non-Debian installs, but this path is sure not to be in the PATH.
- commands :list_lists => "list_lists", :rmlist => "rmlist", :newlist => "newlist"
+ commands :list_lists => "list_lists --bare", :rmlist => "rmlist", :newlist => "newlist"
commands :mailman => "/var/lib/mailman/mail/mailman"
end
@@ -14,10 +14,9 @@ Puppet::Type.type(:maillist).provide(:mailman) do
# Return a list of existing mailman instances.
def self.instances
- list_lists.split("\n").reject { |line| line.include?("matching mailing lists") }.collect do |line|
- name, description = line.sub(/^\s+/, '').sub(/\s+$/, '').split(/\s+-\s+/)
- description = :absent if description.include?("no description available")
- new(:ensure => :present, :name => name, :description => description)
+ list_lists.split("\n").collect do |line|
+ name = line.strip
+ new(:ensure => :present, :name => name)
end
end