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

[et-mgmt-tools] fix scratchdir for non-root users



Hi,
When running as non root we don't have write access to /var/lib/libvirt.
Please apply if you see fit,
 -- Guido
# HG changeset patch
# User Guido Guenther <agx sigxcpu org>
# Date 1222081624 -7200
# Node ID 96686d6e460a7763ef431362f45a0a28e66edf22
# Parent  f87154697807fc9002dc7aef786b8e4aa44e8c47
set a proper scratchdir for non root users

diff -r f87154697807 -r 96686d6e460a virtinst/Guest.py
--- a/virtinst/Guest.py	Thu Sep 18 16:44:30 2008 -0400
+++ b/virtinst/Guest.py	Mon Sep 22 13:07:04 2008 +0200
@@ -323,7 +323,10 @@
         if self.type == "xen":
             if os.path.exists("/var/lib/xen"):
                 return "/var/lib/xen"
-        return "/var/lib/libvirt/boot"
+	if os.getuid() == 0:
+            return "/var/lib/libvirt/boot"
+	else:
+	    return os.path.expanduser("~/.libvirt/boot")
     scratchdir = property(get_scratchdir)
 
     def get_cdrom(self):

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