From 969b4cb30f9e984f898d97a65814ef3c0076bfd2 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Fri, 6 Jan 2023 17:41:58 +0100 Subject: [PATCH] Changing output. --- lib/pp_admintools/app/check_ldap_dn_attributes.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/pp_admintools/app/check_ldap_dn_attributes.py b/lib/pp_admintools/app/check_ldap_dn_attributes.py index 52ccbde..d33b657 100644 --- a/lib/pp_admintools/app/check_ldap_dn_attributes.py +++ b/lib/pp_admintools/app/check_ldap_dn_attributes.py @@ -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) -- 2.39.5