(match: re.Match[str])
| 80 | pattern = re.compile(r"\$\{([A-Z0-9_]+)\}") |
| 81 | |
| 82 | def replacer(match: re.Match[str]) -> str: |
| 83 | env_var_name = match.group(1) |
| 84 | original_placeholder = match.group(0) |
| 85 | env_var_value = os.environ.get(env_var_name) |
| 86 | if env_var_value is None: |
| 87 | logger.warning( |
| 88 | f"Environment variable placeholder '{original_placeholder}' was not found in the environment. " |
| 89 | f"The placeholder string will be used as is." |
| 90 | ) |
| 91 | return original_placeholder |
| 92 | return env_var_value |
| 93 | |
| 94 | if isinstance(config, dict): |
| 95 | return {k: replace_env_placeholders(v) for k, v in config.items()} |
nothing calls this directly
no outgoing calls
no test coverage detected