def plugin_disable(inst, basedn, log, args, warn=True): dn = _get_arg(args.dn, msg="Enter plugin dn to disable") if warn: _warn(dn, msg="Disabling %s %s" % (SINGULAR.__name__, dn)) mc = MANY(inst, basedn) o = mc.get(dn=dn) o.disable() o_str = o.display() log.info('Disabled %s', o_str)
def plugin_disable(inst, basedn, log, args, warn=True): dn = _get_arg( args.dn, msg="Enter plugin dn to disable") if warn: _warn(dn, msg="Disabling %s %s" % (SINGULAR.__name__, dn)) mc = MANY(inst, basedn) o = mc.get(dn=dn) o.disable() o_str = o.display() log.info('Disabled %s', o_str)
def security_disable_plaintext_port(inst, basedn, log, args, warn=True): if warn and args.json is False: _warn( True, msg="Disabling plaintext ldap port - you must have ldaps configured" ) inst.config.disable_plaintext_port() log.info( "Plaintext port disabled - please restart your instance to take effect" ) log.info( "To undo this change run the subcommand - 'dsconf <instance> config replace nsslapd-port=<port number>'" )
def sasl_map_delete(inst, basedn, log, args, warn=True): found = False mappings = SaslMappings(inst).list() map_name = args.map_name.lower() for saslmap in mappings: cn = ensure_str(saslmap.get_attr_val('cn')).lower() if cn == map_name: dn = saslmap.dn found = True break if not found: raise ValueError( "Unable to find a SASL mapping with the name: ({})".format( args.map_name)) if warn and args.json is False: _warn(dn, msg="Deleting %s %s" % (SINGULAR.__name__, dn)) _generic_delete(inst, basedn, log.getChild('sasl_map_delete'), SINGULAR, dn, args)
def backend_delete(inst, basedn, log, args, warn=True): dn = _get_arg(args.dn, msg="Enter dn to delete") if warn: _warn(dn, msg="Deleting %s %s" % (SINGULAR.__name__, dn)) _generic_delete(inst, basedn, log.getChild('backend_delete'), SINGULAR, dn, args)
def delete(inst, basedn, log, args): dn = _get_arg(args, msg="Enter dn to delete") _warn(dn, msg="Deleting %s %s" % (SINGULAR.__name__, dn)) _generic_delete(inst, basedn, log.getChild('_generic_delete'), SINGULAR, dn)
def backend_delete(inst, basedn, log, args, warn=True): dn = _get_arg( args.dn, msg="Enter dn to delete") if warn: _warn(dn, msg="Deleting %s %s" % (SINGULAR.__name__, dn)) _generic_delete(inst, basedn, log.getChild('backend_delete'), SINGULAR, dn)
def remove_cert(inst, log, args, warn=True): tls = NssSsl(dirsrv=inst) nickname = args.nickname if warn: _warn(nickname, msg="Deleting certificate %s" % nickname) tls.del_cert(nickname)