summaryrefslogtreecommitdiffstats
path: root/cobbler/api.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-12-10 14:52:44 -0500
committerMichael DeHaan <mdehaan@redhat.com>2008-12-10 14:52:44 -0500
commitcc6986d88cda81913ef35f70abc086872b29f449 (patch)
tree47cbaf650d6d085ccc1c4b55abc2e5569a6743ea /cobbler/api.py
parent3d15ca0edd9efda3f4807f2d5023459709686fca (diff)
downloadcobbler-cc6986d88cda81913ef35f70abc086872b29f449.tar.gz
cobbler-cc6986d88cda81913ef35f70abc086872b29f449.tar.xz
cobbler-cc6986d88cda81913ef35f70abc086872b29f449.zip
Call restorecon in lots of places if required to make sure selinux context is as expected; remove srpm target that isn't used -- just run "make" to get both rpms.
Diffstat (limited to 'cobbler/api.py')
-rw-r--r--cobbler/api.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/cobbler/api.py b/cobbler/api.py
index 229c9362..13936978 100644
--- a/cobbler/api.py
+++ b/cobbler/api.py
@@ -91,6 +91,8 @@ class BootAPI:
return
self.logger_remote = self.__setup_logger("remote")
+ self.selinux_enabled = utils.is_selinux_enabled()
+
self.acl_engine = acls.AclEngine()
BootAPI.__has_loaded = True
@@ -118,6 +120,15 @@ class BootAPI:
def __setup_logger(self,name):
return utils.setup_logger(name, **self.log_settings)
+ def is_selinux_enabled(self):
+ """
+ Returns whether selinux is enabled on the cobbler server.
+ We check this just once at cobbler API init time, because
+ a restart is required to change this; this does /not/ check
+ enforce/permissive, nor does it need to.
+ """
+ return self.selinux_enabled
+
def last_modified_time(self):
"""
Returns the time of the last modification to cobbler, made by any