コード例 #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
ファイル: connect.py プロジェクト: nhoffman/uwgroups
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
ファイル: search_user.py プロジェクト: nhoffman/uwgroups
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)