From 59c098f90a27b48d1bf28d60b0b24ce1ad00fd75 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Tue, 25 Sep 2012 18:07:32 -0500 Subject: SELinux: Check for attribute explicitly Signed-off-by: Sol Jerome --- src/lib/Bcfg2/Client/Tools/SELinux.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/Bcfg2/Client/Tools') 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" % -- cgit v1.2.3-1-g7c22