1 Oct 2008 05:37
[PATCH 4/9] The Netinfo and DirectoryService providers can now create user and group simultaneously.
Luke Kanies <luke <at> madstop.com>
2008-10-01 03:37:06 GMT
2008-10-01 03:37:06 GMT
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>
---
.../provider/nameservice/directoryservice.rb | 15 ++++++++++++---
lib/puppet/provider/nameservice/netinfo.rb | 14 ++++++++++++--
2 files changed, 24 insertions(+), 5 deletions(-)
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
<at> <at> -206,9 +206,18 <at> <at> class DirectoryService < Puppet::Provider::NameService
if ensure_value == :present
<at> resource.class.validproperties.each do |name|
next if name == :ensure
- next unless val = <at> 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 <at> resource.should(name)
+ <at> resource.property(name).sync
+ elsif value = autogen(name)
(Continue reading)
RSS Feed