Skip to content

Commit

Permalink
Merge branch 'master' into issues/4554-string-to-file-wdl
Browse files Browse the repository at this point in the history
  • Loading branch information
stxue1 authored Sep 27, 2023
2 parents cdc4b05 + 198b5f6 commit b229155
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions contrib/admin/cleanup_aws_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def contains_uuid(string):
Determines if a string contains a pattern like: '28064c76-a491-43e7-9b50-da424f920354',
which toil uses in its test generated bucket names.
"""
return bool(re.compile('[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}').findall(string))
return bool(re.compile('[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{8,12}').findall(string))


def contains_uuid_with_underscores(string):
Expand All @@ -61,15 +61,16 @@ def contains_num_only_uuid(string):
Determines if a string contains a pattern like: '13614-31311-31347',
which toil uses in its test generated sdb domain names.
"""
return bool(re.compile('[0-9]{5}-[0-9]{5}-[0-9]{5}').findall(string))
return bool(re.compile('[0-9]{4,5}-[0-9]{4,5}-[0-9]{4,5}').findall(string))


def contains_toil_test_patterns(string):
return contains_uuid(string) or contains_num_only_uuid(string) or contains_uuid_with_underscores(string)


def matches(resource_name):
if resource_name.endswith('--files') or resource_name.endswith('--jobs') or resource_name.endswith('_toil'):
if (resource_name.endswith('--files') or resource_name.endswith('--jobs') or resource_name.endswith('_toil')
or resource_name.endswith('--internal') or resource_name.startswith('toil-s3test-')):
if contains_toil_test_patterns(resource_name):
return resource_name

Expand Down

0 comments on commit b229155

Please sign in to comment.