diff options
| author | James Turnbull <james@lovedthanlost.net> | 2010-12-02 06:53:17 +1100 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2010-12-02 06:53:17 +1100 |
| commit | 76890a534640e077083785ba1321e76b7c4745ca (patch) | |
| tree | bd118acecbeef32575def6e63cb454db2a356a60 /lib/puppet/provider/maillist | |
| parent | 19f38794ecb5ce55b7850e77bdab919bb33c7ce3 (diff) | |
| download | puppet-76890a534640e077083785ba1321e76b7c4745ca.tar.gz puppet-76890a534640e077083785ba1321e76b7c4745ca.tar.xz puppet-76890a534640e077083785ba1321e76b7c4745ca.zip | |
Revert "(#5304) Use internal_name rather than real_name for maillist provider"
This reverts commit 779fea867a9e23ad48cd877a88756cc5792e9e0c.
Diffstat (limited to 'lib/puppet/provider/maillist')
| -rwxr-xr-x | lib/puppet/provider/maillist/mailman.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/puppet/provider/maillist/mailman.rb b/lib/puppet/provider/maillist/mailman.rb index 633642af7..4fdc20a69 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 --bare", :rmlist => "/usr/lib/mailman/bin/rmlist", :newlist => "/usr/lib/mailman/bin/newlist" + commands :list_lists => "/usr/lib/mailman/bin/list_lists", :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 --bare", :rmlist => "rmlist", :newlist => "newlist" + commands :list_lists => "list_lists", :rmlist => "rmlist", :newlist => "newlist" commands :mailman => "/var/lib/mailman/mail/mailman" end @@ -14,9 +14,10 @@ Puppet::Type.type(:maillist).provide(:mailman) do # Return a list of existing mailman instances. def self.instances - list_lists.split("\n").collect do |line| - name = line.strip - new(:ensure => :present, :name => name) + 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) end end |
