cobbler/koan_no_selinux_set.patch

38 lines
1.8 KiB
Diff

diff -ru cobbler-2.0.7.orig/koan/app.py cobbler-2.0.7/koan/app.py
--- cobbler-2.0.7.orig/koan/app.py 2013-04-10 10:51:54.775900810 +0200
+++ cobbler-2.0.7/koan/app.py 2013-04-10 10:52:36.816981814 +0200
@@ -1491,32 +1491,8 @@
if lv_create != 0:
raise InfoException, "LVM creation failed"
- # partition location
- partition_location = "/dev/%s/%s" % (location,name)
-
- # check whether we have SELinux enabled system
- args = "/usr/sbin/selinuxenabled"
- selinuxenabled = sub_process.call(args)
- if selinuxenabled == 0:
- # required context type
- context_type = "virt_image_t"
-
- # change security context type to required one
- args = "/usr/bin/chcon -t %s %s" % (context_type, partition_location)
- print "%s" % args
- change_context = sub_process.call(args, close_fds=True, shell=True)
-
- # modify SELinux policy in order to preserve security context
- # between reboots
- args = "/usr/sbin/semanage fcontext -a -t %s %s" % (context_type, partition_location)
- print "%s" % args
- change_context |= sub_process.call(args, close_fds=True, shell=True)
-
- if change_context != 0:
- raise InfoException, "SELinux security context setting to LVM partition failed"
-
# return partition location
- return partition_location
+ return "/dev/%s/%s" % (location,name)
else:
raise InfoException, "volume group needs %s GB free space." % virt_size