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

(Backport 50175) Add root parameter to useradd, shadow and groupadd #54955

Merged
merged 8 commits into from
Dec 4, 2019

Conversation

aplanas
Copy link
Contributor

@aplanas aplanas commented Oct 11, 2019

What does this PR do?

Add root parameter to useradd and shadow execution modules

Tests written?

Yes

(backport #50175, already merged in develop)

@dwoz dwoz requested a review from a team as a code owner November 20, 2019 08:04
@ghost ghost requested a review from waynew November 20, 2019 08:04
Use the root parameter in the rest of the public API.

Refactor the code to remove duplicate code.

(cherry picked from commit d0d9b86)
Refactor the code to avoid duplications, and use the alternative
spwd functions when a different root is set.

(cherry picked from commit 09d9da9)
In Python 3 the fields for name and password for the spwd module
are different that in Python 2.

This patch makes sure to explore first the Python 2 name and later
check the Python 3 if is not found.

(cherry picked from commit 21e59fb)
In some places of the code gpasswd and usermod are used depending
on the plataform.  One use -Q and other use -R to indicate a
different root parameter.

This patch unify this, using --root parameter.

Partially fix saltstack#43131

(cherry picked from commit 27372ee)
@dwoz dwoz merged commit fc7ddb8 into saltstack:master Dec 4, 2019
@aplanas
Copy link
Contributor Author

aplanas commented Dec 4, 2019

Uau, this is huge. Thanks a lot!

@aplanas aplanas deleted the backport_50175 branch December 4, 2019 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants