-
-
Notifications
You must be signed in to change notification settings - Fork 357
Service.is_valid always returns invalid because of unrelated issues #689
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
Comments
Starting with Systemd version 250 |
@coofercat: Please test this change. You can activate in in your conftest.py with
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On a system with some systemd issues, the outcome of
host.service('myservice').is_valid
is alwaysFalse
, even if my service is actually good.On further investigation the original pull request to add this #265 added a check to make sure STDOUT and STDERR were emtpy, as the call to
systemd-analyze verify %s
always returns 0. However, in come cases, STDERR can contain unrelated information which trips up the comparison.As an example, I have a deliberate typo in my service unit. The output of
systemd-analyze verify myservice.service
is as follows (all on STDERR):If I correct the typo, then the last line of this output goes away, but the others remain (actually, on my system the others seem to change every time I run the verify, but I always get at least a couple of lines out of it).
I'm not sure what's up with my system that it should do this (or why systemd would behave this way) but I'm wondering what the best solution to the testinfra problem is. I'm thinking a sort of "grep" of the output for
myservice.service
would suffice? Something like:Or in place in the function in
testinfra/modules/service.py
(also taking the opportunity to add some output to explain the reason for the failure):Happy to hear other suggestions or ideas etc :-)
The text was updated successfully, but these errors were encountered: