From 187cb854be259a8e93a1a298e3b9052111c71415 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 19 Jul 2022 12:07:58 +0200 Subject: [PATCH] api: realm sync: avoid separate log line for "remove-vanished" opt can be a bit confusing and not really necessary, just inline it with the "syncing user/group" message Signed-off-by: Thomas Lamprecht --- src/PVE/API2/Domains.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/PVE/API2/Domains.pm b/src/PVE/API2/Domains.pm index 870e244..aa8e716 100644 --- a/src/PVE/API2/Domains.pm +++ b/src/PVE/API2/Domains.pm @@ -322,8 +322,11 @@ __PACKAGE__->register_method ({ my $update_users = sub { my ($usercfg, $realm, $synced_users, $opts) = @_; - print "syncing users\n"; - print "remove-vanished: $opts->{'remove-vanished'}\n" if defined($opts->{'remove-vanished'}); + if (defined(my $vanished = $opts->{'remove-vanished'})) { + print "syncing users (remove-vanished opts: $vanished)\n"; + } else { + print "syncing users\n"; + } $usercfg->{users} = {} if !defined($usercfg->{users}); my $users = $usercfg->{users}; @@ -374,8 +377,11 @@ my $update_users = sub { my $update_groups = sub { my ($usercfg, $realm, $synced_groups, $opts) = @_; - print "syncing groups\n"; - print "remove-vanished: $opts->{'remove-vanished'}\n" if defined($opts->{'remove-vanished'}); + if (defined(my $vanished = $opts->{'remove-vanished'})) { + print "syncing groups (remove-vanished opts: $vanished)\n"; + } else { + print "syncing groups\n"; + } $usercfg->{groups} = {} if !defined($usercfg->{groups}); my $groups = $usercfg->{groups}; -- 2.39.2