Skip to content

Commit a7a9b2d

Browse files
committed
add -c OSG_CO_ID option (SOFTWARE-4751)
Apparently co_8 is for the -test instance and co_7 is for prod. Who knew.
1 parent e879356 commit a7a9b2d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

osg-comanage-project-usermap.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010

1111
SCRIPT = os.path.basename(__file__)
1212
ENDPOINT = "https://registry-test.cilogon.org/registry/"
13+
OSG_CO_ID = 8
1314

1415

1516
_usage = f"""\
1617
usage: [PASS=...] {SCRIPT} [OPTIONS]
1718
1819
OPTIONS:
1920
-u USER[:PASS] specify USER and optionally PASS on command line
21+
-c OSG_CO_ID specify OSG CO ID (default = {OSG_CO_ID})
2022
-d passfd specify open fd to read PASS
2123
-f passfile specify path to file to open and read PASS
2224
-e ENDPOINT specify REST endpoint
@@ -42,6 +44,7 @@ def usage(msg=None):
4244
class Options:
4345
endpoint = ENDPOINT
4446
user = "co_8.project_script"
47+
osg_co_id = OSG_CO_ID
4548
outfile = None
4649
authstr = None
4750

@@ -87,8 +90,7 @@ def call_api(target, **kw):
8790

8891

8992
def get_osg_co_groups():
90-
OSG_CO_ID = 8
91-
return call_api("co_groups.json", coid=OSG_CO_ID)
93+
return call_api("co_groups.json", coid=options.osg_co_id)
9294

9395

9496
# primary api calls
@@ -149,7 +151,7 @@ def get_co_person_osguser(pid):
149151

150152
def parse_options(args):
151153
try:
152-
ops, args = getopt.getopt(args, 'u:d:f:e:o:h')
154+
ops, args = getopt.getopt(args, 'u:c:d:f:e:o:h')
153155
except getopt.GetoptError:
154156
usage()
155157

@@ -162,6 +164,7 @@ def parse_options(args):
162164
for op, arg in ops:
163165
if op == '-h': usage()
164166
if op == '-u': options.user = arg
167+
if op == '-c': options.osg_co_id = int(arg)
165168
if op == '-d': passfd = int(arg)
166169
if op == '-f': passfile = arg
167170
if op == '-e': options.endpoint = arg

0 commit comments

Comments
 (0)