diff options
author | Nigel Kersten <nigel@puppetlabs.com> | 2010-11-15 12:36:34 -0800 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-12-01 14:05:46 -0800 |
commit | af6e08c0a59db951502d0cf8c0ca24f5001e92f1 (patch) | |
tree | e21d0e7e4efd62c9eec44d81164ca84f8b0f5185 | |
parent | 3f9f37984d1ac5f3ddcc83bf2b1facdb6df6dacd (diff) | |
download | puppet-af6e08c0a59db951502d0cf8c0ca24f5001e92f1.tar.gz puppet-af6e08c0a59db951502d0cf8c0ca24f5001e92f1.tar.xz puppet-af6e08c0a59db951502d0cf8c0ca24f5001e92f1.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.
Modified by Markus as-per discussion with Nigel.
Signed-off-by: Nigel Kersten <nigel@puppetlabs.com>
-rwxr-xr-x | lib/puppet/provider/maillist/mailman.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/puppet/provider/maillist/mailman.rb b/lib/puppet/provider/maillist/mailman.rb index 4fdc20a69..e070a25dd 100755 --- a/lib/puppet/provider/maillist/mailman.rb +++ b/lib/puppet/provider/maillist/mailman.rb @@ -14,11 +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) - end + list_lists('--bare'). + split("\n"). + collect { |line| new(:ensure => :present, :name => line.strip) } end # Prefetch our list list, yo. |