The default processing uses split() to break the line into records on
the separator, which breaks if records can contain the separator. The
custom method I've added uses a 'limited' split() to break the line on
the first separator only.

This commit fixes #1560

Signed-off-by: Paul Lathrop <[email protected]>
---
 lib/puppet/provider/mailalias/aliases.rb |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/lib/puppet/provider/mailalias/aliases.rb 
b/lib/puppet/provider/mailalias/aliases.rb
index 8b5c456..f921712 100755
--- a/lib/puppet/provider/mailalias/aliases.rb
+++ b/lib/puppet/provider/mailalias/aliases.rb
@@ -17,6 +17,14 @@ Puppet::Type.type(:mailalias).provide(:aliases,
             record
         end
 
+        def process(line)
+          ret = {}
+          records = line.split(':',2)
+          ret[:name] = records[0].strip()
+          ret[:recipient] = records[1].strip()
+          ret
+        end
+
         def to_line(record)
             dest = record[:recipient].collect do |d|
                 # Quote aliases that have non-alpha chars
-- 
1.6.1


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to