From a05838f23cb61bb4677f97da25eae08b5d0739b2 Mon Sep 17 00:00:00 2001 From: Aaron Gorka Date: Wed, 3 Feb 2021 14:47:55 +1100 Subject: [PATCH 1/2] Fix crash when diffing a stack that has unquoted date strings Same as https://github.com/cloudtools/stacker/pull/591 --- stacker/providers/aws/default.py | 2 +- stacker/tests/fixtures/cfn_template.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stacker/providers/aws/default.py b/stacker/providers/aws/default.py index c45f46119..41b3f561a 100644 --- a/stacker/providers/aws/default.py +++ b/stacker/providers/aws/default.py @@ -1136,7 +1136,7 @@ def get_stack_info(self, stack): if isinstance(template, str): # handle yaml templates template = parse_cloudformation_template(template) - return [json.dumps(template), parameters] + return [json.dumps(template, default=str), parameters] def get_stack_changes(self, stack, template, parameters, tags, **kwargs): diff --git a/stacker/tests/fixtures/cfn_template.yaml b/stacker/tests/fixtures/cfn_template.yaml index 41826a17f..dc16edd7d 100644 --- a/stacker/tests/fixtures/cfn_template.yaml +++ b/stacker/tests/fixtures/cfn_template.yaml @@ -1,4 +1,4 @@ -AWSTemplateFormatVersion: "2010-09-09" +AWSTemplateFormatVersion: 2010-09-09 Description: TestTemplate Parameters: Param1: From 149b24b10aab33a7a35d892352eb1e382537590e Mon Sep 17 00:00:00 2001 From: Aaron Gorka Date: Wed, 3 Feb 2021 14:51:27 +1100 Subject: [PATCH 2/2] Update CHANGELOG.md with date string crash fix --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f0aaacec..54a28de5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## Upcoming release +- Fix crash on `stacker diff` when comparing a template with unquoted date strings ## 1.7.2 (2020-11-09) - address breaking moto change to awslambda [GH-763]