]> git.proxmox.com Git - pmg-api.git/blobdiff - PMG/LDAPSet.pm
pmg config: fix avast scan executable path documentation
[pmg-api.git] / PMG / LDAPSet.pm
index d9c4db8dfcf3715f8481ebcdbb61398f5143b20c..e5b65cdbd826552cbb7eb635930c857cff3f4dc8 100755 (executable)
@@ -49,13 +49,23 @@ sub ldap_resync {
        my $msg = "start syncing ldap profile '${p}' (${server})";
        syslog('info', $msg);
        print STDERR "$msg\n" if $tostderr;
+
        $ldap->{$p}->update(2);
+
+       my $errors = $ldap->{$p}->{errors};
+       print STDERR $errors if $tostderr && $errors;
+
        my $gcount = $ldap->{$p}->{gcount};
        my $ucount = $ldap->{$p}->{ucount};
        my $mcount = $ldap->{$p}->{mcount};
 
-       $msg = "finished syncing ldap profile '${p}' (${server}): " .
-           "found $ucount accounts, $mcount addresses, $gcount groups";
+       if ($errors) {
+           $msg = "aborted syncing ldap profile '${p}' (${server}): " .
+               "keep old data, $ucount accounts, $mcount addresses, $gcount groups";
+       } else {
+           $msg = "finished syncing ldap profile '${p}' (${server}): " .
+               "found $ucount accounts, $mcount addresses, $gcount groups";
+       }
        syslog('info', $msg);
        print STDERR "$msg\n" if $tostderr;
     }