예제 #1
0
파일: create.py 프로젝트: twekberg/uwgroups
def action(args):
    certfile, keyfile = find_credentials(args)
    with UWGroups(certfile, keyfile) as conn:
        conn.create_group(args.group_name)
        conn.set_affiliate(args.group_name,
                           service='exchange',
                           active=args.exchange == 'yes')
예제 #2
0
def action(args):
    certfile, keyfile = find_credentials(args)
    groupdict = json.load(args.groupfile)

    with UWGroups(certfile, keyfile) as conn:
        for group_name, members in sorted(groupdict.items()):
            conn.sync_members(group_name, members, dry_run=args.dry_run)
예제 #3
0
파일: get.py 프로젝트: nhoffman/uwgroups
def action(args):
    certfile, keyfile = find_credentials(args)
    with UWGroups(certfile, keyfile, environment=args.environment) as conn:
        if conn.group_exists(args.group_name):
            body = conn.get_group(args.group_name)
            pprint.pprint(body)
        else:
            sys.exit(f'group "{args.group_name}" does not exist')
예제 #4
0
def action(args):
    certfile, keyfile = find_credentials(args)
    with UWGroups(certfile, keyfile, environment=args.environment) as conn:
        if conn.group_exists(args.group_name):
            members = conn.get_members(args.group_name)
            for m in sorted(members):
                print(m)
        else:
            sys.exit(f'group "{args.group_name}" does not exist')
예제 #5
0
def action(args):
    certfile, keyfile = find_credentials(args)
    with UWGroups(certfile, keyfile, environment=args.environment) as conn:
        for attr in ['host', 'port']:
            print(('{}: {}'.format(attr, getattr(conn.connection, attr))))
        for attr in ['certfile', 'keyfile']:
            print(('{}: {}'.format(attr, getattr(conn, attr))))

        print(('admin users defined by cert: {}'.format(conn.admins)))

        print('ok')
예제 #6
0
def action(args):
    certfile, keyfile = find_credentials(args)
    with UWGroups(certfile, keyfile, environment=args.environment) as conn:
        groups = conn.search_user(args.netid)
        for group in groups:
            print(group)
예제 #7
0
def action(args):
    certfile, keyfile = find_credentials(args)
    with UWGroups(certfile, keyfile, environment=args.environment) as conn:
        conn.add_members(args.group, args.users)
예제 #8
0
def action(args):
    certfile, keyfile = find_credentials(args)
    with UWGroups(certfile, keyfile, environment=args.environment) as conn:
        conn.delete_group(args.group_name)