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')
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)
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')
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')
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')
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)
def action(args): certfile, keyfile = find_credentials(args) with UWGroups(certfile, keyfile, environment=args.environment) as conn: conn.add_members(args.group, args.users)
def action(args): certfile, keyfile = find_credentials(args) with UWGroups(certfile, keyfile, environment=args.environment) as conn: conn.delete_group(args.group_name)