-
Notifications
You must be signed in to change notification settings - Fork 416
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
Ignore missing servers or snippets when removing from map #275
Ignore missing servers or snippets when removing from map #275
Conversation
18f5f42
to
f37a854
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anderbubble good catch.
If possible, mind you do a few more changes that are relevant?
- Add a similar fix in the snippets.sls file
- Delete this line, this block and these lines so we have a test for this fix.
- Amend the commit message to something like
fix(config): ignore missing servers or snippets
so our automated versioning does not complain (check here for more details)
With these other minor changes, we'll have testing in place for the issue and it will be OK to be merged
@anderbubble ping? |
I'm here; just busy. I expect I can perform the additional changes you suggested; it just might take me a bit to get to it. edit: I've put it on my agenda for Friday. |
@anderbubble wonderful! I'll wait for your changes to merge this. |
Updated this PR to complete the above steps requested by @javierbertoli. Includes resolving this review comment: |
nginx.servers_config wants a lightened copy of the nginx map to render as json; but, when it was trying to remove the servers and snippets keys from the map it assumed their presence, causing a KeyError if they were not present by its use of .pop(). While wrapping these in an "if" clause would likely be more correct, along with replacing .pop() with del (if jinja even supports that) the simplest change here is to just specify a default value for .pop(), which obviates the KeyError. Fixes saltstack-formulas#274
Fix failure highlighted on OpenSUSE Tumbleweed, where the `cmd.run` runs before the `pkg.installed`: * https://gitlab.com/saltstack-formulas/nginx-formula/-/jobs/1345325819#L2830
Thanks you @anderbubble & @myii for this! |
🎉 This PR is included in version 2.7.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
nginx.servers_config wants a lightened copy of the nginx map
to render as json; but, when it was trying to remove the
servers and snippets keys from the map it assumed their presence,
causing a KeyError if they were not present by its use of .pop().
While wrapping these in an "if" clause would likely be more
correct, along with replacing .pop() with del (if jinja even
supports that) the simplest change here is to just specify a
default value for .pop(), which obviates the KeyError.
Fixes #274
PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[build]
Changes related to the build system[chore]
Changes to the build process or auxiliary tools and libraries such as documentation generation[ci]
Changes to the continuous integration configuration[feat]
A new feature[fix]
A bug fix[perf]
A code change that improves performance[refactor]
A code change that neither fixes a bug nor adds a feature[revert]
A change used to revert a previous commit[style]
Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)Secondary type
[docs]
Documentation changes[test]
Adding missing or correcting existing testsDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
Describe the changes you're proposing
Pillar / config required to test the proposed changes
Debug log showing how the proposed changes work
Documentation checklist
README
(e.g.Available states
).pillar.example
.Testing checklist
state_top
).Additional context