lib/puppet/provider/nameservice/directoryservice.rb in puppet-0.24.5 vs lib/puppet/provider/nameservice/directoryservice.rb in puppet-0.24.6

- old
+ new

@@ -204,12 +204,21 @@ # and call the method which sets that property value # Like netinfo, dscl can't create everything at once, afaik. 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 def password=(passphrase)