sceptre.config package

class sceptre.config.NullHandler(level=0)[source]

Bases: logging.Handler

emit(record)[source]

Submodules

sceptre.config.graph module

sceptre.config.graph

This module implements a StackGraph, which is represented as a directed acyclic graph of a Stack’s dependencies.

class sceptre.config.graph.StackGraph(stacks)[source]

Bases: object

A Directed Acyclic Graph representing the relationship between a Stack and its dependencies. Responsible for initalising the graph based on a set of Stacks.

count_dependencies(stack)[source]

Returns the number of incoming edges a given Stack has in the StackGraph. The number of incoming edge also represents the number of Stacks that depend on the given Stack.

filtered(source_stacks, reverse=False)[source]
remove_stack(stack)[source]

Removes a Stack from the StackGraph. This operation will also remove all adjecent edges that represent a ‘depends on’ relationship with other Stacks.

sceptre.config.reader module

sceptre.config

This module implements a ConfigReader class, which is responsible for reading and constructing Stacks.

sceptre.config.reader.ConfigAttributes

alias of Attributes

class sceptre.config.reader.ConfigReader(context)[source]

Bases: object

Parses YAML configuration files and produces Stack objects.

Responsible for loading Resolvers and Hook classes and adding them as constructors to the PyYAML parser.

Parameters:context – A SceptreContext.
construct_stacks()[source]

Traverses the files under the command path. For each file encountered, a Stack is constructed using the correct config. Dependencies are traversed and a final set of Stacks is returned.

Returns:A set of Stacks.
Return type:set
read(rel_path, base_config=None)[source]

Reads in configuration from one or more YAML files within the Sceptre project folder.

Parameters:
  • rel_path (str) – Relative path to config to read.
  • base_config (dict) – Base config to provide defaults.
Returns:

Config read from config files.

Return type:

dict

sceptre.config.strategies module

sceptre.config.strategies

This module contains the implementations of the strategies used to merge config attributes.

sceptre.config.strategies.child_wins(a, b)[source]

Always returns the second parameter.

Parameters:
Returns:

b

sceptre.config.strategies.dict_merge(a, b)[source]

Takes two dictionaries and merges them.

Parameters:
  • a (dict) – A dictionary.
  • b (dict) – A dictionary.
Returns:

A merged dict.

Return type:

dict

sceptre.config.strategies.list_join(a, b)[source]

Takes two lists and joins them.

Parameters:
  • a (list) – A list.
  • b (list) – A list.
Returns:

A joined list from the two parameters.

Return type:

list