]> git.proxmox.com Git - pve-access-control.git/commitdiff
api: realm sync: avoid separate log line for "remove-vanished" opt
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 19 Jul 2022 10:07:58 +0000 (12:07 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 19 Jul 2022 10:08:01 +0000 (12:08 +0200)
can be a bit confusing and not really necessary, just inline it with
the "syncing user/group" message

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/Domains.pm

index 870e2446a0daa0c1ad11df3c28010bc92d4d8f19..aa8e716a70d38d7fbe2e133144d417f1ec4333ef 100644 (file)
@@ -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};