Skip to content
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

Template: add_description -> set_description (stratosphere 3.x). #999

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion zappa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2414,7 +2414,7 @@ def create_stack_template(

# build a fresh template
self.cf_template = troposphere.Template()
self.cf_template.add_description("Automatically generated with Zappa")
self.cf_template.set_description("Automatically generated with Zappa")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also need to update the requirements to force usage of the new troposphere?
If someone is using troposphere==2.7.0, will this still work?

Copy link

@Quidge Quidge Jul 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree that this would break if this PR ran on a deploy that used troposphere==2.7.0. The core issue imo is that troposphere isn't pinned to a version yet Zappa is relying on a version specific api from troposphere. If Zappa had pinned troposphere to 2x initially there wouldn't be a breakage issue.

@povesma would you add a change to the requirements.txt that pins the version of troposphere to a 3x major version?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we want to keep backwards compatibility why not do something like:

if hasattr(self.cf_template, 'add_description'):
    add_description
elif hasattr(self.cf_template, 'set_description'):
    set_description

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above backwards compatibility change is not needed for troposphere v2.7.x as the change (from v2.4.2 2019-02-02) included both methods (with a deprecation warning on the set_* variant). Of course, the reason for v3.0.0 was to deprecate Python 2.x support and only support Python 3+ in case that factors into zappa's Python version support.

self.cf_api_resources = []
self.cf_parameters = {}

Expand Down