1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #1438 from dagwieers/selinux-module-fix

Resolve traceback when python-selinux is not installed
This commit is contained in:
Michael DeHaan 2012-10-24 16:59:52 -07:00
commit 2dd6ee5f70

View file

@ -57,9 +57,9 @@ import re
try:
import selinux
HAVE_SELINUX=True
except ImportError:
HAVE_SELINUX=False
print "failed=True msg='python-selinux required for this module'"
sys.exit(1)
# getter subroutines
def get_config_state(configfile):
@ -117,8 +117,6 @@ def set_config_policy(policy, configfile):
myfile.close()
def main():
if (not HAVE_SELINUX):
module.fail_json(msg='python-selinux required for this module')
module = AnsibleModule(
argument_spec = dict(