Пример #1
0
def edit_netgroup(args):
    netgroup = Netgroup(args.pop('cn'))
    for attr, val in args.iteritems():
        attr = attr.lower()
        if attr == 'description':
            netgroup.set_description(val)
        elif attr == 'addnetgrouptriple':
            netgroup.add_triple(val)
        elif attr == 'delnetgrouptriple':
            netgroup.del_triple(val)
    netgroup.commit_changes()
Пример #2
0
def edit(ctx, **args):
    """edit a netgroup"""
    netgroup = Netgroup(args.pop('cn'))
    for attr, val in args.items():
        attr = attr.lower()
        if attr == 'description':
            netgroup.set_description(val)
        elif attr == 'addnisnetgrouptriple':
            netgroup.add_triple(val)
        elif attr == 'delnisnetgrouptriple':
            netgroup.del_triple(val)
        elif attr == 'addmembernisnetgroup':
            netgroup.add_member(val)
        elif attr == 'delmembernisnetgroup':
            netgroup.del_member(val)
    netgroup.commit_changes()