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

--write: Do not rewrite zero 0 as octal 00 #2092

Merged
merged 4 commits into from May 3, 2022

Conversation

ziegenberg
Copy link
Contributor

@ziegenberg ziegenberg commented May 1, 2022

As ruamel.yaml only preserves the octal format for YAML 1.2, the effort was made to do the same for YAML 1.1 in ansible-linter, as ruamel.yaml converts the octal to an int. While the code was partially copied from ruamel.yaml, the check for an actual zero got lost, resulting in the behaviour seen in #2071.

Fixes: #2071

Regression tests for issue number ansible#2071.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
@ziegenberg ziegenberg requested review from a team as code owners May 1, 2022 21:33
Fixes: ansible#2071

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
Copy link
Member

@cognifloyd cognifloyd left a comment

Choose a reason for hiding this comment

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

Thank you for looking into this! Looks like a great fix.

@cognifloyd cognifloyd enabled auto-merge (squash) May 2, 2022 21:15
@cognifloyd cognifloyd added the bug label May 2, 2022
@cognifloyd cognifloyd disabled auto-merge May 2, 2022 21:15
@cognifloyd cognifloyd changed the title Do not rewrite zero as octal --write: Do not rewrite zero 0 as octal 00 May 2, 2022
@cognifloyd cognifloyd enabled auto-merge (squash) May 2, 2022 21:16
@cognifloyd cognifloyd merged commit c36e3ff into ansible:main May 3, 2022
@ziegenberg ziegenberg deleted the fix-2071 branch May 3, 2022 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Write mode rewrites 'poll: 0' as 'poll: 00' in iptables_state
2 participants