Currently, the _discover_path function in realm.py does the following:
- checks
$PATH with which, return that if present
- if not found on
$PATH, check in the user-specified paths dict, and return that if present
- if not found in the user-specified paths dict, return some default path (
/usr/sbin/xyz or /usr/bin/xyz).
This means that system copies installed on $PATH would always be chosen over manually specified paths in the constructor. Instead, the logic should probably instead be:
- check in the user-specified paths dict, and return that if present
- if not found in the user-specified paths dict, check
$PATH with which, return that if present
- if not found on
$PATH, return some default value
This way, if a user manually specifies a path for some binary, we use that even if there's a system copy installed on $PATH (note that the default value is necessary since /usr/sbin isn't generally on $PATH for non-root users)
Currently, the
_discover_pathfunction inrealm.pydoes the following:$PATHwithwhich, return that if present$PATH, check in the user-specified paths dict, and return that if present/usr/sbin/xyzor/usr/bin/xyz).This means that system copies installed on
$PATHwould always be chosen over manually specified paths in the constructor. Instead, the logic should probably instead be:$PATHwithwhich, return that if present$PATH, return some default valueThis way, if a user manually specifies a path for some binary, we use that even if there's a system copy installed on
$PATH(note that the default value is necessary since/usr/sbinisn't generally on$PATHfor non-root users)