This tweaks the conditional checks in connected_to_journal() logic, in order to avoid buggy cases.
In particular, in case of errors we may have ended up comparing None values possibly coming from the two sides (env and stdout/stderr stat), thus returning a false positive to consumers.
Let's instead change the logic to be more explicit in case of real positive results, and use a single fallback for all negative cases.
I was re-reading this code for unrelated reasons, and I think I spotted a logic bug due to the use of .ok() transformers. Please double-check my current reading of it.
This tweaks the conditional checks in
connected_to_journal()
logic, in order to avoid buggy cases. In particular, in case of errors we may have ended up comparingNone
values possibly coming from the two sides (env and stdout/stderr stat), thus returning a false positive to consumers. Let's instead change the logic to be more explicit in case of real positive results, and use a single fallback for all negative cases.