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

Delete users and groups #339

Closed
wants to merge 6 commits into from

Conversation

joseivanlopez
Copy link
Contributor

# rubocop:disable Metrics/PerceivedComplexity
def usermod_options
args = []
args << "--login" << user.name if user.name != initial_user.name && user.name
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it makes sense to just always pass it? and if not, then I would maybe create method for it as it repeats often here.

#
# Issues are generated when the home cannot be cleaned up.
def run_action
Yast::Execute.on_target!(FIND, user.home.path, "-mindepth", "1", "-delete")
Copy link
Member

Choose a reason for hiding this comment

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

does find also find hidden files? and what about removing directory?

remove_home_content(user) if !reusing_home && commit_config.home_without_skel?
set_home_ownership(user) if commit_config.adapt_home_ownership?
set_password(user) if user.password
set_auth_keys(user)
Copy link
Member

Choose a reason for hiding this comment

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

I have to say that it looks a bit strange to call methods here. I expect that you fill list of actions as needed and then pass it to some method to execute all actions.

@joseivanlopez joseivanlopez force-pushed the delete-action branch 2 times, most recently from 03bd245 to c11b0b0 Compare October 6, 2021 09:43
@joseivanlopez
Copy link
Contributor Author

Closing in favor of #341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants