summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Client
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-14 15:55:28 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-14 15:55:28 -0400
commite22f8fd49026ab4d162b835fdf80609949039bcb (patch)
tree5c68a6a76e22492a4c6c70e99d15f1dd1f14d17a /src/lib/Bcfg2/Client
parent62cf189b1caf948cd01220edf59e991c7290e54e (diff)
downloadbcfg2-e22f8fd49026ab4d162b835fdf80609949039bcb.tar.gz
bcfg2-e22f8fd49026ab4d162b835fdf80609949039bcb.tar.bz2
bcfg2-e22f8fd49026ab4d162b835fdf80609949039bcb.zip
SEModules: fixed some bits of module handling
Diffstat (limited to 'src/lib/Bcfg2/Client')
-rw-r--r--src/lib/Bcfg2/Client/Tools/SELinux.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/SELinux.py b/src/lib/Bcfg2/Client/Tools/SELinux.py
index 018a7eae4..f060a1374 100644
--- a/src/lib/Bcfg2/Client/Tools/SELinux.py
+++ b/src/lib/Bcfg2/Client/Tools/SELinux.py
@@ -703,8 +703,14 @@ class SELinuxModuleHandler(SELinuxEntryHandler):
return rv
def _filepath(self, entry):
- return os.path.join("/usr/share/selinux", self.setype,
- "%s.pp" % entry.get("name"))
+ path = os.path.join("/usr/share/selinux", self.setype,
+ entry.get("name").lstrip("/"))
+ if not path.endswith(".pp"):
+ # the entry name we get from the SEModules plugin should
+ # always have .pp on the end, but we double check just to
+ # make absolutely certain
+ path = path + ".pp"
+ return path
def _pathentry(self, entry):
pathentry = copy.deepcopy(entry)
@@ -744,7 +750,7 @@ class SELinuxModuleHandler(SELinuxEntryHandler):
def _install_seobject(self, entry):
try:
if not SELinuxEntryHandler.Install(self, entry):
- return false
+ return False
except NameError:
# some versions of selinux have a bug in seobject that
# makes modify() calls fail. add() seems to have the same
@@ -765,7 +771,7 @@ class SELinuxModuleHandler(SELinuxEntryHandler):
try:
proc = Popen(['semodule', '-i', self._filepath(entry)],
stdout=PIPE, stderr=PIPE)
- out, err = proc.communicate()
+ err = proc.communicate()[1]
rv = proc.wait()
except OSError:
err = sys.exc_info()[1]