lib/chef/provider/user/dscl.rb
#
# Reads the user plist and returns a hash keyed with DSCL properties specified
# in DSCL_PROPERTY_MAP. Return nil if the user is not found.
#
Reads the user plist and returns a hash keyed with DSCL properties specified
in DSCL_PROPERTY_MAP. Return nil if the user is not found.
Reads the user plist and returns a hash keyed with DSCL properties specified in DSCL_PROPERTY_MAP . Return nil if the user is not found .
def read_user_info
          user_info = nil
          shell_out("dscacheutil '-flushcache'")
          begin
            user_plist_file = "#{USER_PLIST_DIRECTORY}/#{@new_resource.username}.plist"
            user_plist_info = run_plutil("convert xml1 -o - #{user_plist_file}")
            user_info = Plist::parse_xml(user_plist_info)
          rescue Chef::Exceptions::PlistUtilCommandFailed
          end
          user_info
        end
def read_user_info user_info = nil shell_out ( "dscacheutil '-flushcache'" ) begin user_plist_file = "#{USER_PLIST_DIRECTORY}/#{@new_resource.username}.plist" user_plist_info = run_plutil ( "convert xml1 -o - #{user_plist_file}" ) user_info = Plist :: parse_xml ( user_plist_info ) rescue Chef :: Exceptions :: PlistUtilCommandFailed end user_info end
Reads the user plist and returns a hash keyed with DSCL properties specified
in DSCL_PROPERTY_MAP.
Reads the user plist and returns a hash keyed with DSCL properties specified in DSCL_PROPERTY_MAP .
# We flush the cache here in order to make sure that we read fresh information # for the user.