def create_parser(subparsers): mep = subparsers.add_parser( 'managed-entries', help='Manage and configure Managed Entries Plugin') subcommands = mep.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, ManagedEntriesPlugin) edit = subcommands.add_parser('set', help='Edit the plugin') edit.set_defaults(func=mep_edit) edit.add_argument('--config-area', help='The value to set as nsslapd-pluginConfigArea') list = subcommands.add_parser( 'list', help='List Managed Entries Plugin configs and templates') subcommands_list = list.add_subparsers(help='action') list_configs = subcommands_list.add_parser( 'configs', help='List Managed Entries Plugin configs (list config-area ' 'if specified in the main plugin entry)') list_configs.set_defaults(func=mep_config_list) list_templates = subcommands_list.add_parser( 'templates', help='List Managed Entries Plugin templates in the directory') list_templates.add_argument( 'BASEDN', help='The base DN where to search the templates.') list_templates.set_defaults(func=mep_template_list) config = subcommands.add_parser( 'config', help='Handle Managed Entries Plugin configs') config.add_argument('NAME', help='The config entry CN.') config_subcommands = config.add_subparsers(help='action') add = config_subcommands.add_parser('add', help='Add the config entry') add.set_defaults(func=mep_config_add) _add_parser_args_config(add) edit = config_subcommands.add_parser('set', help='Edit the config entry') edit.set_defaults(func=mep_config_edit) _add_parser_args_config(edit) show = config_subcommands.add_parser('show', help='Display the config entry') show.set_defaults(func=mep_config_show) delete = config_subcommands.add_parser('delete', help='Delete the config entry') delete.set_defaults(func=mep_config_del) template = subcommands.add_parser( 'template', help='Handle Managed Entries Plugin templates') template.add_argument('DN', help='The template entry DN.') template_subcommands = template.add_subparsers(help='action') add = template_subcommands.add_parser('add', help='Add the template entry') add.set_defaults(func=mep_template_add) _add_parser_args_template(add) edit = template_subcommands.add_parser('set', help='Edit the template entry') edit.set_defaults(func=mep_template_edit) _add_parser_args_template(edit) show = template_subcommands.add_parser('show', help='Display the template entry') show.set_defaults(func=mep_template_show) delete = template_subcommands.add_parser('delete', help='Delete the template entry') delete.set_defaults(func=mep_template_del)
def create_parser(subparsers): winsync = subparsers.add_parser( 'posix-winsync', help='Manage and configure The Posix Winsync API plugin') subcommands = winsync.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, POSIXWinsyncPlugin) edit = subcommands.add_parser('set', help='Edit the plugin') edit.set_defaults(func=winsync_edit) _add_parser_args(edit) fixup = subcommands.add_parser( 'fixup', help= 'Run the memberOf fix-up task to correct mismatched member and uniquemember values for synced users' ) fixup.set_defaults(func=do_fixup) fixup.add_argument('DN', help="Base DN that contains entries to fix up") fixup.add_argument( '-f', '--filter', help= 'Filter for entries to fix up.\n If omitted, all entries with objectclass ' 'inetuser/inetadmin/nsmemberof under the specified base will have ' 'their memberOf attribute regenerated.')
def create_parser(subparsers): usn_parser = subparsers.add_parser('usn', help='Manage and configure USN plugin') subcommands = usn_parser.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, USNPlugin) global_mode_parser = subcommands.add_parser('global', help='Get or manage global USN mode (nsslapd-entryusn-global)') global_mode_parser.set_defaults(func=display_usn_mode) global_mode_subcommands = global_mode_parser.add_subparsers(help='action') on_global_mode_parser = global_mode_subcommands.add_parser('on', help='Enables USN global mode') on_global_mode_parser.set_defaults(func=enable_global_mode) off_global_mode_parser = global_mode_subcommands.add_parser('off', help='Disables USN global mode') off_global_mode_parser.set_defaults(func=disable_global_mode) cleanup_parser = subcommands.add_parser('cleanup', help='Runs the USN tombstone cleanup task') cleanup_parser.set_defaults(func=tombstone_cleanup) cleanup_group = cleanup_parser.add_mutually_exclusive_group(required=True) cleanup_group.add_argument('-s', '--suffix', help='Sets the suffix or subtree in Directory Server to run the cleanup operation ' 'against. If the suffix is not specified, then the back end must be specified (suffix).') cleanup_group.add_argument('-n', '--backend', help='Sets the Directory Server instance back end, or database, to run the cleanup ' 'operation against. If the back end is not specified, then the suffix must be ' 'specified. Backend instance in which USN tombstone entries (backend)') cleanup_parser.add_argument('-m', '--max-usn', type=int, help='Sets the highest USN value to delete when ' 'removing tombstone entries (max_usn_to_delete)')
def create_parser(subparsers): linkedattr_parser = subparsers.add_parser('linked-attr', help='Manage and configure Linked Attributes plugin') subcommands = linkedattr_parser.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, LinkedAttributesPlugin) fixup_parser = subcommands.add_parser('fixup', help='Run the fix-up task for linked attributes plugin') fixup_parser.add_argument('-l', '--linkdn', help="Sets the base DN that contains entries to fix up") fixup_parser.set_defaults(func=fixup) list = subcommands.add_parser('list', help='List available plugin configs') list.set_defaults(func=linkedattr_list) config = subcommands.add_parser('config', help='Manage plugin configs') config.add_argument('NAME', help='The Linked Attributes configuration name') config_subcommands = config.add_subparsers(help='action') add = config_subcommands.add_parser('add', help='Add the config entry') add.set_defaults(func=linkedattr_add) _add_parser_args(add) edit = config_subcommands.add_parser('set', help='Edit the config entry') edit.set_defaults(func=linkedattr_edit) _add_parser_args(edit) show = config_subcommands.add_parser('show', help='Display the config entry') show.set_defaults(func=linkedattr_show) delete = config_subcommands.add_parser('delete', help='Delete the config entry') delete.set_defaults(func=linkedattr_del)
def create_parser(subparsers): dna = subparsers.add_parser('dna', help='Manage and configure DNA plugin') subcommands = dna.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, DNAPlugin) list = subcommands.add_parser('list', help='List available plugin configs') subcommands_list = list.add_subparsers(help='action') list_configs = subcommands_list.add_parser( 'configs', help='List main DNA plugin config entries') list_configs.set_defaults(func=dna_list) list_shared_configs = subcommands_list.add_parser( 'shared-configs', help='List DNA plugin shared config entries') list_shared_configs.add_argument('BASEDN', help='The search DN') list_shared_configs.set_defaults(func=dna_config_list) config = subcommands.add_parser('config', help='Manage plugin configs') config.add_argument('NAME', help='The DNA configuration name') config_subcommands = config.add_subparsers(help='action') add = config_subcommands.add_parser('add', help='Add the config entry') add.set_defaults(func=dna_add) _add_parser_args(add) edit = config_subcommands.add_parser('set', help='Edit the config entry') edit.set_defaults(func=dna_edit) _add_parser_args(edit) show = config_subcommands.add_parser('show', help='Display the config entry') show.set_defaults(func=dna_show) delete = config_subcommands.add_parser('delete', help='Delete the config entry') delete.set_defaults(func=dna_del) shared_config = config_subcommands.add_parser( 'shared-config-entry', help='Manage the shared config entry') shared_config.add_argument( 'HOSTNAME', help= 'Identifies the host name of a server in a shared range, as part of the DNA range ' 'configuration for that specific host in multi-master replication (dnaHostname)' ) shared_config.add_argument( 'PORT', help='Gives the standard port number to use to connect to ' 'the host identified in dnaHostname (dnaPortNum)') shared_config_subcommands = shared_config.add_subparsers(help='action') add_config = shared_config_subcommands.add_parser( 'add', help='Add the shared config entry') add_config.set_defaults(func=dna_config_add) _add_parser_args_config(add_config) edit_config = shared_config_subcommands.add_parser( 'set', help='Edit the shared config entry') edit_config.set_defaults(func=dna_config_edit) _add_parser_args_config(edit_config) show_config_parser = shared_config_subcommands.add_parser( 'show', help='Display the shared config entry') show_config_parser.set_defaults(func=dna_config_show) del_config_parser = shared_config_subcommands.add_parser( 'delete', help='Delete the shared config entry') del_config_parser.set_defaults(func=dna_config_del)
def create_parser(subparsers): rootdnac_parser = subparsers.add_parser('root-dn', help='Manage and configure RootDN Access Control plugin') subcommands = rootdnac_parser.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, RootDNAccessControlPlugin) edit = subcommands.add_parser('set', help='Edit the plugin settings') edit.set_defaults(func=rootdn_edit) _add_parser_args(edit)
def create_parser(subparsers): retrochangelog = subparsers.add_parser('retro-changelog', help='Manage and configure Retro Changelog plugin') subcommands = retrochangelog.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, RetroChangelogPlugin) edit = subcommands.add_parser('set', help='Edit the plugin') edit.set_defaults(func=retrochangelog_edit) _add_parser_args(edit)
def create_parser(subparsers): passthroughauth_parser = subparsers.add_parser('pass-through-auth', help='Manage and configure Pass-Through Authentication plugins ' '(URLs and PAM)') subcommands = passthroughauth_parser.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, PassThroughAuthenticationPlugin) enable = subcommands.add_parser('enable', help='Enable the pass through authentication plugins') enable.set_defaults(func=enable_plugins) disable = subcommands.add_parser('disable', help='Disable the pass through authentication plugins') disable.set_defaults(func=disable_plugins) list = subcommands.add_parser('list', help='List pass-though plugin URLs or PAM configurations') subcommands_list = list.add_subparsers(help='action') list_urls = subcommands_list.add_parser('urls', help='Lists URLs') list_urls.set_defaults(func=pta_list) list_pam = subcommands_list.add_parser('pam-configs', help='Lists PAM configurations') list_pam.set_defaults(func=pam_pta_list) url = subcommands.add_parser('url', help='Manage PTA URL configurations') subcommands_url = url.add_subparsers(help='action') add_url = subcommands_url.add_parser('add', help='Add the config entry') add_url.add_argument('URL', help='The full LDAP URL in format ' '"ldap|ldaps://authDS/subtree maxconns,maxops,timeout,ldver,connlifetime,startTLS". ' 'If one optional parameter is specified the rest should be specified too') add_url.set_defaults(func=pta_add) edit_url = subcommands_url.add_parser('modify', help='Edit the config entry') edit_url.add_argument('OLD_URL', help='The full LDAP URL you get from the "list" command') edit_url.add_argument('NEW_URL', help='Sets the full LDAP URL in format ' '"ldap|ldaps://authDS/subtree maxconns,maxops,timeout,ldver,connlifetime,startTLS". ' 'If one optional parameter is specified the rest should be specified too.') edit_url.set_defaults(func=pta_edit) delete_url = subcommands_url.add_parser('delete', help='Delete the config entry') delete_url.add_argument('URL', help='The full LDAP URL you get from the "list" command') delete_url.set_defaults(func=pta_del) pam = subcommands.add_parser('pam-config', help='Manage PAM PTA configurations.') pam.add_argument('NAME', help='The PAM PTA configuration name') subcommands_pam = pam.add_subparsers(help='action') add = subcommands_pam.add_parser('add', help='Add the config entry') add.set_defaults(func=pam_pta_add) _add_parser_args_pam(add) edit = subcommands_pam.add_parser('set', help='Edit the config entry') edit.set_defaults(func=pam_pta_edit) _add_parser_args_pam(edit) show = subcommands_pam.add_parser('show', help='Display the config entry') show.set_defaults(func=pam_pta_show) delete = subcommands_pam.add_parser('delete', help='Delete the config entry') delete.set_defaults(func=pam_pta_del)
def create_parser(subparsers): winsync = subparsers.add_parser( 'posix-winsync', help='Manage and configure The Posix Winsync API plugin') subcommands = winsync.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, POSIXWinsyncPlugin) edit = subcommands.add_parser('set', help='Edit the plugin') edit.set_defaults(func=winsync_edit) _add_parser_args(edit)
def create_parser(subparsers): contentsync_parser = subparsers.add_parser( 'contentsync', help='Manage and configure Content Sync Plugin (aka syncrepl)') subcommands = contentsync_parser.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, ContentSyncPlugin) edit = subcommands.add_parser('set', help='Edit the plugin') edit.set_defaults(func=contentsync_edit) _add_parser_args(edit) addp = subcommands.add_parser('add', help='Add attributes to the plugin') addp.set_defaults(func=contentsync_add) _add_parser_args(addp)
def create_parser(subparsers): memberof = subparsers.add_parser( 'memberof', help='Manage and configure MemberOf plugin') subcommands = memberof.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, MemberOfPlugin) edit = subcommands.add_parser('set', help='Edit the plugin') edit.set_defaults(func=memberof_edit) _add_parser_args(edit) edit.add_argument('--config-entry', help='The value to set as nsslapd-pluginConfigArea') config = subcommands.add_parser('config-entry', help='Manage the config entry') config_subcommands = config.add_subparsers(help='action') add_config = config_subcommands.add_parser('add', help='Add the config entry') add_config.set_defaults(func=memberof_add_config) add_config.add_argument('DN', help='The config entry full DN') _add_parser_args(add_config) edit_config = config_subcommands.add_parser('set', help='Edit the config entry') edit_config.set_defaults(func=memberof_edit_config) edit_config.add_argument('DN', help='The config entry full DN') _add_parser_args(edit_config) show_config = config_subcommands.add_parser( 'show', help='Display the config entry') show_config.set_defaults(func=memberof_show_config) show_config.add_argument('DN', help='The config entry full DN') del_config_ = config_subcommands.add_parser('delete', help='Delete the config entry') del_config_.set_defaults(func=memberof_del_config) del_config_.add_argument('DN', help='The config entry full DN') fixup = subcommands.add_parser( 'fixup', help='Run the fix-up task for memberOf plugin') fixup.set_defaults(func=do_fixup) fixup.add_argument('DN', help="Base DN that contains entries to fix up") fixup.add_argument( '-f', '--filter', help= 'Filter for entries to fix up.\n If omitted, all entries with objectclass ' 'inetuser/inetadmin/nsmemberof under the specified base will have ' 'their memberOf attribute regenerated.')
def create_parser(subparsers): referint = subparsers.add_parser( 'entryuuid', help='Manage and configure EntryUUID plugin') subcommands = referint.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, EntryUUIDPlugin) fixup = subcommands.add_parser( 'fixup', help='Run the fix-up task for EntryUUID plugin') fixup.set_defaults(func=do_fixup) fixup.add_argument('DN', help="Base DN that contains entries to fix up") fixup.add_argument( '-f', '--filter', help= 'Filter for entries to fix up.\n If omitted, all entries under base DN' 'will have their EntryUUID attribute regenerated if not present.')
def create_parser(subparsers): retrochangelog = subparsers.add_parser( 'retro-changelog', help='Manage and configure Retro Changelog plugin') subcommands = retrochangelog.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, RetroChangelogPlugin) edit = subcommands.add_parser('set', help='Edit the plugin') edit.set_defaults(func=retrochangelog_edit) _add_parser_args(edit) addp = subcommands.add_parser('add', help='Add attributes to the plugin') addp.set_defaults(func=retrochangelog_add) _add_parser_args(addp) delp = subcommands.add_parser('del', help='Delete an attribute from plugin scope') delp.set_defaults(func=retrochangelog_del) _add_parser_args(delp)
def create_parser(subparsers): dna = subparsers.add_parser('dna', help='Manage and configure DNA plugin') subcommands = dna.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, DNAPlugin) list = subcommands.add_parser('list', help='List available plugin configs') subcommands_list = list.add_subparsers(help='action') list_configs = subcommands_list.add_parser('configs', help='List main DNA plugin config entries') list_configs.set_defaults(func=dna_list) list_shared_configs = subcommands_list.add_parser('shared-configs', help='List DNA plugin shared config entries') list_shared_configs.add_argument('BASEDN', help='The search DN') list_shared_configs.set_defaults(func=dna_config_list) config = subcommands.add_parser('config', help='Manage plugin configs') config.add_argument('NAME', help='The DNA configuration name') config_subcommands = config.add_subparsers(help='action') add = config_subcommands.add_parser('add', help='Add the config entry') add.set_defaults(func=dna_add) _add_parser_args(add) edit = config_subcommands.add_parser('set', help='Edit the config entry') edit.set_defaults(func=dna_edit) _add_parser_args(edit) show = config_subcommands.add_parser('show', help='Display the config entry') show.set_defaults(func=dna_show) delete = config_subcommands.add_parser('delete', help='Delete the config entry') delete.set_defaults(func=dna_del) shared_config = config_subcommands.add_parser('shared-config-entry', help='Manage the shared config entry') shared_config.add_argument('SHARED_CFG', help='Use HOSTNAME:PORT for this argument to identify the host name and port of a server in a shared range, as part of the DNA range ' 'configuration for that specific host in multi-supplier replication. (dnaHostname+dnaPortNum)') shared_config_subcommands = shared_config.add_subparsers(help='action') edit_config = shared_config_subcommands.add_parser('set', help='Edit the shared config entry') edit_config.set_defaults(func=dna_config_edit) edit_config.add_argument('--remote-bind-method', help='Specifies the remote bind method "SIMPLE", "SSL" (for SSL client auth), "SASL/GSSAPI", or "SASL/DIGEST-MD5" (dnaRemoteBindMethod)') edit_config.add_argument('--remote-conn-protocol', help='Specifies the remote connection protocol "LDAP", or "TLS" (dnaRemoteConnProtocol)') show_config_parser = shared_config_subcommands.add_parser('show', help='Display the shared config entry') show_config_parser.set_defaults(func=dna_config_show) del_config_parser = shared_config_subcommands.add_parser('delete', help='Delete the shared config entry') del_config_parser.set_defaults(func=dna_config_del)
def create_parser(subparsers): attruniq = subparsers.add_parser( 'attr-uniq', help='Manage and configure Attribute Uniqueness plugin') subcommands = attruniq.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, AttributeUniquenessPlugin) list = subcommands.add_parser('list', help='List available plugin configs') list.set_defaults(func=attruniq_list) add = subcommands.add_parser('add', help='Add the config entry') add.set_defaults(func=attruniq_add) _add_parser_args(add) edit = subcommands.add_parser('set', help='Edit the config entry') edit.set_defaults(func=attruniq_edit) _add_parser_args(edit) show = subcommands.add_parser('show', help='Display the config entry') show.add_argument('NAME', help='The name of the plug-in configuration record') show.set_defaults(func=attruniq_show) delete = subcommands.add_parser('delete', help='Delete the config entry') delete.add_argument( 'NAME', help='Sets the name of the plug-in configuration record') delete.set_defaults(func=attruniq_del) enable = subcommands.add_parser('enable', help='enable plugin') enable.add_argument( 'NAME', help='Sets the name of the plug-in configuration record') enable.set_defaults(func=generic_enable) disable = subcommands.add_parser('disable', help='disable plugin') disable.add_argument( 'NAME', help='Sets the name of the plug-in configuration record') disable.set_defaults(func=generic_disable) status = subcommands.add_parser('status', help='display plugin status') status.add_argument( 'NAME', help='Sets the name of the plug-in configuration record') status.set_defaults(func=generic_status)
def create_parser(subparsers): accountpolicy = subparsers.add_parser( 'account-policy', help='Manage and configure Account Policy plugin') subcommands = accountpolicy.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, AccountPolicyPlugin) edit = subcommands.add_parser('set', help='Edit the plugin settings') edit.set_defaults(func=accountpolicy_edit) edit.add_argument('--config-entry', help='Sets the nsslapd-pluginConfigArea attribute') config = subcommands.add_parser('config-entry', help='Manage the config entry') config_subcommands = config.add_subparsers(help='action') add_config = config_subcommands.add_parser('add', help='Add the config entry') add_config.set_defaults(func=accountpolicy_add_config) add_config.add_argument('DN', help='The full DN of the config entry') _add_parser_args(add_config) edit_config = config_subcommands.add_parser('set', help='Edit the config entry') edit_config.set_defaults(func=accountpolicy_edit_config) edit_config.add_argument('DN', help='The full DN of the config entry') _add_parser_args(edit_config) show_config_parser = config_subcommands.add_parser( 'show', help='Display the config entry') show_config_parser.set_defaults(func=accountpolicy_show_config) show_config_parser.add_argument('DN', help='The full DN of the config entry') del_config_parser = config_subcommands.add_parser( 'delete', help='Delete the config entry') del_config_parser.set_defaults(func=accountpolicy_del_config) del_config_parser.add_argument('DN', help='The full DN of the config entry')
def create_parser(subparsers): referint = subparsers.add_parser( 'referential-integrity', help='Manage and configure Referential Integrity Postoperation plugin') subcommands = referint.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, ReferentialIntegrityPlugin) edit = subcommands.add_parser('set', help='Edit the plugin settings') edit.set_defaults(func=referint_edit) _add_parser_args(edit) edit.add_argument('--config-entry', help='The value to set as nsslapd-pluginConfigArea') config = subcommands.add_parser('config-entry', help='Manage the config entry') config_subcommands = config.add_subparsers(help='action') add_config = config_subcommands.add_parser('add', help='Add the config entry') add_config.set_defaults(func=referint_add_config) add_config.add_argument('DN', help='The config entry full DN') _add_parser_args(add_config) edit_config = config_subcommands.add_parser('set', help='Edit the config entry') edit_config.set_defaults(func=referint_edit_config) edit_config.add_argument('DN', help='The config entry full DN') _add_parser_args(edit_config) show_config = config_subcommands.add_parser( 'show', help='Display the config entry') show_config.set_defaults(func=referint_show_config) show_config.add_argument('DN', help='The config entry full DN') del_config_ = config_subcommands.add_parser('delete', help='Delete the config entry') del_config_.set_defaults(func=referint_del_config) del_config_.add_argument('DN', help='The config entry full DN')
def create_parser(subparsers): automember = subparsers.add_parser( 'automember', help="Manage and configure Automembership plugin") subcommands = automember.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, AutoMembershipPlugin) list = subcommands.add_parser( 'list', help='List Automembership definitions or regex rules.') subcommands_list = list.add_subparsers(help='action') list_definitions = subcommands_list.add_parser( 'definitions', help='Lists Automembership definitions.') list_definitions.set_defaults(func=definition_list) list_regexes = subcommands_list.add_parser( 'regexes', help='List Automembership regex rules.') list_regexes.add_argument('DEFNAME', help='The definition entry CN') list_regexes.set_defaults(func=regex_list) definition = subcommands.add_parser( 'definition', help='Manage Automembership definition.') definition.add_argument('DEFNAME', help='The definition entry CN.') subcommands_definition = definition.add_subparsers(help='action') add_def = subcommands_definition.add_parser( 'add', help='Creates Automembership definition.') add_def.set_defaults(func=definition_add) _add_parser_args_definition(add_def) edit_def = subcommands_definition.add_parser( 'set', help='Edits Automembership definition.') edit_def.set_defaults(func=definition_edit) _add_parser_args_definition(edit_def) delete_def = subcommands_definition.add_parser( 'delete', help='Removes Automembership definition.') delete_def.set_defaults(func=definition_del) show_def = subcommands_definition.add_parser( 'show', help='Displays Automembership definition.') show_def.set_defaults(func=definition_show) regex = subcommands_definition.add_parser( 'regex', help='Manage Automembership regex rules.') regex.add_argument('REGEXNAME', help='The regex entry CN') subcommands_regex = regex.add_subparsers(help='action') add_regex = subcommands_regex.add_parser( 'add', help='Creates Automembership regex.') add_regex.set_defaults(func=regex_add) _add_parser_args_regex(add_regex) edit_regex = subcommands_regex.add_parser( 'set', help='Edits Automembership regex.') edit_regex.set_defaults(func=regex_edit) _add_parser_args_regex(edit_regex) delete_regex = subcommands_regex.add_parser( 'delete', help='Removes Automembership regex.') delete_regex.set_defaults(func=regex_del) show_regex = subcommands_regex.add_parser( 'show', help='Displays Automembership regex.') show_regex.set_defaults(func=regex_show) fixup = subcommands.add_parser('fixup', help='Run a rebuild membership task.') fixup.set_defaults(func=fixup) fixup.add_argument('DN', help="Base DN that contains entries to fix up") fixup.add_argument('-f', '--filter', required=True, help='Sets the LDAP filter for entries to fix up') fixup.add_argument('-s', '--scope', required=True, choices=['sub', 'base', 'one'], type=str.lower, help='Sets the LDAP search scope for entries to fix up') abort_fixup = subcommands.add_parser( 'abort-fixup', help='Abort the rebuild membership task.') abort_fixup.set_defaults(func=abort)
def create_parser(subparsers): contentsync_parser = subparsers.add_parser( 'contentsync', help='Manage and configure Content Sync Plugin (aka syncrepl)') subcommands = contentsync_parser.add_subparsers(help='action') add_generic_plugin_parsers(subcommands, ContentSyncPlugin)