# File lib/puppet/provider/nameservice/directoryservice.rb, line 336
336:     def ensure=(ensure_value)
337:         super
338:         # We need to loop over all valid properties for the type we're
339:         # managing and call the method which sets that property value
340:         # dscl can't create everything at once unfortunately.
341:         if ensure_value == :present
342:             @resource.class.validproperties.each do |name|
343:                 next if name == :ensure
344:                 # LAK: We use property.sync here rather than directly calling
345:                 # the settor method because the properties might do some kind
346:                 # of conversion.  In particular, the user gid property might
347:                 # have a string and need to convert it to a number
348:                 if @resource.should(name)
349:                     @resource.property(name).sync
350:                 elsif value = autogen(name)
351:                     self.send(name.to_s + "=", value)
352:                 else
353:                     next
354:                 end
355:             end
356:         end
357:     end