Skip to content

Commit

Permalink
Conversion from AutoYaST
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Nov 14, 2024
1 parent be67a62 commit efd478b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions rust/agama-lib/src/users/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub struct RootUserSettings {
#[serde(skip_serializing)]
pub password: Option<String>,
/// Whether the password is encrypted or is plain text
#[serde(skip_serializing)]
pub encrypted_password: Option<bool>,
/// Root SSH public key
pub ssh_public_key: Option<String>,
Expand Down
2 changes: 2 additions & 0 deletions service/lib/agama/autoyast/root_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def read
return {} unless root_user

hsh = { "password" => root_user.password.value.to_s }
hsh["passwordEncrypted"] = true if user.password.value.encrypted?

public_key = root_user.authorized_keys.first
hsh["sshPublicKey"] = public_key if public_key
{ "root" => hsh }
Expand Down
3 changes: 3 additions & 0 deletions service/lib/agama/autoyast/user_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def read
"fullName" => user.gecos.first.to_s,
"password" => user.password.value.to_s
}

hsh["passwordEncrypted"] = true if user.password.value.encrypted?

{ "user" => hsh }
end

Expand Down

0 comments on commit efd478b

Please sign in to comment.