replace println! with trace!
This commit is contained in:
parent
1e5a95a9f6
commit
70ee27a246
@ -210,7 +210,7 @@ impl UserDBWrite for UserDBLocal {
|
|||||||
if args.delete_home == DeleteHome::Delete {
|
if args.delete_home == DeleteHome::Delete {
|
||||||
Self::delete_home(user)?;
|
Self::delete_home(user)?;
|
||||||
}
|
}
|
||||||
println!("The users groups: {:#?}", user.get_groups());
|
trace!("The users groups: {:#?}", user.get_groups());
|
||||||
// Iterate over the GIDs to avoid borrowing issues
|
// Iterate over the GIDs to avoid borrowing issues
|
||||||
let users_groups: Vec<(MembershipKind, u32)> = user
|
let users_groups: Vec<(MembershipKind, u32)> = user
|
||||||
.get_groups()
|
.get_groups()
|
||||||
@ -218,7 +218,7 @@ impl UserDBWrite for UserDBLocal {
|
|||||||
.map(|(k, g)| (*k, g.borrow().get_gid().unwrap()))
|
.map(|(k, g)| (*k, g.borrow().get_gid().unwrap()))
|
||||||
.collect();
|
.collect();
|
||||||
for (kind, group) in users_groups {
|
for (kind, group) in users_groups {
|
||||||
println!("Woring on group: {:?} - {}", kind, group);
|
trace!("Woring on group: {:?} - {}", kind, group);
|
||||||
match kind {
|
match kind {
|
||||||
crate::group::MembershipKind::Primary => {
|
crate::group::MembershipKind::Primary => {
|
||||||
if self
|
if self
|
||||||
@ -230,12 +230,12 @@ impl UserDBWrite for UserDBLocal {
|
|||||||
.len()
|
.len()
|
||||||
== 1
|
== 1
|
||||||
{
|
{
|
||||||
println!(
|
trace!(
|
||||||
"Deleting group as the user to be deleted is the only member {:?}", self
|
"Deleting group as the user to be deleted is the only member {}", self
|
||||||
.get_group_by_id(group)
|
.get_group_by_id(group)
|
||||||
.expect("The group does not exist")
|
.expect("The group does not exist")
|
||||||
.borrow()
|
.borrow()
|
||||||
.get_member_names()
|
.get_groupname().expect("a group has to have a name")
|
||||||
);
|
);
|
||||||
Self::delete_from_group(
|
Self::delete_from_group(
|
||||||
self.get_group_by_id(group)
|
self.get_group_by_id(group)
|
||||||
@ -245,7 +245,6 @@ impl UserDBWrite for UserDBLocal {
|
|||||||
)?;
|
)?;
|
||||||
self.delete_group_by_id(group);
|
self.delete_group_by_id(group);
|
||||||
} else {
|
} else {
|
||||||
println!("Do not delete the group as the user to be deleted is not the only member");
|
|
||||||
// remove the from the group instead of deleting the group if he was not the only user in its primary group.
|
// remove the from the group instead of deleting the group if he was not the only user in its primary group.
|
||||||
if let Some(group) = self.get_group_by_id(group) {
|
if let Some(group) = self.get_group_by_id(group) {
|
||||||
group
|
group
|
||||||
@ -260,7 +259,7 @@ impl UserDBWrite for UserDBLocal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
crate::group::MembershipKind::Member => {
|
crate::group::MembershipKind::Member => {
|
||||||
println!("delete the membership in the group");
|
trace!("delete the membership in the group");
|
||||||
if let Some(group) = self.get_group_by_id(group) {
|
if let Some(group) = self.get_group_by_id(group) {
|
||||||
group
|
group
|
||||||
.borrow_mut()
|
.borrow_mut()
|
||||||
|
Loading…
Reference in New Issue
Block a user