Skip to content

Commit

Permalink
Gracefully handle a value that is not a string (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsquizz authored Jul 31, 2024
1 parent 3142a00 commit 2d5c3e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bonfire/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _process_template(*args, **kwargs):
return processed_template


def _is_trusted_config(value, regex, component_params, path):
def _is_trusted_config(value, regex, component_params):
"""
Check for presence of a trusted param being used for the value.
Expand All @@ -47,7 +47,7 @@ def _is_trusted_config(value, regex, component_params, path):
in_params = False

if value:
match = re.match(regex, value)
match = re.match(regex, str(value))
if match and match.groups()[0] in component_params:
in_params = True

Expand Down Expand Up @@ -83,7 +83,7 @@ def _remove_untrusted_configs(data, params, path="", current_dict=None, current_
if not path.endswith(path_end):
continue

if not _is_trusted_config(data, regex, params, path):
if not _is_trusted_config(data, regex, params):
del current_dict[current_key]
log.debug("deleted untrusted config at '%s'", path)

Expand Down

0 comments on commit 2d5c3e2

Please sign in to comment.