From 6f019c106637be9132d26468624ef0d0872b2728 Mon Sep 17 00:00:00 2001 From: Fabio Alessandro Locati Date: Mon, 5 Dec 2016 16:24:34 +0000 Subject: [PATCH] Make `main()` calls conditional - web_infrastructure (#3653) --- .../modules/extras/web_infrastructure/ejabberd_user.py | 3 ++- lib/ansible/modules/extras/web_infrastructure/jboss.py | 4 +++- lib/ansible/modules/extras/web_infrastructure/jira.py | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/extras/web_infrastructure/ejabberd_user.py b/lib/ansible/modules/extras/web_infrastructure/ejabberd_user.py index 0f47167f23..989145a36f 100644 --- a/lib/ansible/modules/extras/web_infrastructure/ejabberd_user.py +++ b/lib/ansible/modules/extras/web_infrastructure/ejabberd_user.py @@ -221,4 +221,5 @@ def main(): module.exit_json(**result) -main() +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/extras/web_infrastructure/jboss.py b/lib/ansible/modules/extras/web_infrastructure/jboss.py index 53ffcf1f84..8957f1b31d 100644 --- a/lib/ansible/modules/extras/web_infrastructure/jboss.py +++ b/lib/ansible/modules/extras/web_infrastructure/jboss.py @@ -147,4 +147,6 @@ def main(): # import module snippets from ansible.module_utils.basic import * -main() + +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/extras/web_infrastructure/jira.py b/lib/ansible/modules/extras/web_infrastructure/jira.py index 479e623b3c..e7d1e1a901 100755 --- a/lib/ansible/modules/extras/web_infrastructure/jira.py +++ b/lib/ansible/modules/extras/web_infrastructure/jira.py @@ -385,5 +385,5 @@ def main(): module.exit_json(changed=True, meta=ret) - -main() +if __name__ == '__main__': + main()