Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve traceback when python-selinux is not installed #1438

Merged
merged 1 commit into from
Oct 24, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions library/selinux
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down