Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Vaelatern
Copy link
Contributor

What does this PR do?

What issues does this PR fix or reference?

Fixes half of #67119 - I did not test for Solaris so don't have that patch.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No but I'm willing to

Copy link

@Rudd-O Rudd-O left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vdloo
Copy link
Contributor

vdloo commented May 10, 2025

I can confirm this is an issue on archlinux at the moment when using salt from the aur, which is the recommended way to install salt on archlinux according to the wiki:

----------
          ID: configure_user
    Function: user.present
        Name: root
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python3.13/site-packages/salt/state.py", line 2428, in call
                  ret = self.states[cdata["full"]](
                      *cdata["args"], **cdata["kwargs"]
                  )
                File "/usr/lib/python3.13/site-packages/salt/loader/lazy.py", line 160, in __call__
                  ret = self.loader.run(run_func, *args, **kwargs)
                File "/usr/lib/python3.13/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/lib/python3.13/site-packages/salt/loader/lazy.py", line 1284, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/usr/lib/python3.13/site-packages/salt/loader/lazy.py", line 1317, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python3.13/site-packages/salt/states/user.py", line 649, in present
                  changes = _changes(
                      name,
                  ...<30 lines>...
                      local=local,
                  )
                File "/usr/lib/python3.13/site-packages/salt/states/user.py", line 123, in _changes
                  lshad = __salt__["shadow.info"](name)
                File "/usr/lib/python3.13/site-packages/salt/loader/lazy.py", line 160, in __call__
                  ret = self.loader.run(run_func, *args, **kwargs)
                File "/usr/lib/python3.13/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/lib/python3.13/site-packages/salt/loader/lazy.py", line 1284, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/usr/lib/python3.13/site-packages/salt/modules/linux_shadow.py", line 74, in info
                  getspnam = functools.partial(spwd.getspnam)
                                               ^^^^
              NameError: name 'spwd' is not defined

A temporary fix for now until this pull request gets merged is to update the salt installation with the file from this pull request: wget -q https://raw.githubusercontent.com/saltstack/salt/8a8fc0814264364de2928aeb1207226d18b6f2f8/salt/modules/linux_shadow.py -O /usr/lib/python3.13/site-packages/salt/modules/linux_shadow.py

By the way, the fix worked for me without installing python-passlib, so not sure the passlib in the requirements/base.txt is necessary.

Copy link
Contributor

@twangboy twangboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a changelog and some tests. This also needs to be rebased and conflicts addressed.

@twangboy
Copy link
Contributor

twangboy commented Jul 2, 2025

Also failing pre-commit

@twangboy
Copy link
Contributor

twangboy commented Jul 2, 2025

What is the added passlib requirement for? I don't see it being used.

@twangboy twangboy added needs-testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases needs-changelog test:full Run the full test suite labels Jul 2, 2025
@Vaelatern
Copy link
Contributor Author

Vaelatern commented Jul 2, 2025

try:
    import passlib.context

So I guess not in this PR but rather #67789

@tacerus
Copy link
Contributor

tacerus commented Oct 16, 2025

Completed this in #68402.

@twangboy
Copy link
Contributor

Closing this in favor of #68402

@twangboy twangboy closed this Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-changelog needs-testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants