]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Fixing command line options for clean-empty-ldap-groups
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 13 Mar 2024 10:36:21 +0000 (11:36 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 13 Mar 2024 10:36:21 +0000 (11:36 +0100)
lib/pp_admintools/app/clean_empty_ldap_groups.py

index 327023b3a4dacb8f6005dcbb684dd36f2471d4fe..f7dd43c64906cc286831acc389f65a777c64f7c9 100644 (file)
@@ -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]