diff --git a/lib/ansible/modules/cloud/openstack/os_client_config.py b/lib/ansible/modules/cloud/openstack/os_client_config.py index 252f085c53..1627bdfe32 100644 --- a/lib/ansible/modules/cloud/openstack/os_client_config.py +++ b/lib/ansible/modules/cloud/openstack/os_client_config.py @@ -71,4 +71,5 @@ def main(): # import module snippets from ansible.module_utils.basic import * -main() +if __name__ == "__main__": + main() diff --git a/lib/ansible/modules/cloud/openstack/os_image.py b/lib/ansible/modules/cloud/openstack/os_image.py index 846cfaf50b..3aa49583f1 100644 --- a/lib/ansible/modules/cloud/openstack/os_image.py +++ b/lib/ansible/modules/cloud/openstack/os_image.py @@ -188,4 +188,6 @@ def main(): # this is magic, see lib/ansible/module_common.py from ansible.module_utils.basic import * from ansible.module_utils.openstack import * -main() + +if __name__ == "__main__": + main() diff --git a/lib/ansible/modules/cloud/openstack/os_ironic.py b/lib/ansible/modules/cloud/openstack/os_ironic.py index 942f2fa0c8..9afca3b2e4 100644 --- a/lib/ansible/modules/cloud/openstack/os_ironic.py +++ b/lib/ansible/modules/cloud/openstack/os_ironic.py @@ -342,4 +342,6 @@ def main(): # this is magic, see lib/ansible/module_common.py from ansible.module_utils.basic import * from ansible.module_utils.openstack import * -main() + +if __name__ == "__main__": + main() diff --git a/lib/ansible/modules/cloud/openstack/os_ironic_node.py b/lib/ansible/modules/cloud/openstack/os_ironic_node.py index a18b992abc..d2566fcd0c 100644 --- a/lib/ansible/modules/cloud/openstack/os_ironic_node.py +++ b/lib/ansible/modules/cloud/openstack/os_ironic_node.py @@ -362,4 +362,6 @@ def main(): # this is magic, see lib/ansible/module_common.py from ansible.module_utils.basic import * from ansible.module_utils.openstack import * -main() + +if __name__ == "__main__": + main() diff --git a/lib/ansible/modules/cloud/openstack/os_object.py b/lib/ansible/modules/cloud/openstack/os_object.py index ecd7946819..87d09e73f1 100644 --- a/lib/ansible/modules/cloud/openstack/os_object.py +++ b/lib/ansible/modules/cloud/openstack/os_object.py @@ -122,4 +122,6 @@ def main(): # this is magic, see lib/ansible/module_common.py from ansible.module_utils.basic import * from ansible.module_utils.openstack import * -main() + +if __name__ == "__main__": + main() diff --git a/lib/ansible/modules/cloud/openstack/os_security_group.py b/lib/ansible/modules/cloud/openstack/os_security_group.py index e4a47c2a58..dec8a17e99 100644 --- a/lib/ansible/modules/cloud/openstack/os_security_group.py +++ b/lib/ansible/modules/cloud/openstack/os_security_group.py @@ -138,4 +138,6 @@ def main(): # this is magic, see lib/ansible/module_common.py from ansible.module_utils.basic import * from ansible.module_utils.openstack import * -main() + +if __name__ == "__main__": + main()