Skip to content

Commit e2e9bf3

Browse files
committed
Update bulk cleanup to ensure input is a bool
1 parent c0c9396 commit e2e9bf3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

handlers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ def handler_bulk_parse_xml_files(event, context):
6161

6262
def handler_delete_old_files(event, context):
6363
days_back = int(event.get('days_back', 30))
64-
dry_run = bool(strtobool(event.get('dry_run', 'true')))
64+
dry_run = event.get('dry_run', True)
65+
if not isinstance(dry_run, bool):
66+
raise ValueError('dry_run must either be a boolean input. Got {}'.format(dry_run))
6567

6668
remove_old_files_from_ftp(days_back=days_back, dry_run=dry_run)
6769

0 commit comments

Comments
 (0)