Add /usr/sbin to search path for non-root user

On a fresh install where no previous connection has been made a
non-root user starting virt-manager won't find the installed libvirtd
because the location is not in the user path.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Charles Arnold <carnold@suse.com>
This commit is contained in:
Charles Arnold
2020-10-23 15:20:33 -06:00
committed by Cole Robinson
parent 7cb6a6062a
commit 9dc057e3e7

View File

@@ -204,7 +204,8 @@ def connect_error(conn, errmsg, tb, warnconsole):
##################################
def setup_first_uri(config, tryuri):
libvirtd_installed = bool(shutil.which("libvirtd"))
# Add /usr/sbin to the path in case non-root user launches virt-manager
libvirtd_installed = bool(shutil.which("libvirtd", path=os.environ['PATH'] + os.pathsep + "/usr/sbin"))
if config.CLITestOptions.fake_no_libvirtd:
libvirtd_installed = False