From 45b31fa514a96da6fcfdd73cae06322a81e7e5f4 Mon Sep 17 00:00:00 2001 From: Fabio Alessandro Locati Date: Mon, 5 Dec 2016 16:23:23 +0000 Subject: [PATCH] Make `main()` calls conditional - source_control (#3651) --- lib/ansible/modules/extras/source_control/bzr.py | 4 +++- lib/ansible/modules/extras/source_control/github_hooks.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/source_control/bzr.py b/lib/ansible/modules/extras/source_control/bzr.py index 8a75789a11e..961c715d905 100644 --- a/lib/ansible/modules/extras/source_control/bzr.py +++ b/lib/ansible/modules/extras/source_control/bzr.py @@ -199,4 +199,6 @@ def main(): # import module snippets from ansible.module_utils.basic import * -main() + +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/extras/source_control/github_hooks.py b/lib/ansible/modules/extras/source_control/github_hooks.py index eec7a6f990d..0430b44007e 100644 --- a/lib/ansible/modules/extras/source_control/github_hooks.py +++ b/lib/ansible/modules/extras/source_control/github_hooks.py @@ -201,4 +201,5 @@ def main(): from ansible.module_utils.basic import * from ansible.module_utils.urls import * -main() +if __name__ == '__main__': + main()