Skip to content

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

Merged
dwoz merged 8 commits into
saltstack:masterfrom
aplanas:backport_50175
Dec 4, 2019
Merged

(Backport 50175) Add root parameter to useradd, shadow and groupadd#54955
dwoz merged 8 commits into
saltstack:masterfrom
aplanas:backport_50175

Conversation

@aplanas

@aplanas aplanas commented Oct 11, 2019

Copy link
Copy Markdown
Contributor

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

aplanas commented Dec 4, 2019

Copy link
Copy Markdown
Contributor Author

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.

5 participants