diff --git a/lib/ansible/modules/extras/monitoring/airbrake_deployment.py b/lib/ansible/modules/extras/monitoring/airbrake_deployment.py index 282d4c60d3..d6daec2ceb 100644 --- a/lib/ansible/modules/extras/monitoring/airbrake_deployment.py +++ b/lib/ansible/modules/extras/monitoring/airbrake_deployment.py @@ -128,5 +128,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/extras/monitoring/logentries.py b/lib/ansible/modules/extras/monitoring/logentries.py index f4e3fef329..c772b6a1cd 100644 --- a/lib/ansible/modules/extras/monitoring/logentries.py +++ b/lib/ansible/modules/extras/monitoring/logentries.py @@ -152,4 +152,5 @@ def main(): # import module snippets from ansible.module_utils.basic import * -main() +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/extras/monitoring/monit.py b/lib/ansible/modules/extras/monitoring/monit.py index eafa3e02b7..f7c46b86be 100644 --- a/lib/ansible/modules/extras/monitoring/monit.py +++ b/lib/ansible/modules/extras/monitoring/monit.py @@ -184,4 +184,5 @@ def main(): # import module snippets from ansible.module_utils.basic import * -main() +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/extras/monitoring/nagios.py b/lib/ansible/modules/extras/monitoring/nagios.py index 7de284449c..37cf4bbe40 100644 --- a/lib/ansible/modules/extras/monitoring/nagios.py +++ b/lib/ansible/modules/extras/monitoring/nagios.py @@ -1077,4 +1077,6 @@ class Nagios(object): ###################################################################### # import module snippets from ansible.module_utils.basic import * -main() + +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/extras/monitoring/newrelic_deployment.py b/lib/ansible/modules/extras/monitoring/newrelic_deployment.py index 6224fbf48d..4d47169e89 100644 --- a/lib/ansible/modules/extras/monitoring/newrelic_deployment.py +++ b/lib/ansible/modules/extras/monitoring/newrelic_deployment.py @@ -144,5 +144,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/extras/monitoring/pagerduty.py b/lib/ansible/modules/extras/monitoring/pagerduty.py index 43b2af94a1..a6d6da7d72 100644 --- a/lib/ansible/modules/extras/monitoring/pagerduty.py +++ b/lib/ansible/modules/extras/monitoring/pagerduty.py @@ -307,4 +307,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/extras/monitoring/pingdom.py b/lib/ansible/modules/extras/monitoring/pingdom.py index 77d23b53ff..e9511831aa 100644 --- a/lib/ansible/modules/extras/monitoring/pingdom.py +++ b/lib/ansible/modules/extras/monitoring/pingdom.py @@ -149,4 +149,6 @@ def main(): # import module snippets from ansible.module_utils.basic import * -main() + +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/extras/monitoring/sensu_check.py b/lib/ansible/modules/extras/monitoring/sensu_check.py index 6ded2aae8c..9acbfefa83 100644 --- a/lib/ansible/modules/extras/monitoring/sensu_check.py +++ b/lib/ansible/modules/extras/monitoring/sensu_check.py @@ -393,4 +393,6 @@ def main(): from ansible.module_utils.basic import * from ansible.module_utils.pycompat24 import get_exception -main() + +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/extras/monitoring/zabbix_group.py b/lib/ansible/modules/extras/monitoring/zabbix_group.py index ec1f65ed35..2dd8d98331 100644 --- a/lib/ansible/modules/extras/monitoring/zabbix_group.py +++ b/lib/ansible/modules/extras/monitoring/zabbix_group.py @@ -222,4 +222,6 @@ def main(): module.exit_json(changed=False) from ansible.module_utils.basic import * -main() + +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/extras/monitoring/zabbix_host.py b/lib/ansible/modules/extras/monitoring/zabbix_host.py index 34b68c78b9..611a5f9faa 100644 --- a/lib/ansible/modules/extras/monitoring/zabbix_host.py +++ b/lib/ansible/modules/extras/monitoring/zabbix_host.py @@ -574,4 +574,6 @@ def main(): host_name, ip, link_templates)) from ansible.module_utils.basic import * -main() + +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/extras/monitoring/zabbix_hostmacro.py b/lib/ansible/modules/extras/monitoring/zabbix_hostmacro.py index 7ef9755a78..39aaccce9e 100644 --- a/lib/ansible/modules/extras/monitoring/zabbix_hostmacro.py +++ b/lib/ansible/modules/extras/monitoring/zabbix_hostmacro.py @@ -237,5 +237,6 @@ def main(): host_macro_class_obj.update_host_macro(host_macro_obj, macro_name, macro_value) from ansible.module_utils.basic import * -main() +if __name__ == '__main__': + main() diff --git a/lib/ansible/modules/extras/monitoring/zabbix_maintenance.py b/lib/ansible/modules/extras/monitoring/zabbix_maintenance.py index 247b0a8e71..7fe0a49460 100644 --- a/lib/ansible/modules/extras/monitoring/zabbix_maintenance.py +++ b/lib/ansible/modules/extras/monitoring/zabbix_maintenance.py @@ -382,4 +382,6 @@ def main(): module.exit_json(changed=changed) from ansible.module_utils.basic import * -main() + +if __name__ == '__main__': + main()