summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/SEModules.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-17 10:25:56 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-20 11:37:55 -0400
commit6a4569e4d0e59fea1e60d8ddb8805792dbecb080 (patch)
treebb7381262762063a67138f9c730d3a90dd4151ba /src/lib/Bcfg2/Server/Plugins/SEModules.py
parent630aa920687466fd845fc750f4add1359709c485 (diff)
downloadbcfg2-6a4569e4d0e59fea1e60d8ddb8805792dbecb080.tar.gz
bcfg2-6a4569e4d0e59fea1e60d8ddb8805792dbecb080.tar.bz2
bcfg2-6a4569e4d0e59fea1e60d8ddb8805792dbecb080.zip
better SEModules docs
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/SEModules.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/SEModules.py34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/SEModules.py b/src/lib/Bcfg2/Server/Plugins/SEModules.py
index 8a70434e8..b04e2d359 100644
--- a/src/lib/Bcfg2/Server/Plugins/SEModules.py
+++ b/src/lib/Bcfg2/Server/Plugins/SEModules.py
@@ -1,3 +1,14 @@
+"""
+The SEModules plugin handles SELinux module entries. It supports
+group- and host-specific module versions, and enabling/disabling
+modules.
+
+You can use ``tools/selinux_baseline.py`` to create a baseline of all
+of your installed modules.
+
+See :ref:`server-selinux` for more information.
+"""
+
import os
import logging
import Bcfg2.Server.Plugin
@@ -7,17 +18,35 @@ logger = logging.getLogger(__name__)
class SEModuleData(Bcfg2.Server.Plugin.SpecificData):
+ """ Representation of a single SELinux module file. Encodes the
+ data using base64 automatically """
+
def bind_entry(self, entry, _):
+ """ Return a fully-bound entry. The module data is
+ automatically encoded with base64.
+
+ :param entry: The abstract entry to bind the module for
+ :type entry: lxml.etree._Element
+ :returns: lxml.etree._Element - the fully bound entry
+ """
entry.set('encoding', 'base64')
entry.text = b64encode(self.data)
+ return entry
class SEModules(Bcfg2.Server.Plugin.GroupSpool):
""" Handle SELinux 'module' entries """
- name = 'SEModules'
__author__ = 'chris.a.st.pierre@gmail.com'
+
+ #: SEModules is a :class:`Bcfg2.Server.Plugin.helpers.GroupSpool`
+ #: that uses :class:`Bcfg2.Server.Plugins.SEModules.SEModuleData`
+ #: objects as its EntrySet children.
es_child_cls = SEModuleData
+
+ #: SEModules manages ``SELinux`` entries
entry_type = 'SELinux'
+
+ #: The SEModules plugin is experimental
experimental = True
def _get_module_filename(self, entry):
@@ -46,13 +75,16 @@ class SEModules(Bcfg2.Server.Plugin.GroupSpool):
return self._get_module_filename(entry) in self.Entries[entry.tag]
return Bcfg2.Server.Plugin.GroupSpool.HandlesEntry(self, entry,
metadata)
+ HandlesEntry.__doc__ = Bcfg2.Server.Plugin.GroupSpool.HandlesEntry.__doc__
def HandleEntry(self, entry, metadata):
entry.set("name", self._get_module_name(entry))
bind = self.Entries[entry.tag][self._get_module_filename(entry)]
return bind(entry, metadata)
+ HandleEntry.__doc__ = Bcfg2.Server.Plugin.GroupSpool.HandleEntry.__doc__
def add_entry(self, event):
self.filename_pattern = \
os.path.basename(os.path.dirname(self.event_path(event)))
Bcfg2.Server.Plugin.GroupSpool.add_entry(self, event)
+ add_entry.__doc__ = Bcfg2.Server.Plugin.GroupSpool.add_entry.__doc__