Skip to content

Commit

Permalink
Checks if groups is none before extending it
Browse files Browse the repository at this point in the history
  • Loading branch information
mschartman committed Mar 20, 2013
1 parent 2b61586 commit 0042ac2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion salt/states/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,10 @@ def present(name,
ret['result'] = None
ret['comment'] = 'User {0} set to be added'.format(name)
return ret
groups.extend(present_optgroups)
if groups:

This comment has been minimized.

Copy link
@yml

yml Mar 20, 2013

Contributor

It seems to me that we should also check for present_optgroups #4173

line 217 present_optgroups is initialized to None and not to an empty list so it is not an iterable.

groups.extend(present_optgroups)
elif present_optgroups:
groups = present_optgroups[:]
if __salt__['user.add'](name,
uid=uid,
gid=gid,
Expand Down

0 comments on commit 0042ac2

Please sign in to comment.