[virt-manager PATCH] Add /usr/sbin to search path for non-root user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Signed-off-by: Charles Arnold <carnold@xxxxxxxx>
---
 virtManager/lib/connectauth.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/virtManager/lib/connectauth.py b/virtManager/lib/connectauth.py
index cc83e469..71e1b21f 100644
--- a/virtManager/lib/connectauth.py
+++ b/virtManager/lib/connectauth.py
@@ -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
 
-- 
2.26.2





[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux