mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Merge pull request #2916 from Teagan42/YamlSecret-LoadBeforeBreak
Approved by @balloob via gitter
This commit is contained in:
commit
9cfad34866
@ -170,8 +170,7 @@ def _secret_yaml(loader: SafeLineLoader,
|
||||
node: yaml.nodes.Node):
|
||||
"""Load secrets and embed it into the configuration YAML."""
|
||||
secret_path = os.path.dirname(loader.name)
|
||||
while os.path.exists(secret_path) and not secret_path == os.path.dirname(
|
||||
sys.path[0]):
|
||||
while os.path.exists(secret_path):
|
||||
secrets = __SECRET_CACHE.get(secret_path,
|
||||
_load_secret_yaml(secret_path))
|
||||
if node.value in secrets:
|
||||
@ -180,7 +179,8 @@ def _secret_yaml(loader: SafeLineLoader,
|
||||
return secrets[node.value]
|
||||
next_path = os.path.dirname(secret_path)
|
||||
|
||||
if not next_path or next_path == secret_path:
|
||||
if not next_path or next_path == secret_path \
|
||||
or secret_path == os.path.dirname(sys.path[0]):
|
||||
# Somehow we got past the .homeassistant configuration folder...
|
||||
break
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user