[Kimchi-devel] [PATCH 3/5] Add functionality of report qemu owner and group
lvroyce at linux.vnet.ibm.com
lvroyce at linux.vnet.ibm.com
Tue Jun 10 10:06:16 UTC 2014
From: Royce Lv <lvroyce at linux.vnet.ibm.com>
Permission fix needs report qemu owner and grp,
add a function to report it.
Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
---
src/kimchi/utils.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/kimchi/utils.py b/src/kimchi/utils.py
index 97adbf8..eb3559e 100644
--- a/src/kimchi/utils.py
+++ b/src/kimchi/utils.py
@@ -35,6 +35,7 @@ from cherrypy.lib.reprconf import Parser
from kimchi.asynctask import AsyncTask
from kimchi.config import paths, PluginPaths
from kimchi.exception import InvalidParameter, TimeoutExpired
+from kimchi.kvmusertests import UserTests
kimchi_log = cherrypy.log.error_log
@@ -264,3 +265,10 @@ def probe_file_permission_as_user(file, user):
p.start()
p.join()
return queue.get()
+
+
+def get_qemu_owner():
+ user = UserTests.probe_user()
+ uid = pwd.getpwnam(user).pw_uid
+ gid = pwd.getpwnam(user).pw_gid
+ return uid, gid
--
1.8.3.2
More information about the Kimchi-devel
mailing list