[master] Fixed issue with add_store and del_store - #64659
HarshalSawant1234 wants to merge 3 commits into
Conversation
|
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
Ch3LL
left a comment
There was a problem hiding this comment.
This will also require a changelog and test coverage
|
|
||
|
|
||
| def del_store(source, store, retcode=False, saltenv="base"): | ||
| def del_store(source, store, saltenv="base", retcode=False): |
There was a problem hiding this comment.
Instead of changing the position of the kwargs, can we just call the kwarg from the call in the state. I'll include example in the state module below.
| return ret | ||
|
|
||
| cert_serial = __salt__["certutil.get_cert_serial"](name) | ||
| cert_serial = __salt__["certutil.get_cert_serial"](name, saltenv) |
There was a problem hiding this comment.
| cert_serial = __salt__["certutil.get_cert_serial"](name, saltenv) | |
| cert_serial = __salt__["certutil.get_cert_serial"](name, saltenv=saltenv) |
This would also apply to the other calls below
… module State was only looking into the base saltenv for certificate file when add_store or del_store was called.
FIX: SyntaxError positional argument follows keyword argument
- Revert the parameter-order swap in win_certutil module (keep retcode before saltenv to avoid breaking callers using positional arguments) per twangboy/Ch3LL review feedback - Pass saltenv=saltenv as a keyword argument in all four state-to-module calls so non-base saltenvs are honoured during cert resolution - Fix the previously-missed get_cert_serial call in del_store (it was still hardcoded to saltenv="base") - Add regression tests verifying saltenv propagation in both add_store and del_store state functions - Add changelog fragment (64659.fixed.md)
|
Please fix this on the earliest branch where the bug exists... probably 3006.x |
Enable saltenv in add_store and del_store
What issues does this PR fix or reference?
Fixes:
Certificate not found error when running state with saltenv other than base
Previous Behavior
local:
Summary for local
Succeeded: 0
Failed: 1
Total states run: 1
Total run time: 31.246 ms
New Behavior
local:
Summary for local
Succeeded: 1 (changed=1)
Failed: 0
Total states run: 1
Total run time: 263.524 ms
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
No
Please review Salt's Contributing Guide for best practices.
See GitHub's page on GPG signing for more information about signing commits with GPG.