Fix default group checking in user.present, Fixes #4903

This commit is contained in:
Colton Myers 2013-05-10 15:31:00 -06:00
parent e190f335f8
commit 6695505e4d

View File

@ -70,12 +70,16 @@ def _changes(name,
lusr['groups'].remove(
__salt__['file.gid_to_group'](gid or lusr['gid'])
)
if name in lusr['groups']:
lusr['groups'].remove(name)
# remove default group from wanted_groups, as this requirement is
# already met
if gid and __salt__['file.gid_to_group'](gid or lusr['gid']) in \
wanted_groups:
wanted_groups.remove(
__salt__['file.gid_to_group'](gid or lusr['gid']))
if name in wanted_groups:
wanted_groups.remove(name)
if groups is not None or wanted_groups:
if remove_groups:
if lusr['groups'] != wanted_groups: