@@ -476,7 +476,7 @@ def meth_acl(args):
476
476
args .snapshot_id )
477
477
fapi ._check_response_code (r , 200 )
478
478
acls = sorted (r .json (), key = lambda k : k ['user' ])
479
- return map ( lambda acl : '{0}\t {1}' .format (acl ['user' ], acl ['role' ]), acls )
479
+ return [ '{0}\t {1}' .format (acl ['user' ], acl ['role' ]) for acl in acls ]
480
480
481
481
@fiss_cmd
482
482
def meth_set_acl (args ):
@@ -668,7 +668,7 @@ def config_acl(args):
668
668
args .snapshot_id )
669
669
fapi ._check_response_code (r , 200 )
670
670
acls = sorted (r .json (), key = lambda k : k ['user' ])
671
- return map ( lambda acl : '{0}\t {1}' .format (acl ['user' ], acl ['role' ]), acls )
671
+ return [ '{0}\t {1}' .format (acl ['user' ], acl ['role' ]) for acl in acls ]
672
672
673
673
@fiss_cmd
674
674
def config_set_acl (args ):
@@ -1374,10 +1374,17 @@ def list_blob_gen(bucket_name):
1374
1374
1375
1375
# Check to see if bucket file path contain the user's submission id
1376
1376
# to ensure deletion of files in the submission directories only.
1377
- # Splits the bucket file: "gs://bucket_Id/submission_id/file_path", by the '/' symbol
1378
- # and stores values in a 5 length array: ['gs:', '' , 'bucket_Id', submission_id, file_path]
1379
- # to extract the submission id from the 4th element (index 3) of the array
1380
- bucket_files = set (bucket_file for bucket_file in bucket_file_sizes if bucket_file .split ('/' , 4 )[3 ] in submission_ids )
1377
+ # Splits the bucket file: gs://<bucket>/<submission_id>/<file_path> or
1378
+ # gs://<bucket>/submissions/<submission_id>/<file_path>, by the '/' symbol
1379
+ # and stores values in a 6 length array: ['gs:', '' , <bucket>, <submission_id>, <workflow_name>, <file_path>] or
1380
+ # ['gs:', '' , <bucket>, 'submissions', <submission_id>, <file_path>]
1381
+ # to extract the submission id from the 4th or 5th element (index 3 or 4) of the array
1382
+ bucket_files = set ()
1383
+ for bucket_file in bucket_file_sizes :
1384
+ for sub_id in bucket_file .split ('/' , 5 )[3 :5 ]:
1385
+ if sub_id in submission_ids :
1386
+ bucket_files .add (bucket_file )
1387
+ break
1381
1388
1382
1389
except Exception as e :
1383
1390
eprint ("Error retrieving files from bucket:" +
@@ -1428,12 +1435,17 @@ def can_delete(f):
1428
1435
return False
1429
1436
if filename == "rc" :
1430
1437
return False
1438
+ if filename == "memory_retry_rc" :
1439
+ return False
1431
1440
# Don't delete tool's exec.sh or script
1432
1441
if filename in ('exec.sh' , 'script' ):
1433
1442
return False
1434
1443
# keep stdout, stderr, and output
1435
1444
if filename in ('stderr' , 'stdout' , 'output' ):
1436
1445
return False
1446
+ # Don't delete utility scripts
1447
+ if filename in ('gcs_localization.sh' , 'gcs_delocalization.sh' , 'gcs_transfer.sh' ):
1448
+ return False
1437
1449
# Only delete specified unreferenced files
1438
1450
if args .include :
1439
1451
for glob in args .include :
0 commit comments