On 29/11/2024 18.31, Daniel P. Berrangé wrote:
Put the 'which' function into shared code.
Signed-off-by: Daniel P. Berrangé <[email protected]>
---
tests/functional/qemu_test/__init__.py | 2 +-
tests/functional/qemu_test/cmd.py | 10 ++++++++++
tests/functional/test_acpi_bits.py | 13 +------------
tests/functional/test_ppc64_hv.py | 13 +------------
4 files changed, 13 insertions(+), 25 deletions(-)
None of the callers really seem to be interested in the location of the
command, only whether it is available in the $PATH or not ... so could we
maybe rather drop this function and use the has_cmd() function everywhere
instead?
Hmm, thinking about it twice - has_cmd() uses the "which" program
internally, but AFAIK this program is optional in Linux installations
nowadays ... so maybe it's still a good idea to move our Python which() to
cmd.py, but has_cmd() should maybe rather be changed to use it, too?
Thomas