Permalink
Browse files

Checks if groups is none before extending it

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

0 comments on commit 0042ac2

Please sign in to comment.