# File lib/puppet/provider/nameservice/directoryservice.rb, line 182
182:   def self.generate_attribute_hash(input_hash, *type_properties)
183:     attribute_hash = {}
184:     input_hash.keys.each do |key|
185:       ds_attribute = key.sub("dsAttrTypeStandard:", "")
186:       next unless (@@ds_to_ns_attribute_map.keys.include?(ds_attribute) and type_properties.include? @@ds_to_ns_attribute_map[ds_attribute])
187:       ds_value = input_hash[key]
188:       case @@ds_to_ns_attribute_map[ds_attribute]
189:         when :members
190:           ds_value = ds_value # only members uses arrays so far
191:         when :gid, :uid
192:           # OS X stores objects like uid/gid as strings.
193:           # Try casting to an integer for these cases to be
194:           # consistent with the other providers and the group type
195:           # validation
196:           begin
197:             ds_value = Integer(ds_value[0])
198:           rescue ArgumentError
199:             ds_value = ds_value[0]
200:           end
201:         else ds_value = ds_value[0]
202:       end
203:       attribute_hash[@@ds_to_ns_attribute_map[ds_attribute]] = ds_value
204:     end
205: 
206:     # NBK: need to read the existing password here as it's not actually
207:     # stored in the user record. It is stored at a path that involves the
208:     # UUID of the user record for non-Mobile local acccounts.
209:     # Mobile Accounts are out of scope for this provider for now
210:     attribute_hash[:password] = self.get_password(attribute_hash[:guid]) if @resource_type.validproperties.include?(:password) and Puppet.features.root?
211:     attribute_hash
212:   end