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,12 +72,16 @@ impl Action for CreateUsersAndGroups {
|
||||||
ActionTag("create_users_and_group")
|
ActionTag("create_users_and_group")
|
||||||
}
|
}
|
||||||
fn tracing_synopsis(&self) -> String {
|
fn tracing_synopsis(&self) -> String {
|
||||||
format!(
|
if self.create_users.is_empty() {
|
||||||
"Create build users (UID {}-{}) and group (GID {})",
|
format!("Create build group (GID {})", self.nix_build_group_id)
|
||||||
self.nix_build_user_id_base,
|
} else {
|
||||||
self.nix_build_user_id_base + self.nix_build_user_count,
|
format!(
|
||||||
self.nix_build_group_id
|
"Create build users (UID {}-{}) and group (GID {})",
|
||||||
)
|
self.nix_build_user_id_base,
|
||||||
|
self.nix_build_user_id_base + self.nix_build_user_count,
|
||||||
|
self.nix_build_group_id
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tracing_span(&self) -> Span {
|
fn tracing_span(&self) -> Span {
|
||||||
|
@ -239,10 +243,17 @@ impl Action for CreateUsersAndGroups {
|
||||||
explanation.append(&mut create_users_descriptions);
|
explanation.append(&mut create_users_descriptions);
|
||||||
explanation.append(&mut add_user_to_group_descriptions);
|
explanation.append(&mut add_user_to_group_descriptions);
|
||||||
|
|
||||||
vec![ActionDescription::new(
|
if create_users.is_empty() {
|
||||||
format!("Remove Nix users and group"),
|
vec![ActionDescription::new(
|
||||||
explanation,
|
format!("Remove Nix group"),
|
||||||
)]
|
explanation,
|
||||||
|
)]
|
||||||
|
} else {
|
||||||
|
vec![ActionDescription::new(
|
||||||
|
format!("Remove Nix users and group"),
|
||||||
|
explanation,
|
||||||
|
)]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "debug", skip_all)]
|
#[tracing::instrument(level = "debug", skip_all)]
|
||||||
|
|
Loading…
Reference in a new issue