forked from lix-project/lix-installer
Offer better messaging around user/group creation (#557)
* Offer better messaging around user/group creation * fmt
This commit is contained in:
parent
edb72882fd
commit
e5390faf1a
|
@ -72,6 +72,9 @@ impl Action for CreateUsersAndGroups {
|
|||
ActionTag("create_users_and_group")
|
||||
}
|
||||
fn tracing_synopsis(&self) -> String {
|
||||
if self.create_users.is_empty() {
|
||||
format!("Create build group (GID {})", self.nix_build_group_id)
|
||||
} else {
|
||||
format!(
|
||||
"Create build users (UID {}-{}) and group (GID {})",
|
||||
self.nix_build_user_id_base,
|
||||
|
@ -79,6 +82,7 @@ impl Action for CreateUsersAndGroups {
|
|||
self.nix_build_group_id
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn tracing_span(&self) -> Span {
|
||||
span!(
|
||||
|
@ -239,11 +243,18 @@ impl Action for CreateUsersAndGroups {
|
|||
explanation.append(&mut create_users_descriptions);
|
||||
explanation.append(&mut add_user_to_group_descriptions);
|
||||
|
||||
if create_users.is_empty() {
|
||||
vec![ActionDescription::new(
|
||||
format!("Remove Nix group"),
|
||||
explanation,
|
||||
)]
|
||||
} else {
|
||||
vec![ActionDescription::new(
|
||||
format!("Remove Nix users and group"),
|
||||
explanation,
|
||||
)]
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip_all)]
|
||||
async fn revert(&mut self) -> Result<(), ActionError> {
|
||||
|
|
Loading…
Reference in a new issue