-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
Description
Currently, the _discover_path function in realm.py does the following:
- checks
$PATHwithwhich, 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/xyzor/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
$PATHwithwhich, 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)