[Kimchi-devel] [PATCH] model.templates: setting ISO ACL in template creation

Daniel Henrique Barboza danielhb at linux.vnet.ibm.com
Wed Sep 3 20:26:23 UTC 2014


Sometimes after a deep scan the template creation fails due to
permission issues with the selected ISO. This patch sets the ACL
(if necessary) of the ISO to avoid this scenario.

Signed-off-by: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>
---
 src/kimchi/model/templates.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/kimchi/model/templates.py b/src/kimchi/model/templates.py
index 9278cdc..a792a17 100644
--- a/src/kimchi/model/templates.py
+++ b/src/kimchi/model/templates.py
@@ -27,7 +27,7 @@ from kimchi.exception import InvalidOperation, InvalidParameter
 from kimchi.exception import NotFoundError, OperationFailed
 from kimchi.kvmusertests import UserTests
 from kimchi.utils import pool_name_from_uri
-from kimchi.utils import probe_file_permission_as_user
+from kimchi.utils import probe_file_permission_as_user, run_setfacl_set_attr
 from kimchi.vmtemplate import VMTemplate
 
 
@@ -44,9 +44,7 @@ class TemplatesModel(object):
             user = UserTests().probe_user()
             ret, excp = probe_file_permission_as_user(iso, user)
             if ret is False:
-                raise InvalidParameter('KCHISO0008E',
-                                       {'filename': iso, 'user': user,
-                                        'err': excp})
+                run_setfacl_set_attr(iso)
 
         conn = self.conn.get()
         pool_uri = params.get(u'storagepool', '')
-- 
1.8.3.1




More information about the Kimchi-devel mailing list