|
22 | 22 |
|
23 | 23 |
|
24 | 24 | _usage = f"""\ |
25 | | -usage: [PASS=...] {SCRIPT} [OPTIONS] |
| 25 | +usage: {SCRIPT} [OPTIONS] |
26 | 26 |
|
27 | 27 | OPTIONS: |
28 | 28 | -u USER[:PASS] specify USER and optionally PASS on command line |
|
36 | 36 | (default = {ENDPOINT}) |
37 | 37 | -o outfile specify output file (default: write to stdout) |
38 | 38 | -g filter_group filter users by group name (eg, 'ap1-login') |
39 | | - -l localmaps specify a comma-delimited list of local HTCondor mapfiles to merge into outfile |
| 39 | + -m localmaps specify a comma-delimited list of local HTCondor mapfiles to merge into outfile |
40 | 40 | -h display this help text |
41 | 41 |
|
42 | 42 | PASS for USER is taken from the first of: |
@@ -133,7 +133,7 @@ def parse_options(args): |
133 | 133 | if op == '-e': options.endpoint = arg |
134 | 134 | if op == '-o': options.outfile = arg |
135 | 135 | if op == '-g': options.filtergrp = arg |
136 | | - if op == '-l': options.localmaps = arg.split(",") |
| 136 | + if op == '-m': options.localmaps = arg.split(",") |
137 | 137 |
|
138 | 138 | try: |
139 | 139 | user, passwd = utils.getpw(options.user, passfd, passfile) |
@@ -208,7 +208,11 @@ def get_osguser_groups(filter_group_name=None): |
208 | 208 | ldap_users = utils.get_ldap_active_users_and_groups(options.ldap_server, options.ldap_user, options.ldap_authtok, filter_group_name) |
209 | 209 | topology_projects = requests.get(f"{TOPOLOGY_ENDPOINT}/miscproject/json").json() |
210 | 210 | project_names = topology_projects.keys() |
211 | | - return {user: [p for p in groups if p in project_names] for user, groups in ldap_users.items()} |
| 211 | + return { |
| 212 | + user: [g for g in groups if g in project_names] |
| 213 | + for user, groups in ldap_users.items() |
| 214 | + if any(g in project_names for g in groups) |
| 215 | + } |
212 | 216 |
|
213 | 217 |
|
214 | 218 | def parse_localmap(inputfile): |
|
0 commit comments