sceptre.cli package¶
sceptre.cli
This module implements Sceptre’s CLI, and should not be directly imported.
Submodules¶
sceptre.cli.create module¶
sceptre.cli.delete module¶
sceptre.cli.diff module¶
- sceptre.cli.diff.output_buffer_with_normalized_bar_lengths(buffer, output_stream)[source]¶
Takes the output from a buffer and ensures that the star and line bars are the same length across the entire buffer and that their length is the full width of longest line.
- Parameters
buffer (
StringIO
) – The input stream to normalize bar lengths foroutput_stream (
TextIO
) – The stream to output the normalized buffer into
sceptre.cli.describe module¶
sceptre.cli.execute module¶
sceptre.cli.helpers module¶
- class sceptre.cli.helpers.CfnYamlLoader(stream)[source]¶
Bases:
SafeLoader
- yaml_multi_constructors = {'!': <function _tag_constructor>}¶
- class sceptre.cli.helpers.ColouredFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]¶
Bases:
Formatter
ColouredFormatter add colours to all stack statuses that appear in log messages.
- format(record)[source]¶
Colours and returns all stack statuses in
record
.- Parameters
record (str) – The log item to format.
- Returns
str
- stack_status_colourer = <sceptre.stack_status_colourer.StackStatusColourer object>¶
- class sceptre.cli.helpers.CustomJsonEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶
Bases:
JSONEncoder
CustomJsonEncoder is a JSONEncoder which encodes all items as JSON by calling their __str__() method.
- sceptre.cli.helpers.catch_exceptions(func)[source]¶
Catches and simplifies expected errors thrown by sceptre.
catch_exceptions should be used as a decorator.
- Parameters
func – The function which may throw exceptions which should be simplified.
- Returns
The decorated function.
- sceptre.cli.helpers.setup_logging(debug, no_colour)[source]¶
Sets up logging.
By default, the python logging module is configured to push logs to stdout as long as their level is at least INFO. The log format is set to “[%(asctime)s] - %(name)s - %(message)s” and the date format is set to “%Y-%m-%d %H:%M:%S”.
After this function has run, modules should:
import logging logging.getLogger(__name__).info("my log message")
- Parameters
debug (bool) – A flag indication whether to turn on debug logging.
- No_colour
A flag to indicating whether to turn off coloured output.
- Returns
A logger.
- Return type
- sceptre.cli.helpers.setup_vars(var_file, var, merge_vars, debug, no_colour)[source]¶
Handle –var-file and –var arguments before returning data for the user_variables as required by the ConfigReader and SceptreContext.
- sceptre.cli.helpers.simplify_change_set_description(response)[source]¶
Simplies the response from the AWS describe change set API.
sceptre.cli.launch module¶
- class sceptre.cli.launch.Launcher(context, plan_factory=<class 'sceptre.plan.plan.SceptrePlan'>, pruner_factory=<class 'sceptre.cli.prune.Pruner'>)[source]¶
Bases:
object
Launcher is a utility to coordinate the flow of launching.
- Parameters
context (
SceptreContext
) – The Sceptre context to use for launchingplan_factory – A callable with the signature of (SceptreContext) -> SceptrePlan