[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. 546130d929ce2f82cb074e440993749e74d1f8b4

Micah Anderson micah at riseup.net
Mon Apr 14 02:30:40 UTC 2008


The following commit has been merged in the master branch:
commit 9543cd72896f86c7fd0eff3be2fa9b26cc65ba2b
Author: Luke Kanies <luke at madstop.com>
Date:   Tue Apr 8 11:19:15 2008 -0500

    Adding validation to the user type to confirm that the
    group list does not contain any commas. This seems to be
    a common problem.

diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb
index 48e35f2..71507d1 100755
--- a/lib/puppet/type/user.rb
+++ b/lib/puppet/type/user.rb
@@ -220,6 +220,9 @@ module Puppet
                 if value =~ /^\d+$/
                     raise ArgumentError, "Group names must be provided, not numbers"
                 end
+                if value.include?(",")
+                    raise ArgumentError, "Group names must be provided as an array, not a comma-separated list"
+                end
             end
         end
 
diff --git a/test/ral/type/user.rb b/test/ral/type/user.rb
index b280acf..87d5b60 100755
--- a/test/ral/type/user.rb
+++ b/test/ral/type/user.rb
@@ -362,6 +362,12 @@ class TestUser < Test::Unit::TestCase
         user.delete(:groups)
     end
 
+    def test_groups_list_must_not_contain_commas
+        assert_raise(Puppet::Error) do
+            Puppet::Type.type(:user).create :name => "luke", :groups => "root,adm"
+        end
+    end
+
     def test_autorequire
         file = tempfile()
         comp = nil

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list