Merge pull request #28037 from rallytime/bp-28003

Back-port #28003 to 2015.5
This commit is contained in:
Mike Place 2015-10-16 14:59:52 -06:00
commit 88c1770be4

View file

@ -341,7 +341,7 @@ def info(name):
ret['logonscript'] = items['script_path']
ret['profile'] = items['profile']
if not ret['profile']:
ret['profile'] = _get_userprofile_from_registry(name, ret['uid'])
ret['profile'] = _get_userprofile_from_registry(name, ret['uid'])['vdata']
ret['home'] = items['home_dir']
if not ret['home']:
ret['home'] = ret['profile']
@ -356,8 +356,9 @@ def _get_userprofile_from_registry(user, sid):
In case net user doesn't return the userprofile
we can get it from the registry
'''
profile_dir = __salt__['reg.read_key'](
'HKEY_LOCAL_MACHINE', u'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\{0}'.format(sid),
profile_dir = __salt__['reg.read_value'](
'HKEY_LOCAL_MACHINE',
u'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\{0}'.format(sid),
'ProfileImagePath'
)
log.debug(u'user {0} with sid={2} profile is located at "{1}"'.format(user, profile_dir, sid))