2020POST = "POST"
2121DELETE = "DELETE"
2222
23+ OSPOOL_PATTERN_STR = "Yes-"
24+ PROJECT_GIDS_START = 200000
25+
2326_usage = f"""\
2427 usage: [PASS=...] { SCRIPT } [OPTIONS]
2528
@@ -59,6 +62,7 @@ class Options:
5962 authstr = None
6063 min_timeout = MINTIMEOUT
6164 max_timeout = MAXTIMEOUT
65+ project_gid_startval = PROJECT_GIDS_START
6266
6367
6468options = Options ()
@@ -220,7 +224,6 @@ def main(args):
220224 # get groups with 'OSPool project name' matching "Yes-*" that don't have a 'OSG GID'
221225
222226 co_groups = get_osg_co_groups ()["CoGroups" ]
223- ospool_pattern_str = "Yes-"
224227 highest_osggid = 0
225228
226229 for group in co_groups :
@@ -230,10 +233,10 @@ def main(args):
230233 if identifier_data :
231234 identifier_list = identifier_data ["Identifiers" ]
232235
233- project_id_index = identifier_index (id_list = identifier_list , id_type = "ospoolproject" )
236+ project_id_index = identifier_index (identifier_list , "ospoolproject" )
234237 if project_id_index != - 1 :
235238 project_id = identifier_list [project_id_index ]["Identifier" ]
236- is_project = (re .compile (ospool_pattern_str + "*" ).match (project_id ) is not None )
239+ is_project = (re .compile (OSPOOL_PATTERN_STR + "*" ).match (project_id ) is not None )
237240 else :
238241 is_project = False
239242
@@ -242,11 +245,11 @@ def main(args):
242245 highest_osggid = max (highest_osggid , int (identifier_list [osggid_index ]["Identifier" ]))
243246 elif is_project is True :
244247 # for each, set a 'OSG GID' starting from 200000 and a 'OSG Group Name' that is the group name
245- osggid_to_assign = ( 200000 if highest_osggid + 1 < 200000 else highest_osggid + 1 )
248+ osggid_to_assign = max ( highest_osggid + 1 , options . project_gid_startval )
246249 highest_osggid = osggid_to_assign
247250 add_identifier_to_group (gid , type = "osggid" , identifier_name = osggid_to_assign )
248251
249- project_name = project_id .removeprefix (ospool_pattern_str ).lower ()
252+ project_name = project_id .removeprefix (OSPOOL_PATTERN_STR ).lower ()
250253 add_identifier_to_group (gid , type = "osggroup" , identifier_name = project_name )
251254 print (f"project { project_id } : added osggid { osggid_to_assign } and osg project name { project_name } " )
252255
0 commit comments