Apparently, doesn't load the root config secret

This commit is contained in:
Teagan M. Glenn 2016-08-20 22:02:04 -06:00
parent 6aa0789e38
commit af22aeeba8

View File

@ -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