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

added sort flag to yaml method arguments #1090

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

ror6ax
Copy link
Contributor

@ror6ax ror6ax commented Jun 28, 2018

Fixes #1089

@ror6ax
Copy link
Contributor Author

ror6ax commented Jun 28, 2018

ping @markpeek

Copy link
Member

@russellballestrini russellballestrini left a comment

Choose a reason for hiding this comment

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

Cool. So this doesn't change the default behavior (it's currently True) but it allows the end user to optionally not sort keys.

@markpeek
Copy link
Member

@ror6ax thanks...I'm traveling and will take a look over the weekend unless @phobologic gets to it before me.

def to_yaml(self, clean_up=False, long_form=False):
return cfn_flip.to_yaml(self.to_json(), clean_up=clean_up,
def to_yaml(self, clean_up=False, long_form=False, sort_keys=True):
return cfn_flip.to_yaml(self.to_json(sort_keys), clean_up=clean_up,
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this would work. Shouldn't that be a named param like this (otherwise it would match the indent param):

return cfn_flip.to_yaml(self.to_json(sort_keys=sort_keys), clean_up=clean_up,

@sumanth-lingappa
Copy link

@markpeek @russellballestrini

Why this is PR is still not incorporated?
I have this fix in my local troposphere package. I would love to see this in the official release.

@markpeek markpeek merged commit b15d523 into cloudtools:master Mar 10, 2021
@markpeek
Copy link
Member

@sumanth-lingappa thank you for highlighting. I had not seen the force push with the suggested fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a feature to have yaml output not sorted
4 participants