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