-
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 2018.3 #54006
Closed
github-abcde
wants to merge
12
commits into
saltstack:2018.3
from
basisbeeld:acme_state_fixup-2018.3
Closed
Acme state fixup 2018.3 #54006
github-abcde
wants to merge
12
commits into
saltstack:2018.3
from
basisbeeld:acme_state_fixup-2018.3
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.
…ng of merge conflict).
…function docstrings.
…tools More dictupdate tools
Closing this in favor of #55589 |
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?
(2018.3 version of #53366)
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 insalt.modules.acme.needs_renewal
and thereby removing the broadException
catching inacme.cert
.Moved check if certificate file actually exists into
salt.modules.acme.info
, removingPylint 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 startssalt.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 startsalt.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 tosalt.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