From d5233fe930b50ba5126eef9eb17c3f8b570bd28b Mon Sep 17 00:00:00 2001 From: Nathan Harper Date: Thu, 13 Feb 2025 17:39:13 +0000 Subject: [PATCH] pulled in fixes from https://github.com/stackhpc/kayobe-automation/pull/44 --- utils/redact.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/utils/redact.py b/utils/redact.py index 258900d..967fdd6 100755 --- a/utils/redact.py +++ b/utils/redact.py @@ -5,11 +5,21 @@ import base64 import sys +annotation_exceptions = { + 'prometheus_bcrypt_salt': {'original': 'prometheusbcryptsalt.o', 'changed': 'prometheusbcryptsalt.c'}, +} + def annotate(ctx, value): - if not isinstance(value, str): - return value - path_str = map(str, ctx['path']) - return f"{'.'.join(path_str)}.{ value }" + if not isinstance(value, str): + return value + path_str = *map(str, ctx['path']), + if path_str[0] in annotation_exceptions: + if isinstance(annotation_exceptions[path_str[0]], str): + return annotation_exceptions[path_str[0]] + else: + return annotation_exceptions[path_str[0]][value] + else: + return f"{'_'.join(path_str)}.{value}" def redact_int(ctx, x): # For numbers we can't indicate change with a string, so use sentinal values