# File lib/puppet/provider/nameservice/directoryservice.rb, line 476 476: def getinfo(refresh = false) 477: # JJM 2007-07-24: 478: # Override the getinfo method, which is also defined in nameservice.rb 479: # This method returns and sets @infohash 480: # I'm not re-factoring the name "getinfo" because this method will be 481: # most likely called by nameservice.rb, which I didn't write. 482: if refresh or (! defined?(@property_value_cache_hash) or ! @property_value_cache_hash) 483: # JJM 2007-07-24: OK, there's a bit of magic that's about to 484: # happen... Let's see how strong my grip has become... =) 485: # 486: # self is a provider instance of some Puppet::Type, like 487: # Puppet::Type::User::ProviderDirectoryservice for the case of the 488: # user type and this provider. 489: # 490: # self.class looks like "user provider directoryservice", if that 491: # helps you ... 492: # 493: # self.class.resource_type is a reference to the Puppet::Type class, 494: # probably Puppet::Type::User or Puppet::Type::Group, etc... 495: # 496: # self.class.resource_type.validproperties is a class method, 497: # returning an Array of the valid properties of that specific 498: # Puppet::Type. 499: # 500: # So... something like [:comment, :home, :password, :shell, :uid, 501: # :groups, :ensure, :gid] 502: # 503: # Ultimately, we add :name to the list, delete :ensure from the 504: # list, then report on the remaining list. Pretty whacky, ehh? 505: type_properties = [:name] + self.class.resource_type.validproperties 506: type_properties.delete(:ensure) if type_properties.include? :ensure 507: type_properties << :guid # append GeneratedUID so we just get the report here 508: @property_value_cache_hash = self.class.single_report(@resource[:name], *type_properties) 509: [:uid, :gid].each do |param| 510: @property_value_cache_hash[param] = @property_value_cache_hash[param].to_i if @property_value_cache_hash and @property_value_cache_hash.include?(param) 511: end 512: end 513: @property_value_cache_hash 514: end