summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2012-09-25 18:07:32 -0500
committerSol Jerome <sol.jerome@gmail.com>2012-09-25 18:07:32 -0500
commit59c098f90a27b48d1bf28d60b0b24ce1ad00fd75 (patch)
tree5fa47e35fe61ce83bf908706a24ae3a1993d45aa /src/lib
parentb16405c44be8177ca21d9ea1219e51d8f352eca1 (diff)
downloadbcfg2-59c098f90a27b48d1bf28d60b0b24ce1ad00fd75.tar.gz
bcfg2-59c098f90a27b48d1bf28d60b0b24ce1ad00fd75.tar.bz2
bcfg2-59c098f90a27b48d1bf28d60b0b24ce1ad00fd75.zip
SELinux: Check for attribute explicitly
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Bcfg2/Client/Tools/SELinux.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/SELinux.py b/src/lib/Bcfg2/Client/Tools/SELinux.py
index 9dbc48b9e..77937c70c 100644
--- a/src/lib/Bcfg2/Client/Tools/SELinux.py
+++ b/src/lib/Bcfg2/Client/Tools/SELinux.py
@@ -801,12 +801,12 @@ class SELinuxModuleHandler(SELinuxEntryHandler):
def Install(self, entry, _=None):
if not self.filetool.install(self._pathentry(entry)):
return False
- try:
+ if hasattr(self, 'records'):
# if seobject has the moduleRecords attribute, install the
# module using the seobject library
self.records # pylint: disable=W0104
return self._install_seobject(entry)
- except AttributeError:
+ else:
# seobject doesn't have the moduleRecords attribute, so
# install the module using `semodule`
self.logger.debug("Installing %s using semodule" %