Skip to content

Commit

Permalink
Fix for issue #8 for minions that do not have selinux installed
Browse files Browse the repository at this point in the history
  • Loading branch information
neilmunday committed Dec 21, 2018
1 parent e094d2c commit 37cbbe6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions srv/salt/_modules/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ def audit(force=False):
for p in __AUDIT_GRAINS:
properties[p] = grains[p]

properties['selinux_enabled'] = grains['selinux']['enabled']
properties['selinux_enforced'] = grains['selinux']['enforced']
if 'selinux_enabled' in properties and 'selinux_enforced' in properties:
properties['selinux_enabled'] = grains['selinux']['enabled']
properties['selinux_enforced'] = grains['selinux']['enforced'].encode()
else:
properties['selinux_enabled'] = False
properties['selinux_enforced'] = 'Disabled'

properties['pkgs'] = __salt__['pkg.list_pkgs'](versions_as_list=True)

Expand Down

0 comments on commit 37cbbe6

Please sign in to comment.