Skip to content

user.present blows up if groups argument is specifed #4173

yml opened this Issue Mar 20, 2013 · 6 comments

2 participants

yml commented Mar 20, 2013
$ sudo -E salt-call state.single user.present foo shell="/bin/bash" home="/home/foo" groups="[www-data,sudo]"
[INFO    ] Loaded configuration file: /etc/salt/minion
[INFO    ] Executing command 'ps -efH' in directory '/home/ubuntu'
[INFO    ] Loading fresh modules for state activity
[INFO    ] Executing state user.present for foo
[ERROR   ] No changes made for foo
    State: - user
    Name:      foo
    Function:  present
        Result:    False
        Comment:   An exception occured in this state: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/", line 1205, in call
    ret = self.states[cdata['full']](*cdata['args'])
  File "/usr/lib/python2.7/dist-packages/salt/states/", line 305, in present
TypeError: 'NoneType' object is not iterable


This is with salt 0.13.3-1

yml commented Mar 20, 2013

The state looks like this :

{% for usr in 'foo','bar','harm' %}                                                                                                                                       
{{ usr }}:                                                                       
        - shell: /bin/bash                                                       
        - home: /home/{{ usr }}                                                  
        - groups:                                                                
            - www-data                                                           
            - sudo                                                               
            - devs                                                               
        - require:                                                               
            - group: devs                                                        
        - user: {{ usr }}                                                        
        - source: salt://repo/{{ usr }}.pub                       
        - require:                                                               
            - user: {{ usr }}                                                    
{% endfor %}
yml commented Mar 20, 2013

This seems to be fixed here : 0042ac2

This does not explain why groups is empty at that stage

Salt Stack member

Fixed in 0042ac2

Thanks for the report @yml

@thatch45 thatch45 closed this Mar 20, 2013
yml commented Mar 21, 2013

@thatch45 not sure it is fixed in 0042ac2 this is the same place where I have left a comment.

line 306


If present_optgroups isNone` is is going to raise an exception:

TypeError: 'NoneType' object is not iterable
Salt Stack member

Thanks, I just pushed a fix for it:

yml commented Mar 22, 2013

I confirm that this one is fixed. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.