-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Acme state fixup master #55589
Merged
Merged
Acme state fixup master #55589
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…w" parameter in "needs_renewal". Pylint-inspired layout fixes.
…ction if nothing/fetch/renew is needed to be done.
…509.read_certificate as alternative method of getting certificate information if tls.cert_info is not available.
…o using x509.read_certificates. Fixed incorrect data placement in textwrap.dedent. Updated test for acme.info to expect dict when using openssl cli.
…function docstrings.
…tools More dictupdate tools
This was removed in saltstack@ac0db89
dwoz
approved these changes
Dec 16, 2019
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
(This is #53366 rebased on master, with #52455 included because that had already been merged into develop, but not yet into master)
Edit: Expanded on the changes in this PR. Clarified the changes to behaviour in test-mode. I earlier stated that test-mode is blatantly ignored, which was incorrect.
It fixes the state acme by implementing correct handling of opts['test'] and also properly detecting if a change is needed or not. It also fixes the returned changes (i.e. no changes returned if no changes were made, and only the changed items returned when there were changes.). Also now returns expected changes in test-mode.
Fixed handling of the window-parameter in salt.modules.acme.needs_renewal and thereby removing the broad Exception catching in acme.cert.
Moved check if certificate file actually exists into salt.modules.acme.info, removing
Pylint now scores both the module and the state, as well as the unittest files with a 10 :)
What issues does this PR fix or reference?
None that I'm aware of.
Previous Behavior
acme.cert always starts salt.modules.acme.cert regardless of whether a certificate renewal is needed.
No expected changes are reported in testmode, even when this is the case.
acme.cert always returns changes, even when no changes have been made (i.e. when a certificate was not due for renewal and no renewal had been forced).
New Behavior
acme.cert does not start salt.modules.acme.cert when the certificate specified does not need renewal and no renewal has been forced. It also now properly returns actual changes instead of always dumping the entire certificate information for both the certificate prior to the call to salt.modules.acme.cert and after.
Running acme.cert with opts['test'] == True returns changes when a certificate would have been fetched or renewed.
Tests written?
Yes
Commits signed with GPG?
Yes