mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-09-02 01:29:36 +00:00
`patronictl edit-config` requires a pager to show the diff output back to the user. It used to be hard-coded to use either `less` or `more`. When these tools were not available in the host that would cause `patronictl` to face an exception in `ydiff` module and to show the stack trace in the console. This PR changes `patronictl edit-config` command to behave like this: - If `PAGER` environment variable is set, attempt to find the corresponding executable. - If `PAGER` is not set or is set with an invalid executable, then attempt to use either `less` or `more` as it used to do. - If no executable is find at all then throw a `PatroniCtlException` to show an user friendly message Unit tests in `tests/test_ctl.py` were modified accordingly. References: PAT-21 Close #2604