Skip to content

Commit 9d25b3e

Browse files
committed
Downgrade load_yaml_file log messages to debug
Callers already log at their own preferred level (error or warning) when load_yaml_file returns None. Having load_yaml_file also log at error produced double logging for the same failure. Downgrade the messages in load_yaml_file to debug so that callers remain in control of the log level. This matters because not all callers treat a failure the same way: get_cloud_password has a fallback to secure.yml, so a missing secrets.yml is not an error there. An alternative would be to raise specific exceptions from load_yaml_file instead of returning None so that callers can distinguish file-not-found, decryption errors, and YAML parse errors. That would require a larger refactoring of all call sites. AI-assisted: Claude Code Signed-off-by: Roger Luethi <luethi@osism.tech>
1 parent 3ce26f7 commit 9d25b3e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

osism/tasks/conductor/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def get_vault():
9494
def load_yaml_file(path):
9595
"""Load a YAML file and only request the vault secret when needed."""
9696
if not os.path.exists(path):
97-
logger.error(f"YAML file not found: {path}")
97+
logger.debug(f"YAML file not found: {path}")
9898
return None
9999

100100
try:
@@ -110,10 +110,10 @@ def load_yaml_file(path):
110110

111111
return yaml.safe_load(decrypted_data)
112112
except yaml.YAMLError as exc:
113-
logger.error(f"Failed to parse YAML file {path}: {exc}")
113+
logger.debug(f"Failed to parse YAML file {path}: {exc}")
114114
return None
115115
except Exception as exc:
116-
logger.error(f"Failed to load YAML file {path}: {exc}")
116+
logger.debug(f"Failed to load YAML file {path}: {exc}")
117117
return None
118118

119119

0 commit comments

Comments
 (0)