-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sceptre validate fails with obsolete stack config of which the template has already been deleted #1491
Comments
Much the same as with the other issue you have raised #1492, my initial feeling is that this is working by design. Since the intent and purpose of I would be happy to offer advice on what I would do instead, but firstly you might have to explain why you would delete the template in the first place? Why is marking it as obsolete not sufficient? Apologies if this is a silly question, because I don't use this obsolete feature. |
We run Sceptre provides the obsolete property by design too and works on launch without template. Is it strange that I expect it to not break the validate run of 230 stack configs? |
@mvanholsteijn I would expect that sceptre validate should ignore sceptre configs that contain |
@zaro0508 It does not appear to be a regression; I can reproduce the same behaviour using the commit where the feature was added, v3.2.0 and v3.2.2. The feature was added by @jfalkenstein and I wonder if he is around to offer any insights on whether this observed behaviour is a bug or intentional? |
I notice that this def _plan_has_obsolete_stacks(self, plan: SceptrePlan):
return len(plan.command_stacks) > 0 Perhaps with some refactoring we could move some of that to helpers and something like this could work? --- a/sceptre/cli/template.py
+++ b/sceptre/cli/template.py
@@ -11,6 +11,9 @@ from sceptre.resolvers.placeholders import use_resolver_placeholders_on_error
logger = logging.getLogger(__name__)
+def plan_has_obsolete_stacks(plan: SceptrePlan):
+ return len(plan.command_stacks) > 0
+
@click.command(name="validate", short_help="Validates the template.")
@click.option(
@@ -45,6 +48,10 @@ def validate_command(ctx, no_placeholders, path):
execution_context = (
null_context() if no_placeholders else use_resolver_placeholders_on_error()
)
+
+ if plan_has_obsolete_stacks(plan):
+ return
+
with execution_context:
responses = plan.validate() |
@mvanholsteijn What is your reason for deleting the templates after marking stacks as Again it could be my ignorance, as I have never used this feature. |
Having heard no response, closing this. I believe this is working as designed. |
Subject of the issue
When running sceptre validate, the validate will fail on an obsolete stack config of which the template has already been deleted.
Your environment
Steps to reproduce
Expected behaviour
Actual behaviour
-- sceptre validate errors with error FileNotFoundError: [Errno 2] No such file or directory:
The text was updated successfully, but these errors were encountered: