Skip to content

Commit 099638c

Browse files
checking if its a string
1 parent 258cfad commit 099638c

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/sagemaker/config/config_utils.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,22 @@ def _log_sagemaker_config_single_substitution(source_value, config_value, config
7575
config_value_log_copy = deepcopy(config_value)
7676

7777

78-
# if isinstance(source_value_log_copy, dict):
79-
# for key in source_value_log_copy.keys():
80-
# if re.search(r'(secret|password|key)', key, re.IGNORECASE):
81-
# source_value_log_copy[key] = '***'
82-
#
83-
# if isinstance(config_value_log_copy, dict):
84-
# for key in config_value_log_copy.keys():
85-
# if re.search(r'(secret|password|key)', key, re.IGNORECASE):
86-
# config_value_log_copy[key] = '***'
87-
8878
if isinstance(source_value_log_copy, dict):
8979
for key in source_value_log_copy.keys():
90-
if 'secret' in key or 'password' in key or 'key' in key or 'SECRET' in key or 'PASSWORD' in key or 'KEY' in key:
80+
if re.search(r'(secret|password|key)', key, re.IGNORECASE):
9181
source_value_log_copy[key] = '***'
9282

9383
if isinstance(config_value_log_copy, dict):
9484
for key in config_value_log_copy.keys():
95-
if 'secret' in key or 'password' in key or 'key' in key or 'SECRET' in key or 'PASSWORD' in key or 'KEY' in key:
85+
if re.search(r'(secret|password|key)', key, re.IGNORECASE):
9686
config_value_log_copy[key] = '***'
9787

88+
if isinstance(source_value_log_copy, str):
89+
source_value_log_copy = '*'
90+
91+
if isinstance(config_value_log_copy, str):
92+
config_value_log_copy = '*'
93+
9894
if config_value is not None:
9995

10096
if source_value is None:

0 commit comments

Comments
 (0)