Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Checks if groups is none before extending it

  • Loading branch information...
commit 0042ac2b37e435031665e2dee454c24929348b96 1 parent 2b61586
@mschartman mschartman authored
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 note

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,
@yml

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.

Please sign in to comment.
Something went wrong with that request. Please try again.