[PATCH] update policy file location

Guido Günther agx at sigxcpu.org
Wed Dec 31 12:32:31 UTC 2008


Closes: #510235
---
 src/virtManager/connection.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/virtManager/connection.py b/src/virtManager/connection.py
index e3fe863..0ac7d66 100644
--- a/src/virtManager/connection.py
+++ b/src/virtManager/connection.py
@@ -37,7 +37,10 @@ from virtManager.domain import vmmDomain
 from virtManager.network import vmmNetwork
 from virtManager.netdev import vmmNetDevice
 
-LIBVIRT_POLICY_FILE = "/usr/share/PolicyKit/policy/libvirtd.policy"
+LIBVIRT_POLICY_FILES = [
+    "/usr/share/PolicyKit/policy/libvirtd.policy",
+    "/usr/share/PolicyKit/policy/org.libvirt.unix.policy"
+]
 
 def get_local_hostname():
     try:
@@ -125,7 +128,12 @@ class vmmConnection(gobject.GObject):
 
         self.readOnly = readOnly
         if not self.is_remote() and os.getuid() != 0 and self.uri != "qemu:///session":
-            if not os.path.exists(LIBVIRT_POLICY_FILE):
+            hasPolkit = False
+            for f in LIBVIRT_POLICY_FILES:
+                if os.path.exists(f):
+                    hasPolkit = True
+
+            if not hasPolkit:
                 self.readOnly = True
 
         self.state = self.STATE_DISCONNECTED
-- 
1.6.0.3


--PNTmBPCT7hxwcZjr--





More information about the Pkg-libvirt-maintainers mailing list