Open
Description
Currently, the _discover_path
function in realm.py
does the following:
- checks
$PATH
withwhich
, 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
withwhich
, 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)