34
34
-a show all UnixCluster autogroups, not just misnamed ones
35
35
-i COGroupId show fixup info for a specific CO Group
36
36
-x COGroupId run UnixCluster Group fixups for given CO Group Id
37
+ --fix-all run UnixCluster Group fixups for all misnamed groups
37
38
-h display this help text
38
39
39
40
Run without options to display misnamed UnixCluster autogroups.
@@ -64,6 +65,7 @@ class Options:
64
65
fix_gid = None
65
66
info_gid = None
66
67
showall = False
68
+ fix_all = False
67
69
68
70
69
71
options = Options ()
@@ -287,12 +289,18 @@ def fixup_unixcluster_group(gid):
287
289
return 0
288
290
289
291
292
+ def fixup_all_unixcluster_groups ():
293
+ groups = get_misnamed_unixcluster_groups ()
294
+ for group in groups :
295
+ fixup_unixcluster_group (group ["Id" ])
296
+
297
+
290
298
# CLI
291
299
292
300
293
301
def parse_options (args ):
294
302
try :
295
- ops , args = getopt .getopt (args , 'u:c:d:f:e:x:i:ah' )
303
+ ops , args = getopt .getopt (args , 'u:c:d:f:e:x:i:ah' , [ "fix-all" ] )
296
304
except getopt .GetoptError :
297
305
usage ()
298
306
@@ -313,6 +321,8 @@ def parse_options(args):
313
321
if op == '-i' : options .info_gid = int (arg )
314
322
if op == '-a' : options .showall = True
315
323
324
+ if op == '--fix-all' : options .fix_all = True
325
+
316
326
user , passwd = getpw (options .user , passfd , passfile )
317
327
options .authstr = mkauthstr (user , passwd )
318
328
@@ -322,6 +332,8 @@ def main(args):
322
332
323
333
if options .fix_gid :
324
334
return fixup_unixcluster_group (options .fix_gid )
335
+ elif options .fix_all :
336
+ return fixup_all_unixcluster_groups ()
325
337
elif options .showall :
326
338
show_all_unixcluster_groups ()
327
339
elif options .info_gid :
0 commit comments