-
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
The etcd returner is using the wrong API due to a refactor of salt.utils.etcd_util. #51363
Conversation
I gave some hella love to etcd_return with these commits. |
24ba636
to
5e65a18
Compare
PR #51346 which adds |
77fadef
to
6e2b52a
Compare
And rebased + force pushed. Let's see how this turns out... |
fda4e7b
to
bb5ac24
Compare
Grr...first force-push was re-based against develop instead of origin/develop... |
Okay. Good to go and ready for a reviewer. |
@arizvisa I think we need to deprecate the ttl option: https://docs.saltstack.com/en/latest/topics/development/deprecations.html |
@dwoz, sure. What's the process for this? Literally test for the ttl parameter and call |
@dwoz, does it make sense to call |
Umm...yeah. Any word on my questions on how to best warn about this? Does it really make sense to warn everytime a returner sends something back to the master? |
I'd like to get this PR merged instead of having to maintain it because this is something that you guys claim to support, but the returner doesn't even work at all(?). |
Actually better yet, I can avoid deprecating A number of returners do not do this (as it doesn't seem to be documented, since returners are "easy to write"). However, the mysql returner (which seems to be the only one with unit-testing) seems to do this explicitly. Although the existence of the So wrt the In summary, |
Or another place to use it would be in the implementation of I think the best bet is a combination of these two usage-scenarios with |
…rners.etcd_return module.
…dule when logging that a req job needs to have it's load saved.
… job id is passed to a function.
…rom the salt.returners.etcd_return module.
…tself due to a variable rename.
…d for a logging formatspec in the salt.returners.etcd_return module.
…e_load when the new data is the same as the old one as it results in a fake warning (since no data is lost).
…salt.returners.etcd_return to do a proper deep-comparision instead of a simple string-comparison.
…to explicitly handle the 'req' jid and generate a new one.
….returners.etcd_return module is purging events.
3c64409
to
13966b6
Compare
force pushed due to rebase. |
Ok. I've been using this returner for quite a bit now and I haven't had any problems with it. This also fixes issue #51809 for the etcd returner although I really believe that this 'req' hack really needs to be looked into because it leads to being unable to locate the job id for minion-initiated jobs. |
(Btw, y'all might want to squash-merge this, unless you want to retain all the dev history that was done on this module.) |
This windows test is failing due to the signal module not supporting posix signals which seems like a test issue. any word? |
Hey, is there any word on this? Do you need me to rebase it again? |
Wrt to your review suggestion to deprecate the ttl. The ttl is actively used in the PR so it wouldn't make sense to get rid of it. |
Wow. Thanks you! |
@waynew, do you want me to port this to master for you guys real quick? |
For the record, PR #55186 ports this PR to master and fixes a logging issue when enabling debug logging. So reference that one if you want to untag this, or clear it out of project 6, "PRs to port to master". |
What does this PR do?
The
salt.returners.etcd
module expects everything returned from the etcd client to be theEtcdResult
type which is the native type from the "python-etcd" module. Thesalt.utils.etcd_util
actually hides this interface in order to capture exceptions and convertEtcdResult
types into results that make sense to salt's interface.This PR fixes this issue by modify the
_get_conn()
function to return the actual "python-etcd" client which is what the original implementation ofsalt.returners.etcd
was developed around.What issues does this PR fix or reference?
This closes issue #51345.
Previous Behavior
The previous behaviour resulted in the module not working because the
EtcdResult
properties such as.children
and.value
were being masked away by try-excepts from the salt.utils.etcd_util module. This resulted in many parts of this returner failing due to the client returning a different type than expected.New Behavior
Now that this module is using the correct api that returns an
EtcdResult
, the module works as originally intended.Commits signed with GPG?
Nope.