From d5e24816e29c3d4e1367ad0f780d7965346761d0 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 13 Mar 2024 11:36:21 +0100 Subject: [PATCH] Fixing command line options for clean-empty-ldap-groups --- .../app/clean_empty_ldap_groups.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/pp_admintools/app/clean_empty_ldap_groups.py b/lib/pp_admintools/app/clean_empty_ldap_groups.py index 327023b..f7dd43c 100644 --- a/lib/pp_admintools/app/clean_empty_ldap_groups.py +++ b/lib/pp_admintools/app/clean_empty_ldap_groups.py @@ -27,7 +27,7 @@ from .ldap import BaseLdapApplication from .. import pp from ..xlate import XLATOR -__version__ = '0.5.0' +__version__ = '0.5.1' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -49,6 +49,7 @@ class CleanEmptyLdapGroupsApplication(BaseLdapApplication): group_object_classes = ('groupOfNames', 'groupOfUniqueNames', 'groupOfURLs', 'posixGroup') member_attributes = ( 'member', 'memberUid', 'memberURL', 'mgrpRFC822MailMember', 'uniqueMember') + helptext_ldap_base_dn = _('The base DN used as the root for the LDAP search.') # ------------------------------------------------------------------------- def __init__(self, appname=None, base_dir=None): @@ -109,18 +110,6 @@ class CleanEmptyLdapGroupsApplication(BaseLdapApplication): return res - # ------------------------------------------------------------------------- - def init_arg_parser(self): - """Initialize specific command line parameters for this application.""" - remove_group = self.arg_parser.add_argument_group(_('Removing options')) - - remove_group.add_argument( - '-b', '--base-dn', metavar='DN', dest='ldap_base_dn', - help=_('The base DN used as the root for the LDAP search.') - ) - - super(CleanEmptyLdapGroupsApplication, self).init_arg_parser() - # ------------------------------------------------------------------------- def _verify_instances(self): @@ -132,8 +121,6 @@ class CleanEmptyLdapGroupsApplication(BaseLdapApplication): """Execute some steps before calling run().""" super(CleanEmptyLdapGroupsApplication, self).post_init() - self.base_dn = getattr(self.args, 'ldap_base_dn', None) - self.check_instances() self.instance = self.ldap_instances[0] -- 2.39.5