From 17c80f6bbb2085d8fbac3bde84c2816f35eddc42 Mon Sep 17 00:00:00 2001 From: Fabio Alessandro Locati Date: Mon, 5 Dec 2016 18:00:03 +0000 Subject: [PATCH] Call main in conditional way - utilities (#5827) --- lib/ansible/modules/utilities/helper/_accelerate.py | 3 ++- lib/ansible/modules/utilities/logic/async_status.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/utilities/helper/_accelerate.py b/lib/ansible/modules/utilities/helper/_accelerate.py index 3bb79122191..c00646fcd4f 100644 --- a/lib/ansible/modules/utilities/helper/_accelerate.py +++ b/lib/ansible/modules/utilities/helper/_accelerate.py @@ -738,4 +738,5 @@ def main(): # try to start up the daemon daemonize(module, password, port, timeout, minutes, ipv6, pid_file) -main() +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/utilities/logic/async_status.py b/lib/ansible/modules/utilities/logic/async_status.py index 507780b46a1..c0e2526d549 100644 --- a/lib/ansible/modules/utilities/logic/async_status.py +++ b/lib/ansible/modules/utilities/logic/async_status.py @@ -102,4 +102,6 @@ def main(): # import module snippets from ansible.module_utils.basic import * -main() + +if __name__ == '__main__': + main()