From e9c9d8f523dd44413a8fa0723f4a7646ca57d445 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 11 Aug 2012 12:38:05 -0400 Subject: [PATCH] tweak config mode check to just have a default --- library/setup | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/library/setup b/library/setup index b8ed8b4bec..a20bbc662c 100755 --- a/library/setup +++ b/library/setup @@ -130,18 +130,15 @@ class Facts(object): self.facts['selinux']['policyvers'] = 'unknown' try: (rc, configmode) = selinux.selinux_getenforcemode() - if rc == 0 and configmode in Facts.SELINUX_MODE_DICT: - self.facts['selinux']['config_mode'] = Facts.SELINUX_MODE_DICT[configmode] + if rc == 0: + self.facts['selinux']['config_mode'] = Facts.SELINUX_MODE_DICT.get(configmode, 'unknown') else: self.facts['selinux']['config_mode'] = 'unknown' except OSError, e: self.facts['selinux']['config_mode'] = 'unknown' try: mode = selinux.security_getenforce() - if mode in Facts.SELINUX_MODE_DICT: - self.facts['selinux']['mode'] = Facts.SELINUX_MODE_DICT[mode] - else: - self.facts['selinux']['mode'] = 'unknown' + self.facts['selinux']['mode'] = Facts.SELINUX_MODE_DICT.get(mode, 'unknown') except OSError, e: self.facts['selinux']['mode'] = 'unknown' try: