From 8591819640280b09bce5d3f7187edf8d3cb2f1ec Mon Sep 17 00:00:00 2001 From: Khai Do Date: Mon, 10 Feb 2020 13:12:31 -0800 Subject: [PATCH] [Resolves #874] Allow generate command to run hooks This enables `before_generate` and `after_generate` hook actions to allow users to execute hooks when running the `generate` command. --- docs/_source/docs/hooks.rst | 2 ++ sceptre/plan/actions.py | 1 + 2 files changed, 3 insertions(+) diff --git a/docs/_source/docs/hooks.rst b/docs/_source/docs/hooks.rst index 69ad48f17..3d6e59252 100644 --- a/docs/_source/docs/hooks.rst +++ b/docs/_source/docs/hooks.rst @@ -12,6 +12,8 @@ If required, users can create their own ``hooks``, as described in the section Hook points ----------- +``before_generate`` or ``after_generate`` - run hook before or after generating stack template. + ``before_create`` or ``after_create`` - run hook before or after Stack creation. ``before_update`` or ``after_update`` - run hook before or after Stack update. diff --git a/sceptre/plan/actions.py b/sceptre/plan/actions.py index fcd02cda9..9d19dca43 100644 --- a/sceptre/plan/actions.py +++ b/sceptre/plan/actions.py @@ -573,6 +573,7 @@ def list_change_sets(self): except botocore.exceptions.ClientError: return [] + @add_stack_hooks def generate(self): """ Returns the Template for the Stack