saltstack-formulas / users-formula

Configure users via pillar
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
99 stars 362 forks source link

fix(macos): gid must be numeric on macos #221

Closed noelmcloughlin closed 4 years ago

noelmcloughlin commented 4 years ago

PR progress checklist (to be filled in by reviewers)


What type of PR is this?

Primary type

Secondary type

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

Describe the changes you're proposing

Fix user.present states on MacOS:

Pillar / config required to test the proposed changes


users:
  ADM:
    sudouser: True
    shell: /bin/bash
    optional_groups:
      - adm
      - wheel
      - docker
    #needs sudo privledges
    sudo_rules:
      - 'ALL=(ALL) ALL'

----------
          ID: users_ADM_user
    Function: user.present
        Name: ADM
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/local/Cellar/salt/3001/libexec/lib/python3.7/site-packages/salt/state.py", line 2154, in call
                  *cdata["args"], **cdata["kwargs"]
                File "/usr/local/Cellar/salt/3001/libexec/lib/python3.7/site-packages/salt/loader.py", line 2087, in wrapper
                  return f(*args, **kwargs)
                File "/usr/local/Cellar/salt/3001/libexec/lib/python3.7/site-packages/salt/states/user.py", line 713, in present
                  __salt__["user.ch{0}".format(key)](name, changes.pop(key))
                File "/usr/local/Cellar/salt/3001/libexec/lib/python3.7/site-packages/salt/modules/mac_user.py", line 228, in chgid
                  raise SaltInvocationError("gid must be an integer")
              salt.exceptions.SaltInvocationError: gid must be an integer
     Started: 16:23:36.712744
    Duration: 519.017 ms
     Changes:   
----------
          ID: users_ADM_user
    Function: file.directory
        Name: /Users/ADM
      Result: False
     Comment: One or more requisite failed:
     Started: 16:23:37.232249
    Duration: 0.004 ms

Debug log showing how the proposed changes work

          ID: users_ADM_user
    Function: user.present
        Name: ADM
      Result: True
     Comment: Updated user ADM
     Started: 16:36:07.358034
    Duration: 1779.972 ms
     Changes:   
              ----------
              groups:
                  - ADM

Documentation checklist

Testing checklist

Additional context

pull-assistant[bot] commented 4 years ago
Score: 1.00

Best reviewed: commit by commit


Optimal code review plan

     fix(macos): gid must be numeric on macos

Powered by Pull Assistant. Last update 9517e4b ... 9517e4b. Read the comment docs.

myii commented 4 years ago

Merged, thanks @noelmcloughlin.

saltstack-formulas-travis commented 4 years ago

:tada: This PR is included in version 0.48.5 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: