From: Frank Brehm Date: Fri, 6 Jan 2023 16:41:58 +0000 (+0100) Subject: Changing output. X-Git-Tag: 0.8.0^2~8 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=969b4cb30f9e984f898d97a65814ef3c0076bfd2;p=pixelpark%2Fpp-admin-tools.git Changing output. --- 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)