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