mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +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):
|
node: yaml.nodes.Node):
|
||||||
"""Load secrets and embed it into the configuration YAML."""
|
"""Load secrets and embed it into the configuration YAML."""
|
||||||
secret_path = os.path.dirname(loader.name)
|
secret_path = os.path.dirname(loader.name)
|
||||||
while os.path.exists(secret_path) and not secret_path == os.path.dirname(
|
while os.path.exists(secret_path):
|
||||||
sys.path[0]):
|
|
||||||
secrets = __SECRET_CACHE.get(secret_path,
|
secrets = __SECRET_CACHE.get(secret_path,
|
||||||
_load_secret_yaml(secret_path))
|
_load_secret_yaml(secret_path))
|
||||||
if node.value in secrets:
|
if node.value in secrets:
|
||||||
@ -180,7 +179,8 @@ def _secret_yaml(loader: SafeLineLoader,
|
|||||||
return secrets[node.value]
|
return secrets[node.value]
|
||||||
next_path = os.path.dirname(secret_path)
|
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...
|
# Somehow we got past the .homeassistant configuration folder...
|
||||||
break
|
break
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user