sceptre/config.py
def read(self, user_variables=None):
        """
        Reads in configuration from files.

        Traverses the environment path, from top to bottom, reading in all
        relevant config files. If config items appear in files lower down the
        environment tree, they overwrite items from further up. Jinja2 is used
        to template in variables from user_variables, environment variables,
        and the segments of the environment path.

        :param user_variables: A dict of key value pairs to be supplied to \
        the config file via Jinja2 templating.
        :type user_variables: dict
        """
        path = os.path.join("config", self.environment_path)
        file_name = ".".join([self.name, "yaml"])

        self.logger.debug("Reading in '%s' files...", file_name)

        def get_config(path):
            """
            Recursively reads in config files in nested subfolders.
            """
            if not path:
                return {}
            else:
                directory_path = os.path.join(self.sceptre_dir, path)
                config = {}
                if os.path.isfile(os.path.join(directory_path, file_name)):
                    env = Environment(
                        loader=FileSystemLoader(directory_path),
                        undefined=StrictUndefined
                    )
                    template = env.get_template(file_name)
                    rendered_template = template.render(
                        environment_variable=os.environ,
                        var=user_variables,
                        environment_path=self.environment_path.split("/")
                    )

                    yaml_data = yaml.safe_load(rendered_template)
                    if yaml_data is not None:
                        config = yaml_data
                cascaded_config = get_config(os.path.dirname(path))
                cascaded_config.update(config)
                return cascaded_config

        config = get_config(path)

        self.update(config)

        self._check_version()

        self.logger.debug("Config: %s", self)

        Reads in configuration from files.

        Traverses the environment path, from top to bottom, reading in all
        relevant config files. If config items appear in files lower down the
        environment tree, they overwrite items from further up. Jinja2 is used
        to template in variables from user_variables, environment variables,
        and the segments of the environment path.

        :param user_variables: A dict of key value pairs to be supplied to \
        the config file via Jinja2 templating.
        :type user_variables: dict
        
Reads in configuration from files.
Traverses the environment path, from top to bottom, reading in all
relevant config files. If config items appear in files lower down the
environment tree, they overwrite items from further up. Jinja2 is used
to template in variables from user_variables, environment variables,
and the segments of the environment path.
Reads in configuration from files . Traverses the environment path from top to bottom reading in all relevant config files . If config items appear in files lower down the environment tree they overwrite items from further up . Jinja2 is used to template in variables from user_variables environment variables and the segments of the environment path .
def read(self, user_variables=None):
        path = os.path.join("config", self.environment_path)
        file_name = ".".join([self.name, "yaml"])
        self.logger.debug("Reading in '%s' files...", file_name)
        def get_config(path):
            if not path:
                return {}
            else:
                directory_path = os.path.join(self.sceptre_dir, path)
                config = {}
                if os.path.isfile(os.path.join(directory_path, file_name)):
                    env = Environment(
                        loader=FileSystemLoader(directory_path),
                        undefined=StrictUndefined
                    )
                    template = env.get_template(file_name)
                    rendered_template = template.render(
                        environment_variable=os.environ,
                        var=user_variables,
                        environment_path=self.environment_path.split("/")
                    )
                    yaml_data = yaml.safe_load(rendered_template)
                    if yaml_data is not None:
                        config = yaml_data
                cascaded_config = get_config(os.path.dirname(path))
                cascaded_config.update(config)
                return cascaded_config
        config = get_config(path)
        self.update(config)
        self._check_version()
        self.logger.debug("Config: %s", self)
def read ( self , user_variables = None ) : path = os . path . join ( "config" , self . environment_path ) file_name = "." . join ( [ self . name , "yaml" ] ) self . logger . debug ( "Reading in '%s' files..." , file_name ) def get_config ( path ) : """
            Recursively reads in config files in nested subfolders.
            """ if not path : return { } else : directory_path = os . path . join ( self . sceptre_dir , path ) config = { } if os . path . isfile ( os . path . join ( directory_path , file_name ) ) : env = Environment ( loader = FileSystemLoader ( directory_path ) , undefined = StrictUndefined ) template = env . get_template ( file_name ) rendered_template = template . render ( environment_variable = os . environ , var = user_variables , environment_path = self . environment_path . split ( "/" ) ) yaml_data = yaml . safe_load ( rendered_template ) if yaml_data is not None : config = yaml_data cascaded_config = get_config ( os . path . dirname ( path ) ) cascaded_config . update ( config ) return cascaded_config config = get_config ( path ) self . update ( config ) self . _check_version ( ) self . logger . debug ( "Config: %s" , self )
Reads in configuration from files.
Reads in configuration from files .
"""
        Reads in configuration from files.

        Traverses the environment path, from top to bottom, reading in all
        relevant config files. If config items appear in files lower down the
        environment tree, they overwrite items from further up. Jinja2 is used
        to template in variables from user_variables, environment variables,
        and the segments of the environment path.

        :param user_variables: A dict of key value pairs to be supplied to \
        the config file via Jinja2 templating.
        :type user_variables: dict
        """ """
            Recursively reads in config files in nested subfolders.
            """
self
user_variables
A dict of key value pairs to be supplied to \
the config file via Jinja2 templating.
A dict of key value pairs to be supplied to \ the config file via Jinja2 templating .