diff --git a/lib/ansible/modules/packaging/language/easy_install.py b/lib/ansible/modules/packaging/language/easy_install.py index 96d21ea8f3..31d1df9abc 100644 --- a/lib/ansible/modules/packaging/language/easy_install.py +++ b/lib/ansible/modules/packaging/language/easy_install.py @@ -204,4 +204,5 @@ def main(): # import module snippets from ansible.module_utils.basic import * -main() +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/packaging/language/gem.py b/lib/ansible/modules/packaging/language/gem.py index 188841593e..9407e9c5d4 100644 --- a/lib/ansible/modules/packaging/language/gem.py +++ b/lib/ansible/modules/packaging/language/gem.py @@ -273,4 +273,6 @@ def main(): # import module snippets from ansible.module_utils.basic import * -main() + +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/packaging/os/apt_repository.py b/lib/ansible/modules/packaging/os/apt_repository.py index fc33021e51..0b86b6bddb 100644 --- a/lib/ansible/modules/packaging/os/apt_repository.py +++ b/lib/ansible/modules/packaging/os/apt_repository.py @@ -556,4 +556,5 @@ def main(): from ansible.module_utils.basic import * from ansible.module_utils.urls import * -main() +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/packaging/os/apt_rpm.py b/lib/ansible/modules/packaging/os/apt_rpm.py index e8a702e9a0..452d2ff8ca 100755 --- a/lib/ansible/modules/packaging/os/apt_rpm.py +++ b/lib/ansible/modules/packaging/os/apt_rpm.py @@ -179,4 +179,5 @@ def main(): # this is magic, see lib/ansible/module_common.py from ansible.module_utils.basic import * -main() +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/packaging/os/redhat_subscription.py b/lib/ansible/modules/packaging/os/redhat_subscription.py index ea56ac5510..b3b0aabb35 100644 --- a/lib/ansible/modules/packaging/os/redhat_subscription.py +++ b/lib/ansible/modules/packaging/os/redhat_subscription.py @@ -552,4 +552,6 @@ def main(): # import module snippets from ansible.module_utils.basic import * -main() + +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/packaging/os/rhn_channel.py b/lib/ansible/modules/packaging/os/rhn_channel.py index 7a7735b84b..e77972b30c 100644 --- a/lib/ansible/modules/packaging/os/rhn_channel.py +++ b/lib/ansible/modules/packaging/os/rhn_channel.py @@ -171,5 +171,6 @@ def main(): # import module snippets from ansible.module_utils.basic import * -main() +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/packaging/os/rhn_register.py b/lib/ansible/modules/packaging/os/rhn_register.py index ab24878122..e7b8f6d0ae 100644 --- a/lib/ansible/modules/packaging/os/rhn_register.py +++ b/lib/ansible/modules/packaging/os/rhn_register.py @@ -422,4 +422,5 @@ def main(): module.exit_json(changed=True, msg="System successfully unregistered from %s." % rhn.hostname) -main() +if __name__ == '__main__': + main()