Beispiel #1
0
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)
Beispiel #2
0
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)
Beispiel #3
0
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)
Beispiel #4
0
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)