Permalink
Browse files

Checks if groups is none before extending it

  • Loading branch information...
1 parent 2b61586 commit 0042ac2b37e435031665e2dee454c24929348b96 @mschartman mschartman committed Mar 20, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 salt/states/user.py
View
5 salt/states/user.py
@@ -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:
@yml
yml added a line comment Mar 20, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ groups.extend(present_optgroups)
+ elif present_optgroups:
+ groups = present_optgroups[:]
if __salt__['user.add'](name,
uid=uid,
gid=gid,

0 comments on commit 0042ac2

Please sign in to comment.