Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Deleting Users and Groups under FreeBSD broken since 3007 #67741

Open
Vringe opened this issue Feb 14, 2025 · 1 comment
Open

[BUG] Deleting Users and Groups under FreeBSD broken since 3007 #67741

Vringe opened this issue Feb 14, 2025 · 1 comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@Vringe
Copy link

Vringe commented Feb 14, 2025

Description
Deleting users and groups via user.absent / group.absent is not working anymore under FreeBSD with Salt 3007.

Setup
I'm running FreeBSD 13.4 with Salt 3007.1.
Since 3007, there was added a new local argument to the absent methods:

salt/salt/states/group.py

Lines 312 to 325 in 029b96c

def absent(name, local=False):
"""
Ensure that the named group is absent
Args:
name (str):
The name of the group to remove
local (Only on systems with lgroupdel available):
Ensure the group account is removed locally ignoring global
account management (default is False).
.. versionadded:: 3007.0

This argument is then passed to the pw_groups Module's delete() method:

def delete(name):

But the argument is not defined there. This leads to the error:

my-minion:
----------
          ID: group_delete_test
    Function: group.absent
        Name: groupname
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/local/lib/python3.9/site-packages/salt/state.py", line 2428, in call
                  ret = self.states[cdata["full"]](
                File "/usr/local/lib/python3.9/site-packages/salt/loader/lazy.py", line 160, in __call__
                  ret = self.loader.run(run_func, *args, **kwargs)
                File "/usr/local/lib/python3.9/site-packages/salt/loader/lazy.py", line 1269, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "/usr/local/lib/python3.9/site-packages/salt/loader/lazy.py", line 1284, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/usr/local/lib/python3.9/site-packages/salt/loader/lazy.py", line 1317, in wrapper
                  return f(*args, **kwargs)
                File "/usr/local/lib/python3.9/site-packages/salt/states/group.py", line 347, in absent
                  ret["result"] = __salt__["group.delete"](name, **del_args)
                File "/usr/local/lib/python3.9/site-packages/salt/loader/lazy.py", line 160, in __call__
                  ret = self.loader.run(run_func, *args, **kwargs)
                File "/usr/local/lib/python3.9/site-packages/salt/loader/lazy.py", line 1269, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "/usr/local/lib/python3.9/site-packages/salt/loader/lazy.py", line 1284, in _run_as
                  return _func_or_method(*args, **kwargs)
              TypeError: delete() got an unexpected keyword argument 'local'
     Started: 11:38:16.462864
    Duration: 16.677 ms
     Changes:

Steps to Reproduce the behavior

group_delete_test:
  group.absent:
    - name: groupname

Expected behavior
Add local argument handling

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3007.1

Python Version:
        Python: 3.9.21 (main, Jan  2 2025, 07:29:25)

Dependency Versions:
          cffi: 1.17.1
      cherrypy: unknown
      dateutil: 2.9.0
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.4
       libgit2: Not Installed
  looseversion: 1.3.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.1.0
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 24.2
     pycparser: 2.22
      pycrypto: 3.21.0
  pycryptodome: 3.21.0
        pygit2: Not Installed
  python-gnupg: 0.5.1
        PyYAML: 6.0.1
         PyZMQ: 25.1.2
        relenv: Not Installed
         smmap: Not Installed
       timelib: 0.3.0
       Tornado: 6.4
           ZMQ: 4.3.5

Salt Package Information:
  Package Type: Not Installed

System Versions:
          dist: freebsd 13.4
        locale: utf-8
       machine: amd64
       release: 13.4-RELEASE-p2
        system: FreeBSD
       version: FreeBSD 13.4
@Vringe Vringe added Bug broken, incorrect, or confusing behavior needs-triage labels Feb 14, 2025
Copy link

welcome bot commented Feb 14, 2025

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@Vringe Vringe changed the title [BUG] [BUG] Deleting Users and Groups under FreeBSD broken since 3007 Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant