Skip to content

Commit

Permalink
Update from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
dgdavid committed Sep 24, 2021
1 parent 9ff5241 commit fb24b7a
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/lib/y2firstboot/clients/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def write_config
writer = Y2Users::Linux::Writer.new(
config,
Y2Users::ConfigManager.instance.system,
Y2Users::CommitConfigCollection.new.tap { |collection| collection.add(commit_config) }
commit_configs
)

writer.write
Expand Down Expand Up @@ -162,14 +162,19 @@ def root_user
@root_user ||= config.users.root
end

# Build and return a {Y2Users::CommitConfig} for #user
# Build and return a {Y2Users::CommitConfigCollection} holding
# the {Y2Users::CommitConfig} for #user
#
# @return [Y2Users::CommitConfig]
def commit_config
Y2Users::CommitConfig.new.tap do |config|
config.username = user.name
config.move_home = true
config.adapt_home_ownership = true
def commit_configs
Y2Users::CommitConfigCollection.new.tap do |collection|
config = Y2Users::CommitConfig.new.tap do |config|
config.username = user.name
config.move_home = true
config.adapt_home_ownership = true
end

collection.add(config)
end
end

Expand Down

0 comments on commit fb24b7a

Please sign in to comment.