Don't throw exception when getting supervisord service status #2681 #2682
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2681
@phillxnet, @Hooverdan96: ready for review.
We currently throw an Exception when checking the status of a surpervisor-controlled service such as replication. This leads to an exception being thrown even when expected (service is off), which can itself interrupt other parts such as our
get_services
websocket.This pull-request adds a new arg to
superctl()
allowing for the possibility to not throw an exception. Note thatrun_command()
's default for throw isTrue
, so we respect this here.Functional testing
The Samba service was toggled ON.
Within 15 sec (websocket "refresh" interval), the status of all services was refreshed and the toggle button was re-aligned with the others, and stayed ON.
The Samba service was then toggled back OFF and the opposite was observed: button switched to OFF and was re-aligned to the other buttons within 15 secs.
Unit testing
All tests still pass. Note that this was tested on Leap 15.4 only: