[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

Luke Kanies luke at madstop.com
Fri Jan 23 14:21:06 UTC 2009


The following commit has been merged in the master branch:
commit 2480654aa07dbe6c50777417143a133b1cd94859
Author: Luke Kanies <luke at madstop.com>
Date:   Tue Sep 30 17:50:31 2008 -0500

    The Netinfo and DirectoryService providers can now create user and group simultaneously.
    
    This required selectively using property#sync if a 'should' value
    is present, so that the user's gid property can do the conversion
    if necessary.
    
    Signed-off-by: Luke Kanies <luke at madstop.com>

diff --git a/lib/puppet/provider/nameservice/directoryservice.rb b/lib/puppet/provider/nameservice/directoryservice.rb
index e2e68b2..fcc44f9 100644
--- a/lib/puppet/provider/nameservice/directoryservice.rb
+++ b/lib/puppet/provider/nameservice/directoryservice.rb
@@ -206,9 +206,18 @@ class DirectoryService < Puppet::Provider::NameService
         if ensure_value == :present
             @resource.class.validproperties.each do |name|
                 next if name == :ensure
-                next unless val = @resource.should(name) || autogen(name)
-                # JJM: This calls the method.
-                self.send(name.to_s + "=", val)
+
+                # LAK: We use property.sync here rather than directly calling
+                # the settor method because the properties might do some kind
+                # of conversion.  In particular, the user gid property might
+                # have a string and need to convert it to a number
+                if @resource.should(name)
+                    @resource.property(name).sync
+                elsif value = autogen(name)
+                    self.send(name.to_s + "=", value)
+                else
+                    next
+                end
             end
         end 
     end
diff --git a/lib/puppet/provider/nameservice/netinfo.rb b/lib/puppet/provider/nameservice/netinfo.rb
index 2960005..ac7bc94 100644
--- a/lib/puppet/provider/nameservice/netinfo.rb
+++ b/lib/puppet/provider/nameservice/netinfo.rb
@@ -138,8 +138,18 @@ class NetInfo < Puppet::Provider::NameService
         if arg == :present
             @resource.class.validproperties.each do |name|
                 next if name == :ensure
-                next unless val = @resource.should(name) || autogen(name)
-                self.send(name.to_s + "=", val)
+
+                # LAK: We use property.sync here rather than directly calling
+                # the settor method because the properties might do some kind
+                # of conversion.  In particular, the user gid property might
+                # have a string and need to convert it to a number
+                if @resource.should(name)
+                    @resource.property(name).sync
+                elsif value = autogen(name)
+                    self.send(name.to_s + "=", value)
+                else
+                    next
+                end
             end
         end
     end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list