When CLEAN_STRINGS is unset in the command line environment (i.e. forgetting to source the .env file) cleaner output can inject a set of 'CLEANEDCLEANEDCLEANEDCLEAND' in random strings in the cassette.
This can be prevented by an extra check for empty strings (if clean_me.strip() != '':):
for clean_me in clean_strings:
if clean_me.strip() != '':
dirty = dirty.replace(clean_me, 'CLEANED')
Tasks
[ ] add a check to ensure that each string to clean is not empty string.
Context
https://github.com/techservicesillinois/secops-splunk-illinois-midpoint/pull/52#discussion_r1669032304
When CLEAN_STRINGS is unset in the command line environment (i.e. forgetting to source the
.env
file) cleaner output can inject a set of 'CLEANEDCLEANEDCLEANEDCLEAND' in random strings in the cassette.This can be prevented by an extra check for empty strings (
if clean_me.strip() != '':
):Tasks
Reference
https://github.com/techservicesillinois/vcrpy-cleaner/blob/9b4c3b816d735a31ccefbe2fa17bc57ea7ef5026/src/vcr_cleaner/cleaners/env_strings.py#L59-L60