summaryrefslogtreecommitdiffstats
path: root/base/server/python/pki/server/deployment/pkihelper.py
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2015-08-16 19:00:00 +0200
committerChristian Heimes <cheimes@redhat.com>2015-08-17 21:14:11 +0200
commit1c7a2735c82d6af1a871efd2c01f942387821a1f (patch)
tree7ee5cf9691095baf6f2b57623f3745c4bc30981f /base/server/python/pki/server/deployment/pkihelper.py
parent724351e7e02d7d15b18d4262b778ebae72040afe (diff)
downloadpki-1c7a2735c82d6af1a871efd2c01f942387821a1f.tar.gz
pki-1c7a2735c82d6af1a871efd2c01f942387821a1f.tar.xz
pki-1c7a2735c82d6af1a871efd2c01f942387821a1f.zip
policycoreutils-python3 lacks sepolgen on Fedora 22
Fedora 22's Python bindings for SELinux lacks sepolgen. The seobject package is available for Python 3 but can't be imported because it depends on sepolgen. The workaround makes it possible to test the Python 3 port on Fedora 22. It can be removed later once Fedora 23 is out.
Diffstat (limited to 'base/server/python/pki/server/deployment/pkihelper.py')
-rw-r--r--base/server/python/pki/server/deployment/pkihelper.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/base/server/python/pki/server/deployment/pkihelper.py b/base/server/python/pki/server/deployment/pkihelper.py
index efe85c85d..821739bc5 100644
--- a/base/server/python/pki/server/deployment/pkihelper.py
+++ b/base/server/python/pki/server/deployment/pkihelper.py
@@ -43,8 +43,16 @@ import xml.etree.ElementTree as ET
from lxml import etree
import zipfile
import selinux
+
+seobject = None
if selinux.is_selinux_enabled():
- import seobject
+ try:
+ import seobject
+ except ImportError:
+ # TODO: Fedora 22 has an incomplete Python 3 package
+ # sepolgen is missing.
+ if sys.version_info.major == 2:
+ raise
# PKI Deployment Imports
@@ -856,7 +864,7 @@ class ConfigurationFile:
if len(ports) == 0:
return
- if not bool(selinux.is_selinux_enabled()):
+ if not selinux.is_selinux_enabled() or seobject is None:
config.pki_log.error(
log.PKIHELPER_SELINUX_DISABLED,
extra=config.PKI_INDENTATION_LEVEL_2)