Skip to content

Commit

Permalink
Issue #93: Use THEN to execute (load templates and devices)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekmo committed Oct 14, 2018
1 parent 938fd72 commit ebd5a21
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions amazon_dash/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
from pwd import getpwuid

from jsonschema import validate, ValidationError

from then.configs.base import LoadConfig
from then.configs.components import LoadComponentConfigs
from then.configs.templates import LoadTemplates
from then.helper import Then
from yaml import load
from yaml.error import YAMLError
Expand Down Expand Up @@ -201,7 +204,8 @@ def only_root_write(path):
class Config:
"""Parse and validate yaml Amazon-dash file config. The instance behaves like a dictionary
"""
then = None
templates = None
devices = None

def __init__(self, file, ignore_perms=False, **kwargs):
"""Set the config file and validate file permissions
Expand Down Expand Up @@ -230,7 +234,9 @@ def read(self):
:return: None
"""
self.then = Then(LoadComponentConfigs(self.file, section='actions'))
then = Then(LoadComponentConfigs(self.file, section='actions'))
self.templates = then.templates(LoadTemplates(self.file))
self.devices = LoadConfig(self.file, 'devices')
pass
# try:
# data = load(open(self.file), Loader)
Expand Down

0 comments on commit ebd5a21

Please sign in to comment.