etcd returner in 2019.2 is busted #51345
Labels
Bug
broken, incorrect, or confusing behavior
P4
Priority 4
severity-low
4th level, cosemtic problems, work around exists
Milestone
Some time ago, it seems that some "thing" happened which resulted in the death of the etcd returner. The salt.utils.etcd module hides exceptions so that it can return
None
, which is great for runners and other stuff, but a horrible horrible anti-pattern for APIs, especially because the etcd returner depends on a proper structure (EtcdResult
) being returned. This isn't a problem for any of the other etcd modules because none of them use the EtcdResult structure since they're all just simple wrappers around reading/writing keys, and so only the returner needs it.You can see this in the following code since if
client.get
returnsNone
then it can't access the.children
propertyThen the related function in
utils/etcd_util.py
for some reason calls.read()
(which has completely different semantics than.get()
:There's a really simple fix for this since I'm assuming the author of
etcd_return.py
didn't expect the api to change out from underneath him, but who knows. Anyways, since the logic used by etcd_return.py was written for the actualpython-etcd
client one can simply look at the following code inetcd_return.py
:and then extract the actual etcd client by changing it to which results in all of those accesses to
.children
and.value
suddenly start working again.Anyways, here's the compulsory list of versions:
The text was updated successfully, but these errors were encountered: