Skip to content

Commit e94a159

Browse files
Add project group LDAP provisioning
1 parent 82fcc65 commit e94a159

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

project_group_setup.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
ENDPOINT = "https://registry-test.cilogon.org/registry/"
1313
OSG_CO_ID = 8
1414
CLUSTER_ID = 10
15+
LDAP_TARGET_ID = 9
1516
MINTIMEOUT = 5
1617
MAXTIMEOUT = 625
1718
TIMEOUTMULTIPLE = 5
@@ -31,7 +32,8 @@
3132
OPTIONS:
3233
-u USER[:PASS] specify USER and optionally PASS on command line
3334
-c OSG_CO_ID specify OSG CO ID (default = {OSG_CO_ID})
34-
-p CLUSTER_ID specify UNIX Cluster ID (default = {CLUSTER_ID})
35+
-g CLUSTER_ID specify UNIX Cluster ID (default = {CLUSTER_ID})
36+
-l LDAP_TARGET specify LDAP Provsion ID (defult = {LDAP_TARGET_ID})
3537
-d passfd specify open fd to read PASS
3638
-f passfile specify path to file to open and read PASS
3739
-e ENDPOINT specify REST endpoint
@@ -62,6 +64,7 @@ class Options:
6264
user = "co_8.william_test"
6365
osg_co_id = OSG_CO_ID
6466
unix_id = CLUSTER_ID
67+
provision_target = LDAP_TARGET_ID
6568
outfile = None
6669
authstr = None
6770
min_timeout = MINTIMEOUT
@@ -206,8 +209,10 @@ def parse_options(args):
206209
options.user = arg
207210
if op == "-c":
208211
options.osg_co_id = int(arg)
209-
if op == "-p":
212+
if op == "-g":
210213
options.unix_id = int(arg)
214+
if op == "-l":
215+
options.provision_target = int(arg)
211216
if op == "-d":
212217
passfd = int(arg)
213218
if op == "-f":
@@ -238,7 +243,6 @@ def main(args):
238243
unix_cluster_groups = call_api("unix_cluster/unix_cluster_groups.json", unix_cluster_id=options.unix_id)
239244
clustered_group_ids = set(group["CoGroupId"] for group in unix_cluster_groups["UnixClusterGroups"])
240245
projects_needing_cluster_groups = set()
241-
projects_needing_provisioning = set()
242246

243247
for group in co_groups:
244248
gid = group["Id"]
@@ -290,6 +294,10 @@ def main(args):
290294
)
291295
print(f"project group {gid}: added UNIX Cluster Group")
292296

297+
for project_gid in project_groups:
298+
#Provision all project groups
299+
call_api2(POST, f"co_provisioning_targets/provision/{options.provision_target}/cogroupid:{project_gid}.json")
300+
293301

294302
if __name__ == "__main__":
295303
try:

0 commit comments

Comments
 (0)