]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Changing output.
authorFrank Brehm <frank.brehm@pixelpark.com>
Fri, 6 Jan 2023 16:41:58 +0000 (17:41 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Fri, 6 Jan 2023 16:41:58 +0000 (17:41 +0100)
lib/pp_admintools/app/check_ldap_dn_attributes.py

index 52ccbdee2c729035b71e59736a102c35fcc28370..d33b6574d0ce0057c454c495bacddbd90d1ba28e 100644 (file)
@@ -36,7 +36,7 @@ from .ldap import BaseLdapApplication
 from ..argparse_actions import NonNegativeItegerOptionAction
 from ..argparse_actions import LimitedFloatOptionAction
 
-__version__ = '0.2.0'
+__version__ = '0.2.1'
 LOG = logging.getLogger(__name__)
 
 _ = XLATOR.gettext
@@ -148,9 +148,18 @@ class CheckLdapDnAttributesApplication(BaseLdapApplication):
 
         if self.failed_entries:
             nr = len(self.failed_entries)
+            nr_attr = 0
+            for e_dn in self.failed_entries:
+                for attr in self.failed_entries[e_dn]:
+                    for a_val in self.failed_entries[e_dn][attr]:
+                        nr_attr += 1
             msg = ngettext(
-                "Got an inconsistent entry:", "Got {} inconsistent entries:".format(nr), nr)
+                "Got an inconsistent entry.", "Got {} inconsistent entries.".format(nr), nr)
             LOG.error(msg)
+            msg = ngettext(
+                "There is one inconsistent attribute.",
+                "There are {} inconsistent attributes.".format(nr_attr), nr_attr)
+            LOG.warn(msg)
             print(pp(self.failed_entries.as_dict(pure=True)))
             self.exit(5)