From b954917761eba2ddcdc8cf9dc811d668f7728eff Mon Sep 17 00:00:00 2001 From: Joren Vrancken Date: Sun, 29 Jul 2018 13:46:06 +0200 Subject: [PATCH] Surround top-level function and class definitions with two blank lines. --- contrib/inventory/apache-libcloud.py | 1 + contrib/inventory/apstra_aos.py | 1 + contrib/inventory/cloudforms.py | 1 + contrib/inventory/cobbler.py | 1 + contrib/inventory/consul_io.py | 1 + contrib/inventory/docker.py | 1 + contrib/inventory/foreman.py | 1 + contrib/inventory/gce.py | 1 + contrib/inventory/lxc_inventory.py | 1 + contrib/inventory/mdt_dynamic_inventory.py | 1 + contrib/inventory/nagios_livestatus.py | 1 + contrib/inventory/nagios_ndo.py | 1 + contrib/inventory/nsot.py | 1 + contrib/inventory/ovirt.py | 1 + contrib/inventory/ovirt4.py | 1 + contrib/inventory/rax.py | 2 +- contrib/inventory/rudder.py | 1 + contrib/inventory/softlayer.py | 1 + contrib/inventory/vbox.py | 1 + contrib/inventory/zabbix.py | 1 + examples/scripts/uptime.py | 1 + hacking/get_library.py | 1 + lib/ansible/compat/selectors/_selectors2.py | 2 ++ lib/ansible/module_utils/database.py | 1 + lib/ansible/module_utils/k8s/common.py | 1 + lib/ansible/module_utils/network/aci/aci.py | 1 + lib/ansible/module_utils/network/cnos/cnos_devicerules.py | 1 + lib/ansible/module_utils/pycompat24.py | 1 + lib/ansible/module_utils/six/__init__.py | 2 ++ lib/ansible/module_utils/urls.py | 1 + .../modules/cloud/amazon/aws_elasticbeanstalk_app.py | 1 + lib/ansible/modules/cloud/amazon/aws_glue_connection.py | 1 + lib/ansible/modules/cloud/amazon/aws_glue_job.py | 1 + lib/ansible/modules/cloud/amazon/aws_s3_cors.py | 1 + lib/ansible/modules/cloud/amazon/ec2_vpc_vpn.py | 1 + lib/ansible/modules/cloud/amazon/elasticache.py | 1 + .../modules/cloud/amazon/elasticache_parameter_group.py | 1 + lib/ansible/modules/cloud/amazon/elb_application_lb.py | 1 + lib/ansible/modules/cloud/amazon/elb_network_lb.py | 1 + lib/ansible/modules/cloud/amazon/elb_target.py | 1 + lib/ansible/modules/cloud/amazon/route53_health_check.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_availabilityset.py | 1 + .../modules/cloud/azure/azure_rm_availabilityset_facts.py | 1 + .../modules/cloud/azure/azure_rm_containerinstance.py | 1 + .../modules/cloud/azure/azure_rm_containerregistry.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset.py | 1 + .../modules/cloud/azure/azure_rm_dnsrecordset_facts.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_dnszone.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_dnszone_facts.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_functionapp.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_image.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_keyvault.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_keyvaultkey.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_keyvaultsecret.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_loadbalancer.py | 1 + .../modules/cloud/azure/azure_rm_loadbalancer_facts.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_managed_disk.py | 1 + .../modules/cloud/azure/azure_rm_managed_disk_facts.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_mysqldatabase.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_mysqlserver.py | 1 + .../modules/cloud/azure/azure_rm_networkinterface_facts.py | 1 + .../modules/cloud/azure/azure_rm_postgresqldatabase.py | 1 + .../modules/cloud/azure/azure_rm_postgresqlserver.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_publicipaddress.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_resourcegroup.py | 1 + .../modules/cloud/azure/azure_rm_resourcegroup_facts.py | 1 + .../modules/cloud/azure/azure_rm_securitygroup_facts.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_sqldatabase.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_sqlserver.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_sqlserver_facts.py | 2 ++ lib/ansible/modules/cloud/azure/azure_rm_storageaccount.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_storageblob.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_subnet.py | 1 + .../cloud/azure/azure_rm_virtualmachine_extension.py | 1 + .../modules/cloud/azure/azure_rm_virtualmachine_scaleset.py | 1 + .../cloud/azure/azure_rm_virtualmachine_scaleset_facts.py | 1 + .../cloud/azure/azure_rm_virtualmachineimage_facts.py | 1 + lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork.py | 1 + .../modules/cloud/azure/azure_rm_virtualnetwork_facts.py | 1 + .../modules/cloud/dimensiondata/dimensiondata_network.py | 1 + lib/ansible/modules/cloud/google/gcp_compute_address.py | 1 + .../modules/cloud/google/gcp_compute_backend_bucket.py | 1 + .../modules/cloud/google/gcp_compute_backend_service.py | 1 + lib/ansible/modules/cloud/google/gcp_compute_disk.py | 1 + lib/ansible/modules/cloud/google/gcp_compute_firewall.py | 1 + .../modules/cloud/google/gcp_compute_forwarding_rule.py | 1 + .../modules/cloud/google/gcp_compute_global_address.py | 1 + .../cloud/google/gcp_compute_global_forwarding_rule.py | 1 + .../modules/cloud/google/gcp_compute_health_check.py | 1 + .../modules/cloud/google/gcp_compute_http_health_check.py | 1 + .../modules/cloud/google/gcp_compute_https_health_check.py | 1 + lib/ansible/modules/cloud/google/gcp_compute_image.py | 1 + lib/ansible/modules/cloud/google/gcp_compute_instance.py | 1 + .../modules/cloud/google/gcp_compute_instance_group.py | 1 + .../cloud/google/gcp_compute_instance_group_manager.py | 1 + .../modules/cloud/google/gcp_compute_instance_template.py | 1 + lib/ansible/modules/cloud/google/gcp_compute_network.py | 1 + lib/ansible/modules/cloud/google/gcp_compute_route.py | 1 + .../modules/cloud/google/gcp_compute_ssl_certificate.py | 1 + lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py | 1 + .../modules/cloud/google/gcp_compute_target_http_proxy.py | 1 + .../modules/cloud/google/gcp_compute_target_https_proxy.py | 1 + lib/ansible/modules/cloud/google/gcp_compute_target_pool.py | 1 + .../modules/cloud/google/gcp_compute_target_ssl_proxy.py | 1 + .../modules/cloud/google/gcp_compute_target_tcp_proxy.py | 1 + lib/ansible/modules/cloud/google/gcp_compute_url_map.py | 1 + lib/ansible/modules/cloud/google/gcp_container_cluster.py | 1 + lib/ansible/modules/cloud/google/gcp_container_node_pool.py | 1 + lib/ansible/modules/cloud/google/gcp_dns_managed_zone.py | 1 + .../modules/cloud/google/gcp_dns_resource_record_set.py | 1 + lib/ansible/modules/cloud/google/gcp_pubsub_subscription.py | 1 + lib/ansible/modules/cloud/google/gcp_pubsub_topic.py | 1 + lib/ansible/modules/cloud/google/gcp_storage_bucket.py | 1 + .../cloud/google/gcp_storage_bucket_access_control.py | 1 + lib/ansible/modules/cloud/google/gcpubsub.py | 1 + lib/ansible/modules/cloud/opennebula/one_image_facts.py | 1 + lib/ansible/modules/cloud/opennebula/one_vm.py | 2 ++ lib/ansible/modules/cloud/ovirt/ovirt_nics.py | 1 + lib/ansible/modules/cloud/ovirt/ovirt_vmpools_facts.py | 1 + lib/ansible/modules/cloud/packet/packet_device.py | 1 + lib/ansible/modules/cloud/smartos/smartos_image_facts.py | 1 + .../modules/cloud/vmware/vmware_guest_boot_manager.py | 1 + lib/ansible/modules/cloud/vmware/vmware_local_user_facts.py | 1 + lib/ansible/modules/clustering/etcd3.py | 1 + lib/ansible/modules/database/postgresql/postgresql_db.py | 1 + .../modules/database/proxysql/proxysql_backend_servers.py | 1 + .../modules/database/proxysql/proxysql_global_variables.py | 1 + .../modules/database/proxysql/proxysql_manage_config.py | 1 + .../modules/database/proxysql/proxysql_mysql_users.py | 1 + .../modules/database/proxysql/proxysql_query_rules.py | 1 + .../database/proxysql/proxysql_replication_hostgroups.py | 1 + lib/ansible/modules/database/proxysql/proxysql_scheduler.py | 1 + lib/ansible/modules/files/assemble.py | 1 + lib/ansible/modules/files/ini_file.py | 1 + lib/ansible/modules/identity/ipa/ipa_service.py | 1 + lib/ansible/modules/identity/ipa/ipa_sudocmdgroup.py | 1 + lib/ansible/modules/identity/keycloak/keycloak_client.py | 1 + .../modules/identity/keycloak/keycloak_clienttemplate.py | 1 + lib/ansible/modules/identity/opendj/opendj_backendprop.py | 1 + lib/ansible/modules/messaging/rabbitmq_exchange.py | 1 + lib/ansible/modules/messaging/rabbitmq_parameter.py | 1 + lib/ansible/modules/messaging/rabbitmq_policy.py | 1 + lib/ansible/modules/messaging/rabbitmq_queue.py | 1 + lib/ansible/modules/messaging/rabbitmq_user.py | 1 + lib/ansible/modules/messaging/rabbitmq_vhost.py | 1 + lib/ansible/modules/monitoring/grafana_dashboard.py | 1 + lib/ansible/modules/monitoring/grafana_datasource.py | 1 + lib/ansible/modules/monitoring/grafana_plugin.py | 1 + lib/ansible/modules/monitoring/sensu_client.py | 1 + lib/ansible/modules/monitoring/sensu_handler.py | 1 + lib/ansible/modules/monitoring/zabbix/zabbix_group_facts.py | 1 + lib/ansible/modules/monitoring/zabbix/zabbix_host_facts.py | 1 + lib/ansible/modules/network/a10/a10_service_group.py | 1 + lib/ansible/modules/network/aci/aci_aep.py | 1 + lib/ansible/modules/network/aci/aci_contract_subject.py | 1 + lib/ansible/modules/network/aos/_aos_asn_pool.py | 1 + lib/ansible/modules/network/aos/_aos_device.py | 1 + lib/ansible/modules/network/aos/_aos_external_router.py | 1 + lib/ansible/modules/network/aos/_aos_ip_pool.py | 1 + lib/ansible/modules/network/aos/_aos_logical_device.py | 1 + lib/ansible/modules/network/aos/_aos_logical_device_map.py | 1 + lib/ansible/modules/network/aos/_aos_login.py | 1 + lib/ansible/modules/network/aos/_aos_rack_type.py | 1 + lib/ansible/modules/network/aos/_aos_template.py | 1 + lib/ansible/modules/network/avi/avi_actiongroupconfig.py | 1 + lib/ansible/modules/network/avi/avi_alertconfig.py | 1 + lib/ansible/modules/network/avi/avi_alertemailconfig.py | 1 + lib/ansible/modules/network/avi/avi_alertscriptconfig.py | 1 + lib/ansible/modules/network/avi/avi_alertsyslogconfig.py | 1 + lib/ansible/modules/network/avi/avi_analyticsprofile.py | 1 + lib/ansible/modules/network/avi/avi_api_version.py | 1 + .../network/avi/avi_applicationpersistenceprofile.py | 1 + lib/ansible/modules/network/avi/avi_applicationprofile.py | 1 + lib/ansible/modules/network/avi/avi_authprofile.py | 1 + .../modules/network/avi/avi_autoscalelaunchconfig.py | 1 + lib/ansible/modules/network/avi/avi_backup.py | 1 + lib/ansible/modules/network/avi/avi_backupconfiguration.py | 1 + .../modules/network/avi/avi_certificatemanagementprofile.py | 1 + lib/ansible/modules/network/avi/avi_cloud.py | 1 + lib/ansible/modules/network/avi/avi_cloudconnectoruser.py | 1 + lib/ansible/modules/network/avi/avi_cloudproperties.py | 1 + lib/ansible/modules/network/avi/avi_cluster.py | 1 + lib/ansible/modules/network/avi/avi_clusterclouddetails.py | 1 + lib/ansible/modules/network/avi/avi_controllerproperties.py | 1 + lib/ansible/modules/network/avi/avi_customipamdnsprofile.py | 1 + lib/ansible/modules/network/avi/avi_dnspolicy.py | 1 + lib/ansible/modules/network/avi/avi_errorpagebody.py | 1 + lib/ansible/modules/network/avi/avi_errorpageprofile.py | 1 + lib/ansible/modules/network/avi/avi_gslb.py | 1 + .../network/avi/avi_gslbapplicationpersistenceprofile.py | 1 + lib/ansible/modules/network/avi/avi_gslbgeodbprofile.py | 1 + lib/ansible/modules/network/avi/avi_gslbhealthmonitor.py | 1 + lib/ansible/modules/network/avi/avi_gslbservice.py | 1 + .../modules/network/avi/avi_hardwaresecuritymodulegroup.py | 1 + lib/ansible/modules/network/avi/avi_healthmonitor.py | 1 + lib/ansible/modules/network/avi/avi_httppolicyset.py | 1 + lib/ansible/modules/network/avi/avi_ipaddrgroup.py | 1 + .../modules/network/avi/avi_ipamdnsproviderprofile.py | 1 + lib/ansible/modules/network/avi/avi_l4policyset.py | 1 + lib/ansible/modules/network/avi/avi_microservicegroup.py | 1 + lib/ansible/modules/network/avi/avi_network.py | 1 + lib/ansible/modules/network/avi/avi_networkprofile.py | 1 + .../modules/network/avi/avi_networksecuritypolicy.py | 1 + lib/ansible/modules/network/avi/avi_pkiprofile.py | 1 + lib/ansible/modules/network/avi/avi_pool.py | 1 + lib/ansible/modules/network/avi/avi_poolgroup.py | 1 + .../modules/network/avi/avi_poolgroupdeploymentpolicy.py | 1 + lib/ansible/modules/network/avi/avi_prioritylabels.py | 1 + lib/ansible/modules/network/avi/avi_role.py | 1 + lib/ansible/modules/network/avi/avi_scheduler.py | 1 + lib/ansible/modules/network/avi/avi_seproperties.py | 1 + .../modules/network/avi/avi_serverautoscalepolicy.py | 1 + lib/ansible/modules/network/avi/avi_serviceengine.py | 1 + lib/ansible/modules/network/avi/avi_serviceenginegroup.py | 1 + lib/ansible/modules/network/avi/avi_snmptrapprofile.py | 1 + lib/ansible/modules/network/avi/avi_sslkeyandcertificate.py | 1 + lib/ansible/modules/network/avi/avi_sslprofile.py | 1 + lib/ansible/modules/network/avi/avi_stringgroup.py | 1 + lib/ansible/modules/network/avi/avi_systemconfiguration.py | 1 + lib/ansible/modules/network/avi/avi_tenant.py | 1 + lib/ansible/modules/network/avi/avi_trafficcloneprofile.py | 1 + lib/ansible/modules/network/avi/avi_useraccountprofile.py | 1 + lib/ansible/modules/network/avi/avi_virtualservice.py | 1 + lib/ansible/modules/network/avi/avi_vrfcontext.py | 1 + lib/ansible/modules/network/avi/avi_vsdatascriptset.py | 1 + lib/ansible/modules/network/avi/avi_vsvip.py | 1 + lib/ansible/modules/network/avi/avi_wafpolicy.py | 1 + lib/ansible/modules/network/avi/avi_wafprofile.py | 1 + lib/ansible/modules/network/avi/avi_webhook.py | 1 + lib/ansible/modules/network/bigswitch/bigmon_policy.py | 1 + lib/ansible/modules/network/cloudengine/ce_vrf_interface.py | 1 + .../modules/network/cnos/cnos_conditional_command.py | 1 + .../modules/network/cnos/cnos_conditional_template.py | 1 + lib/ansible/modules/network/cnos/cnos_factory.py | 1 + lib/ansible/modules/network/cnos/cnos_facts.py | 1 + lib/ansible/modules/network/cnos/cnos_image.py | 1 + lib/ansible/modules/network/cnos/cnos_portchannel.py | 1 + lib/ansible/modules/network/cnos/cnos_reload.py | 1 + lib/ansible/modules/network/cnos/cnos_rollback.py | 1 + lib/ansible/modules/network/cnos/cnos_save.py | 1 + lib/ansible/modules/network/cnos/cnos_showrun.py | 1 + lib/ansible/modules/network/cnos/cnos_template.py | 1 + lib/ansible/modules/network/cnos/cnos_vlan.py | 1 + lib/ansible/modules/network/dellos9/dellos9_config.py | 1 + lib/ansible/modules/network/enos/enos_facts.py | 1 + lib/ansible/modules/network/eos/eos_banner.py | 1 + lib/ansible/modules/network/eos/eos_linkagg.py | 1 + lib/ansible/modules/network/eos/eos_lldp.py | 1 + lib/ansible/modules/network/eos/eos_static_route.py | 1 + lib/ansible/modules/network/eos/eos_system.py | 1 + lib/ansible/modules/network/eos/eos_user.py | 1 + lib/ansible/modules/network/f5/bigip_asm_policy.py | 1 + lib/ansible/modules/network/f5/bigip_gtm_server.py | 1 + lib/ansible/modules/network/ios/ios_banner.py | 1 + lib/ansible/modules/network/ios/ios_config.py | 1 + lib/ansible/modules/network/ios/ios_interface.py | 1 + lib/ansible/modules/network/ios/ios_linkagg.py | 1 + lib/ansible/modules/network/ios/ios_system.py | 1 + lib/ansible/modules/network/ios/ios_user.py | 1 + lib/ansible/modules/network/iosxr/iosxr_command.py | 1 + lib/ansible/modules/network/iosxr/iosxr_logging.py | 1 + lib/ansible/modules/network/iosxr/iosxr_user.py | 1 + lib/ansible/modules/network/junos/junos_banner.py | 1 + lib/ansible/modules/network/junos/junos_command.py | 1 + lib/ansible/modules/network/junos/junos_interface.py | 1 + lib/ansible/modules/network/junos/junos_l3_interface.py | 1 + lib/ansible/modules/network/junos/junos_linkagg.py | 1 + lib/ansible/modules/network/junos/junos_lldp_interface.py | 1 + lib/ansible/modules/network/junos/junos_logging.py | 1 + lib/ansible/modules/network/junos/junos_static_route.py | 1 + lib/ansible/modules/network/junos/junos_system.py | 1 + lib/ansible/modules/network/junos/junos_user.py | 1 + lib/ansible/modules/network/junos/junos_vlan.py | 1 + lib/ansible/modules/network/junos/junos_vrf.py | 1 + lib/ansible/modules/network/netconf/netconf_get.py | 1 + lib/ansible/modules/network/netconf/netconf_rpc.py | 1 + lib/ansible/modules/network/netvisor/pn_cluster.py | 5 +++-- lib/ansible/modules/network/netvisor/pn_ospf.py | 6 ++++-- lib/ansible/modules/network/netvisor/pn_ospfarea.py | 5 +++-- lib/ansible/modules/network/netvisor/pn_show.py | 5 +++-- lib/ansible/modules/network/netvisor/pn_trunk.py | 5 +++-- lib/ansible/modules/network/netvisor/pn_vlag.py | 5 +++-- lib/ansible/modules/network/netvisor/pn_vlan.py | 5 +++-- lib/ansible/modules/network/netvisor/pn_vrouter.py | 5 +++-- lib/ansible/modules/network/netvisor/pn_vrouterbgp.py | 6 ++++-- lib/ansible/modules/network/netvisor/pn_vrouterif.py | 6 ++++-- lib/ansible/modules/network/netvisor/pn_vrouterlbif.py | 5 +++-- lib/ansible/modules/network/nxos/nxos_file_copy.py | 1 + lib/ansible/modules/network/nxos/nxos_igmp_snooping.py | 1 + lib/ansible/modules/network/nxos/nxos_l3_interface.py | 1 + lib/ansible/modules/network/nxos/nxos_linkagg.py | 1 + lib/ansible/modules/network/nxos/nxos_ntp_auth.py | 1 + lib/ansible/modules/network/nxos/nxos_nxapi.py | 1 + lib/ansible/modules/network/nxos/nxos_reboot.py | 1 + lib/ansible/modules/network/nxos/nxos_snapshot.py | 1 + lib/ansible/modules/network/nxos/nxos_static_route.py | 1 + lib/ansible/modules/network/nxos/nxos_system.py | 1 + lib/ansible/modules/network/nxos/nxos_user.py | 1 + lib/ansible/modules/network/ordnance/ordnance_facts.py | 1 + lib/ansible/modules/network/panos/panos_admin.py | 1 + lib/ansible/modules/network/panos/panos_admpwd.py | 1 + lib/ansible/modules/network/panos/panos_check.py | 1 + lib/ansible/modules/network/panos/panos_commit.py | 1 + lib/ansible/modules/network/panos/panos_dag.py | 1 + lib/ansible/modules/network/panos/panos_lic.py | 1 + lib/ansible/modules/network/radware/vdirect_commit.py | 1 + lib/ansible/modules/network/radware/vdirect_file.py | 1 + lib/ansible/modules/network/radware/vdirect_runnable.py | 1 + lib/ansible/modules/network/slxos/slxos_vlan.py | 1 + lib/ansible/modules/network/vyos/vyos_banner.py | 1 + lib/ansible/modules/network/vyos/vyos_interface.py | 1 + lib/ansible/modules/network/vyos/vyos_l3_interface.py | 1 + lib/ansible/modules/network/vyos/vyos_linkagg.py | 1 + lib/ansible/modules/network/vyos/vyos_lldp.py | 1 + lib/ansible/modules/network/vyos/vyos_lldp_interface.py | 1 + lib/ansible/modules/network/vyos/vyos_logging.py | 1 + lib/ansible/modules/network/vyos/vyos_static_route.py | 1 + lib/ansible/modules/network/vyos/vyos_user.py | 1 + lib/ansible/modules/notification/snow_record.py | 1 + lib/ansible/modules/notification/syslogger.py | 1 + lib/ansible/modules/packaging/language/maven_artifact.py | 1 + lib/ansible/modules/packaging/os/apt_rpm.py | 1 + lib/ansible/modules/packaging/os/openbsd_pkg.py | 1 + lib/ansible/modules/packaging/os/zypper.py | 6 ++++-- lib/ansible/modules/remote_management/hpilo/hpilo_facts.py | 1 + lib/ansible/modules/remote_management/imc/imc_rest.py | 1 + lib/ansible/modules/remote_management/ipmi/ipmi_boot.py | 1 + lib/ansible/modules/remote_management/ipmi/ipmi_power.py | 1 + .../modules/remote_management/redfish/redfish_facts.py | 1 + lib/ansible/modules/source_control/gitlab_deploy_key.py | 1 + lib/ansible/modules/source_control/gitlab_hooks.py | 1 + lib/ansible/modules/storage/netapp/na_cdot_license.py | 1 + lib/ansible/modules/storage/netapp/na_cdot_svm.py | 1 + lib/ansible/modules/storage/netapp/na_cdot_user.py | 1 + lib/ansible/modules/storage/netapp/na_cdot_user_role.py | 1 + lib/ansible/modules/storage/netapp/na_cdot_volume.py | 1 + .../modules/storage/netapp/na_ontap_broadcast_domain.py | 1 + lib/ansible/modules/storage/netapp/sf_account_manager.py | 1 + lib/ansible/modules/storage/netapp/sf_check_connections.py | 1 + .../modules/storage/netapp/sf_snapshot_schedule_manager.py | 1 + .../storage/netapp/sf_volume_access_group_manager.py | 1 + lib/ansible/modules/storage/purestorage/purefa_ds.py | 1 + lib/ansible/modules/storage/purestorage/purefa_facts.py | 1 + lib/ansible/modules/storage/purestorage/purefa_hg.py | 1 + lib/ansible/modules/system/aix_inittab.py | 1 + lib/ansible/modules/system/alternatives.py | 1 + lib/ansible/modules/system/awall.py | 2 +- lib/ansible/modules/system/dconf.py | 1 + lib/ansible/modules/system/nosh.py | 1 + lib/ansible/modules/system/pamd.py | 1 + lib/ansible/modules/system/vdo.py | 1 + lib/ansible/modules/web_infrastructure/apache2_mod_proxy.py | 1 + lib/ansible/modules/web_infrastructure/apache2_module.py | 6 ++++-- lib/ansible/modules/web_infrastructure/gunicorn.py | 1 + lib/ansible/modules/web_infrastructure/jboss.py | 1 + lib/ansible/modules/web_infrastructure/jira.py | 1 + .../modules/web_infrastructure/rundeck_acl_policy.py | 1 + lib/ansible/modules/web_infrastructure/supervisorctl.py | 1 + lib/ansible/parsing/yaml/dumper.py | 1 + lib/ansible/plugins/callback/dense.py | 1 + lib/ansible/plugins/filter/ipaddr.py | 1 + lib/ansible/plugins/inventory/scaleway.py | 1 + lib/ansible/utils/hashing.py | 1 + packaging/release/versionhelper/version_helper.py | 1 + test/integration/targets/async/library/async_test.py | 1 + test/integration/targets/async_fail/library/async_test.py | 1 + .../targets/var_precedence/ansible-var-precedence-check.py | 1 + test/legacy/cleanup_gce.py | 1 + test/units/module_utils/network/aci/test_aci.py | 1 + test/units/module_utils/network/common/test_parsing.py | 1 + test/units/modules/network/nxos/nxos_module.py | 1 + test/units/plugins/connection/test_connection.py | 1 + test/units/plugins/connection/test_netconf.py | 1 + 373 files changed, 408 insertions(+), 28 deletions(-) diff --git a/contrib/inventory/apache-libcloud.py b/contrib/inventory/apache-libcloud.py index 7d6bba2515f..067076fdf54 100755 --- a/contrib/inventory/apache-libcloud.py +++ b/contrib/inventory/apache-libcloud.py @@ -344,5 +344,6 @@ class LibcloudInventory(object): def main(): LibcloudInventory() + if __name__ == '__main__': main() diff --git a/contrib/inventory/apstra_aos.py b/contrib/inventory/apstra_aos.py index 2ffd3290f06..c793f29aad9 100755 --- a/contrib/inventory/apstra_aos.py +++ b/contrib/inventory/apstra_aos.py @@ -583,6 +583,7 @@ class AosInventory(object): for key, value in device.value['status'].items(): self.add_var_to_host(device.name, key, value) + # Run the script if __name__ == '__main__': AosInventory() diff --git a/contrib/inventory/cloudforms.py b/contrib/inventory/cloudforms.py index c6702dcce10..64c300cab82 100755 --- a/contrib/inventory/cloudforms.py +++ b/contrib/inventory/cloudforms.py @@ -482,4 +482,5 @@ class CloudFormsInventory(object): else: return json.dumps(data) + CloudFormsInventory() diff --git a/contrib/inventory/cobbler.py b/contrib/inventory/cobbler.py index 2762041dc9d..87e855faa54 100755 --- a/contrib/inventory/cobbler.py +++ b/contrib/inventory/cobbler.py @@ -312,4 +312,5 @@ class CobblerInventory(object): else: return json.dumps(data) + CobblerInventory() diff --git a/contrib/inventory/consul_io.py b/contrib/inventory/consul_io.py index b7197291fdb..57bad6f9341 100755 --- a/contrib/inventory/consul_io.py +++ b/contrib/inventory/consul_io.py @@ -528,4 +528,5 @@ class ConsulConfig(dict): token = 'anonymous' return consul.Consul(host=host, port=port, token=token, scheme=scheme) + ConsulInventory() diff --git a/contrib/inventory/docker.py b/contrib/inventory/docker.py index 9a41ebe3d41..9e344828b36 100755 --- a/contrib/inventory/docker.py +++ b/contrib/inventory/docker.py @@ -889,4 +889,5 @@ def main(): DockerInventory().run() + main() diff --git a/contrib/inventory/foreman.py b/contrib/inventory/foreman.py index fe82c059bd0..99200168f67 100755 --- a/contrib/inventory/foreman.py +++ b/contrib/inventory/foreman.py @@ -436,5 +436,6 @@ class ForemanInventory(object): self._print_data() return True + if __name__ == '__main__': sys.exit(not ForemanInventory().run()) diff --git a/contrib/inventory/gce.py b/contrib/inventory/gce.py index e72f343e36f..5c5773e0aaa 100755 --- a/contrib/inventory/gce.py +++ b/contrib/inventory/gce.py @@ -534,6 +534,7 @@ class GceInventory(object): else: return json.dumps(data) + # Run the script if __name__ == '__main__': GceInventory() diff --git a/contrib/inventory/lxc_inventory.py b/contrib/inventory/lxc_inventory.py index c026c20009e..86a6b22c2d7 100755 --- a/contrib/inventory/lxc_inventory.py +++ b/contrib/inventory/lxc_inventory.py @@ -65,5 +65,6 @@ def main(argv): else: print("Need an argument, either --list or --host ", file=sys.stderr) + if __name__ == '__main__': main(sys.argv) diff --git a/contrib/inventory/mdt_dynamic_inventory.py b/contrib/inventory/mdt_dynamic_inventory.py index 958414f3729..947091079ae 100755 --- a/contrib/inventory/mdt_dynamic_inventory.py +++ b/contrib/inventory/mdt_dynamic_inventory.py @@ -129,6 +129,7 @@ class MDTInventory(object): parser.add_argument('--host', action='store', help='Get all the variables about a specific instance') self.args = parser.parse_args() + if __name__ == "__main__": # Run the script MDTInventory() diff --git a/contrib/inventory/nagios_livestatus.py b/contrib/inventory/nagios_livestatus.py index 91c72dac606..8f428000d8a 100755 --- a/contrib/inventory/nagios_livestatus.py +++ b/contrib/inventory/nagios_livestatus.py @@ -173,4 +173,5 @@ class NagiosLivestatusInventory(object): else: sys.exit("usage: --list or --host HOSTNAME [--pretty]") + NagiosLivestatusInventory() diff --git a/contrib/inventory/nagios_ndo.py b/contrib/inventory/nagios_ndo.py index e5377119c79..a4477e1e263 100755 --- a/contrib/inventory/nagios_ndo.py +++ b/contrib/inventory/nagios_ndo.py @@ -105,4 +105,5 @@ class NagiosNDOInventory(object): else: sys.exit("Error: Database configuration is missing. See nagios_ndo.ini.") + NagiosNDOInventory() diff --git a/contrib/inventory/nsot.py b/contrib/inventory/nsot.py index 1c4b474362e..d7fca297bac 100755 --- a/contrib/inventory/nsot.py +++ b/contrib/inventory/nsot.py @@ -339,5 +339,6 @@ def main(): elif args.host: print(client.do_host(args.host)) + if __name__ == '__main__': main() diff --git a/contrib/inventory/ovirt.py b/contrib/inventory/ovirt.py index 6ea355198c2..9ac85aae794 100755 --- a/contrib/inventory/ovirt.py +++ b/contrib/inventory/ovirt.py @@ -288,5 +288,6 @@ class OVirtInventory(object): else: return json.dumps(data) + # Run the script OVirtInventory() diff --git a/contrib/inventory/ovirt4.py b/contrib/inventory/ovirt4.py index cf2f7ad3c98..33fb5b3a8a2 100755 --- a/contrib/inventory/ovirt4.py +++ b/contrib/inventory/ovirt4.py @@ -258,5 +258,6 @@ def main(): ) ) + if __name__ == '__main__': main() diff --git a/contrib/inventory/rax.py b/contrib/inventory/rax.py index 0d0c7b63fd0..1e66d28b145 100755 --- a/contrib/inventory/rax.py +++ b/contrib/inventory/rax.py @@ -185,7 +185,6 @@ def load_config_file(): return None else: return p -p = load_config_file() def rax_slugify(value): @@ -469,5 +468,6 @@ def main(): sys.exit(0) +p = load_config_file() if __name__ == '__main__': main() diff --git a/contrib/inventory/rudder.py b/contrib/inventory/rudder.py index 30cab1a21d6..4e2a1191529 100755 --- a/contrib/inventory/rudder.py +++ b/contrib/inventory/rudder.py @@ -294,5 +294,6 @@ class RudderInventory(object): return re.sub(r'[^A-Za-z0-9\_]', '_', word) + # Run the script RudderInventory() diff --git a/contrib/inventory/softlayer.py b/contrib/inventory/softlayer.py index bddb0db6f93..d53b6fa26dc 100755 --- a/contrib/inventory/softlayer.py +++ b/contrib/inventory/softlayer.py @@ -198,4 +198,5 @@ class SoftLayerInventory(object): self.get_virtual_servers() self.get_physical_servers() + SoftLayerInventory() diff --git a/contrib/inventory/vbox.py b/contrib/inventory/vbox.py index 6326dad3fe4..61ecf2826af 100755 --- a/contrib/inventory/vbox.py +++ b/contrib/inventory/vbox.py @@ -30,6 +30,7 @@ class SetEncoder(json.JSONEncoder): return list(obj) return json.JSONEncoder.default(self, obj) + VBOX = "VBoxManage" diff --git a/contrib/inventory/zabbix.py b/contrib/inventory/zabbix.py index 48b3017194c..0f57bff14f2 100755 --- a/contrib/inventory/zabbix.py +++ b/contrib/inventory/zabbix.py @@ -152,4 +152,5 @@ class ZabbixInventory(object): print("Error: Configuration of server and credentials are required. See zabbix.ini.", file=sys.stderr) sys.exit(1) + ZabbixInventory() diff --git a/examples/scripts/uptime.py b/examples/scripts/uptime.py index 4d3d96c32f6..deef4481b28 100755 --- a/examples/scripts/uptime.py +++ b/examples/scripts/uptime.py @@ -92,5 +92,6 @@ def main(): for host, result in callback.host_unreachable.items(): print('{0} >>> {1}'.format(host, result._result['msg'])) + if __name__ == '__main__': main() diff --git a/hacking/get_library.py b/hacking/get_library.py index 121e2dc2e97..ea5d44bf3d0 100755 --- a/hacking/get_library.py +++ b/hacking/get_library.py @@ -26,5 +26,6 @@ def main(): print(C.DEFAULT_MODULE_PATH) return 0 + if __name__ == '__main__': sys.exit(main()) diff --git a/lib/ansible/compat/selectors/_selectors2.py b/lib/ansible/compat/selectors/_selectors2.py index a97b59e6630..c4c81d76d4c 100644 --- a/lib/ansible/compat/selectors/_selectors2.py +++ b/lib/ansible/compat/selectors/_selectors2.py @@ -77,6 +77,7 @@ def _fileobj_to_fd(fileobj): raise ValueError("Invalid file descriptor: {0}".format(fd)) return fd + # Python 3.5 uses a more direct route to wrap system calls to increase speed. if sys.version_info >= (3, 5): def _syscall_wrapper(func, _, *args, **kwargs): @@ -305,6 +306,7 @@ class BaseSelector(object): def __exit__(self, *args): self.close() + # Almost all platforms have select.select() if hasattr(select, "select"): class SelectSelector(BaseSelector): diff --git a/lib/ansible/module_utils/database.py b/lib/ansible/module_utils/database.py index 701c8bdc0b5..83f28c0e3a5 100644 --- a/lib/ansible/module_utils/database.py +++ b/lib/ansible/module_utils/database.py @@ -34,6 +34,7 @@ class SQLParseError(Exception): class UnclosedQuoteError(SQLParseError): pass + # maps a type of identifier to the maximum number of dot levels that are # allowed to specify that identifier. For example, a database column can be # specified by up to 4 levels: database.schema.table.column diff --git a/lib/ansible/module_utils/k8s/common.py b/lib/ansible/module_utils/k8s/common.py index 300b55d0a82..edb8fa3aab4 100644 --- a/lib/ansible/module_utils/k8s/common.py +++ b/lib/ansible/module_utils/k8s/common.py @@ -61,6 +61,7 @@ def list_dict_str(value): return value raise TypeError + ARG_ATTRIBUTES_BLACKLIST = ('property_path',) COMMON_ARG_SPEC = { diff --git a/lib/ansible/module_utils/network/aci/aci.py b/lib/ansible/module_utils/network/aci/aci.py index e6aeebef519..2a0608b2ef5 100644 --- a/lib/ansible/module_utils/network/aci/aci.py +++ b/lib/ansible/module_utils/network/aci/aci.py @@ -77,6 +77,7 @@ def aci_argument_spec(): validate_certs=dict(type='bool', default=True), ) + ''' URL_MAPPING = dict( action_rule=dict(aci_class='rtctrlAttrP', mo='attr-', key='name'), diff --git a/lib/ansible/module_utils/network/cnos/cnos_devicerules.py b/lib/ansible/module_utils/network/cnos/cnos_devicerules.py index 732394eaa61..c7636f5647e 100644 --- a/lib/ansible/module_utils/network/cnos/cnos_devicerules.py +++ b/lib/ansible/module_utils/network/cnos/cnos_devicerules.py @@ -81,6 +81,7 @@ def getRuleString(deviceType, variableId): return retVal # EOM + default_cnos = { 'vlan_id': 'INTEGER_VALUE:1-3999', 'vlan_id_range': 'INTEGER_VALUE_RANGE:1-3999', diff --git a/lib/ansible/module_utils/pycompat24.py b/lib/ansible/module_utils/pycompat24.py index 53e8397868c..bcdf53aec58 100644 --- a/lib/ansible/module_utils/pycompat24.py +++ b/lib/ansible/module_utils/pycompat24.py @@ -43,6 +43,7 @@ def get_exception(): """ return sys.exc_info()[1] + try: # Python 2.6+ from ast import literal_eval diff --git a/lib/ansible/module_utils/six/__init__.py b/lib/ansible/module_utils/six/__init__.py index cd305de2252..4bc670a6450 100644 --- a/lib/ansible/module_utils/six/__init__.py +++ b/lib/ansible/module_utils/six/__init__.py @@ -228,6 +228,7 @@ class _SixMetaPathImporter(object): return None get_source = get_code # same as get_code + _importer = _SixMetaPathImporter(__name__) @@ -490,6 +491,7 @@ class Module_six_moves_urllib(types.ModuleType): def __dir__(self): return ['parse', 'error', 'request', 'response', 'robotparser'] + _importer._add_module(Module_six_moves_urllib(__name__ + ".moves.urllib"), "moves.urllib") diff --git a/lib/ansible/module_utils/urls.py b/lib/ansible/module_utils/urls.py index 25dc35504eb..4c145b4d69d 100644 --- a/lib/ansible/module_utils/urls.py +++ b/lib/ansible/module_utils/urls.py @@ -295,6 +295,7 @@ class NoSSLError(SSLValidationError): """Needed to connect to an HTTPS url but no ssl library available to verify the certificate""" pass + # Some environments (Google Compute Engine's CoreOS deploys) do not compile # against openssl and thus do not have any HTTPS support. CustomHTTPSConnection = CustomHTTPSHandler = None diff --git a/lib/ansible/modules/cloud/amazon/aws_elasticbeanstalk_app.py b/lib/ansible/modules/cloud/amazon/aws_elasticbeanstalk_app.py index 13181993484..e8bc3e3cff7 100644 --- a/lib/ansible/modules/cloud/amazon/aws_elasticbeanstalk_app.py +++ b/lib/ansible/modules/cloud/amazon/aws_elasticbeanstalk_app.py @@ -222,5 +222,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/amazon/aws_glue_connection.py b/lib/ansible/modules/cloud/amazon/aws_glue_connection.py index 895d1928285..1eb2d20d14d 100644 --- a/lib/ansible/modules/cloud/amazon/aws_glue_connection.py +++ b/lib/ansible/modules/cloud/amazon/aws_glue_connection.py @@ -325,5 +325,6 @@ def main(): else: delete_glue_connection(connection_glue, module, glue_connection) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/amazon/aws_glue_job.py b/lib/ansible/modules/cloud/amazon/aws_glue_job.py index bb23569c2ab..857e0d4dea4 100644 --- a/lib/ansible/modules/cloud/amazon/aws_glue_job.py +++ b/lib/ansible/modules/cloud/amazon/aws_glue_job.py @@ -361,5 +361,6 @@ def main(): else: delete_glue_job(connection, module, glue_job) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/amazon/aws_s3_cors.py b/lib/ansible/modules/cloud/amazon/aws_s3_cors.py index 8b7fe8f8705..ea45f811573 100644 --- a/lib/ansible/modules/cloud/amazon/aws_s3_cors.py +++ b/lib/ansible/modules/cloud/amazon/aws_s3_cors.py @@ -187,5 +187,6 @@ def main(): elif state == 'absent': destroy_bucket_cors(client, module) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_vpn.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_vpn.py index 23103e8c8a1..eb6c51bd183 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_vpn.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_vpn.py @@ -727,5 +727,6 @@ def main(): module.exit_json(changed=changed, **camel_dict_to_snake_dict(response)) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/amazon/elasticache.py b/lib/ansible/modules/cloud/amazon/elasticache.py index 8bcf5cd84e5..6dbf4eebb54 100644 --- a/lib/ansible/modules/cloud/amazon/elasticache.py +++ b/lib/ansible/modules/cloud/amazon/elasticache.py @@ -535,5 +535,6 @@ def main(): module.exit_json(**facts_result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/amazon/elasticache_parameter_group.py b/lib/ansible/modules/cloud/amazon/elasticache_parameter_group.py index c07b9d06009..34eb0b4cf77 100644 --- a/lib/ansible/modules/cloud/amazon/elasticache_parameter_group.py +++ b/lib/ansible/modules/cloud/amazon/elasticache_parameter_group.py @@ -354,5 +354,6 @@ def main(): module.exit_json(**facts_result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/amazon/elb_application_lb.py b/lib/ansible/modules/cloud/amazon/elb_application_lb.py index f4edeb65f9a..b58314d5b51 100644 --- a/lib/ansible/modules/cloud/amazon/elb_application_lb.py +++ b/lib/ansible/modules/cloud/amazon/elb_application_lb.py @@ -569,5 +569,6 @@ def main(): else: delete_elb(elb) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/amazon/elb_network_lb.py b/lib/ansible/modules/cloud/amazon/elb_network_lb.py index d33fe571fe3..50c4564ffd6 100644 --- a/lib/ansible/modules/cloud/amazon/elb_network_lb.py +++ b/lib/ansible/modules/cloud/amazon/elb_network_lb.py @@ -415,5 +415,6 @@ def main(): else: delete_elb(elb) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/amazon/elb_target.py b/lib/ansible/modules/cloud/amazon/elb_target.py index 260be30fcac..00896d3a601 100644 --- a/lib/ansible/modules/cloud/amazon/elb_target.py +++ b/lib/ansible/modules/cloud/amazon/elb_target.py @@ -312,5 +312,6 @@ def main(): else: deregister_target(connection, module) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/amazon/route53_health_check.py b/lib/ansible/modules/cloud/amazon/route53_health_check.py index bf608083f6c..f2e18df05cd 100644 --- a/lib/ansible/modules/cloud/amazon/route53_health_check.py +++ b/lib/ansible/modules/cloud/amazon/route53_health_check.py @@ -204,6 +204,7 @@ def to_template_params(health_check): params['string_match_part'] = HealthCheck.XMLStringMatchPart % {'string_match': health_check.string_match} return params + XMLResourcePathPart = """%(resource_path)s""" POSTXMLBody = """ diff --git a/lib/ansible/modules/cloud/azure/azure_rm_availabilityset.py b/lib/ansible/modules/cloud/azure/azure_rm_availabilityset.py index 2789384ecde..434223ca3d9 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_availabilityset.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_availabilityset.py @@ -309,5 +309,6 @@ def main(): """Main execution""" AzureRMAvailabilitySet() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_availabilityset_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_availabilityset_facts.py index 67c9336f4b8..e97320845cc 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_availabilityset_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_availabilityset_facts.py @@ -172,5 +172,6 @@ def main(): AzureRMAvailabilitySetFacts() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_containerinstance.py b/lib/ansible/modules/cloud/azure/azure_rm_containerinstance.py index 78478d88429..bfeecbe89eb 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_containerinstance.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_containerinstance.py @@ -424,5 +424,6 @@ def main(): """Main execution""" AzureRMContainerInstance() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_containerregistry.py b/lib/ansible/modules/cloud/azure/azure_rm_containerregistry.py index 3fe8a656876..298d5daf306 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_containerregistry.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_containerregistry.py @@ -424,5 +424,6 @@ def main(): """Main execution""" AzureRMContainerRegistry() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset.py b/lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset.py index 7268d041102..8da678a30a3 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset.py @@ -388,5 +388,6 @@ def gethash(self): def main(): AzureRMRecordSet() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset_facts.py index 936c4049f01..9ee712ad1a1 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset_facts.py @@ -197,5 +197,6 @@ class AzureRMRecordSetFacts(AzureRMModuleBase): def main(): AzureRMRecordSetFacts() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_dnszone.py b/lib/ansible/modules/cloud/azure/azure_rm_dnszone.py index 431935da354..a63f22c451c 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_dnszone.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_dnszone.py @@ -236,5 +236,6 @@ def zone_to_dict(zone): def main(): AzureRMDNSZone() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_dnszone_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_dnszone_facts.py index 4ed09ec238c..99f6be82d02 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_dnszone_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_dnszone_facts.py @@ -177,5 +177,6 @@ class AzureRMDNSZoneFacts(AzureRMModuleBase): def main(): AzureRMDNSZoneFacts() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_functionapp.py b/lib/ansible/modules/cloud/azure/azure_rm_functionapp.py index 23e276f9c70..430682ff343 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_functionapp.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_functionapp.py @@ -309,5 +309,6 @@ def main(): AzureRMFunctionApp() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_image.py b/lib/ansible/modules/cloud/azure/azure_rm_image.py index 80f47782176..deb9b5dc15a 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_image.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_image.py @@ -316,5 +316,6 @@ class AzureRMImage(AzureRMModuleBase): def main(): AzureRMImage() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_keyvault.py b/lib/ansible/modules/cloud/azure/azure_rm_keyvault.py index 5d9423caf2a..cb81edc8550 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_keyvault.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_keyvault.py @@ -489,5 +489,6 @@ def main(): """Main execution""" AzureRMVaults() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_keyvaultkey.py b/lib/ansible/modules/cloud/azure/azure_rm_keyvaultkey.py index dbbc00c4d1b..2edcdb9d71b 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_keyvaultkey.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_keyvaultkey.py @@ -291,5 +291,6 @@ class AzureRMKeyVaultKey(AzureRMModuleBase): def main(): AzureRMKeyVaultKey() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_keyvaultsecret.py b/lib/ansible/modules/cloud/azure/azure_rm_keyvaultsecret.py index d1919d9355b..e0b9a8d5625 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_keyvaultsecret.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_keyvaultsecret.py @@ -212,5 +212,6 @@ class AzureRMKeyVaultSecret(AzureRMModuleBase): def main(): AzureRMKeyVaultSecret() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_loadbalancer.py b/lib/ansible/modules/cloud/azure/azure_rm_loadbalancer.py index 2c713521dc5..330fb2f48ce 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_loadbalancer.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_loadbalancer.py @@ -970,5 +970,6 @@ def main(): """Main execution""" AzureRMLoadBalancer() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_loadbalancer_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_loadbalancer_facts.py index 1a7f8242542..1f62e715bbe 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_loadbalancer_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_loadbalancer_facts.py @@ -170,5 +170,6 @@ def main(): AzureRMLoadBalancerFacts() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_managed_disk.py b/lib/ansible/modules/cloud/azure/azure_rm_managed_disk.py index aa54f5544cf..5ea8904d9b8 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_managed_disk.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_managed_disk.py @@ -384,5 +384,6 @@ def main(): """Main execution""" AzureRMManagedDisk() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_managed_disk_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_managed_disk_facts.py index 95abcea47d8..c9b6ea3b3ff 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_managed_disk_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_managed_disk_facts.py @@ -166,5 +166,6 @@ def main(): AzureRMManagedDiskFacts() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_mysqldatabase.py b/lib/ansible/modules/cloud/azure/azure_rm_mysqldatabase.py index dcdb17b9048..45fe0e8fb51 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_mysqldatabase.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_mysqldatabase.py @@ -299,5 +299,6 @@ def main(): """Main execution""" AzureRMDatabases() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_mysqlserver.py b/lib/ansible/modules/cloud/azure/azure_rm_mysqlserver.py index 29788af661e..83ef90a45c4 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_mysqlserver.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_mysqlserver.py @@ -373,5 +373,6 @@ def main(): """Main execution""" AzureRMServers() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_networkinterface_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_networkinterface_facts.py index 33359eda363..2ba4d8e035a 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_networkinterface_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_networkinterface_facts.py @@ -206,5 +206,6 @@ class AzureRMNetworkInterfaceFacts(AzureRMModuleBase): def main(): AzureRMNetworkInterfaceFacts() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_postgresqldatabase.py b/lib/ansible/modules/cloud/azure/azure_rm_postgresqldatabase.py index 6f479046058..dfee3392513 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_postgresqldatabase.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_postgresqldatabase.py @@ -299,5 +299,6 @@ def main(): """Main execution""" AzureRMDatabases() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_postgresqlserver.py b/lib/ansible/modules/cloud/azure/azure_rm_postgresqlserver.py index e424c7065ba..bfec5871008 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_postgresqlserver.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_postgresqlserver.py @@ -372,5 +372,6 @@ def main(): """Main execution""" AzureRMServers() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_publicipaddress.py b/lib/ansible/modules/cloud/azure/azure_rm_publicipaddress.py index 8dc5639da99..35dd8c66bd1 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_publicipaddress.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_publicipaddress.py @@ -282,5 +282,6 @@ class AzureRMPublicIPAddress(AzureRMModuleBase): def main(): AzureRMPublicIPAddress() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_resourcegroup.py b/lib/ansible/modules/cloud/azure/azure_rm_resourcegroup.py index 7a6b60897df..8a2c8178071 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_resourcegroup.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_resourcegroup.py @@ -251,5 +251,6 @@ class AzureRMResourceGroup(AzureRMModuleBase): def main(): AzureRMResourceGroup() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_resourcegroup_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_resourcegroup_facts.py index f73b315ad6d..5c0ea2ec9d9 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_resourcegroup_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_resourcegroup_facts.py @@ -152,5 +152,6 @@ class AzureRMResourceGroupFacts(AzureRMModuleBase): def main(): AzureRMResourceGroupFacts() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_securitygroup_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_securitygroup_facts.py index 92bc67a734a..53badb4d54b 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_securitygroup_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_securitygroup_facts.py @@ -270,5 +270,6 @@ class AzureRMSecurityGroupFacts(AzureRMModuleBase): def main(): AzureRMSecurityGroupFacts() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_sqldatabase.py b/lib/ansible/modules/cloud/azure/azure_rm_sqldatabase.py index 3e4b736142d..345da65368c 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_sqldatabase.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_sqldatabase.py @@ -495,5 +495,6 @@ def main(): """Main execution""" AzureRMDatabases() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_sqlserver.py b/lib/ansible/modules/cloud/azure/azure_rm_sqlserver.py index d69980e6829..46c833f6fa9 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_sqlserver.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_sqlserver.py @@ -321,5 +321,6 @@ def main(): """Main execution""" AzureRMServers() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_sqlserver_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_sqlserver_facts.py index 6a679a93b27..3a22f1bc48b 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_sqlserver_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_sqlserver_facts.py @@ -200,5 +200,7 @@ class AzureRMServersFacts(AzureRMModuleBase): def main(): AzureRMServersFacts() + + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_storageaccount.py b/lib/ansible/modules/cloud/azure/azure_rm_storageaccount.py index d48519b7407..67cb4522b6e 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_storageaccount.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_storageaccount.py @@ -451,5 +451,6 @@ class AzureRMStorageAccount(AzureRMModuleBase): def main(): AzureRMStorageAccount() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_storageblob.py b/lib/ansible/modules/cloud/azure/azure_rm_storageblob.py index 711ef174c97..9e9a56cc334 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_storageblob.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_storageblob.py @@ -545,5 +545,6 @@ class AzureRMStorageBlob(AzureRMModuleBase): def main(): AzureRMStorageBlob() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_subnet.py b/lib/ansible/modules/cloud/azure/azure_rm_subnet.py index ca22460fa10..62753f9e63f 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_subnet.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_subnet.py @@ -311,5 +311,6 @@ class AzureRMSubnet(AzureRMModuleBase): def main(): AzureRMSubnet() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_extension.py b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_extension.py index 401ea8c0a99..48d08bb9db2 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_extension.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_extension.py @@ -309,5 +309,6 @@ def main(): """Main execution""" AzureRMVMExtension() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset.py b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset.py index a470a06738e..83416869cf2 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset.py @@ -851,5 +851,6 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase): def main(): AzureRMVirtualMachineScaleSet() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset_facts.py index dbdec678a7e..7484d9c7ede 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset_facts.py @@ -277,5 +277,6 @@ def main(): AzureRMVirtualMachineScaleSetFacts() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachineimage_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachineimage_facts.py index 4fb4b694cb0..a55945008d5 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachineimage_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachineimage_facts.py @@ -215,5 +215,6 @@ class AzureRMVirtualMachineImageFacts(AzureRMModuleBase): def main(): AzureRMVirtualMachineImageFacts() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork.py b/lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork.py index b3d1832a797..eb55334dc1c 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork.py @@ -344,5 +344,6 @@ class AzureRMVirtualNetwork(AzureRMModuleBase): def main(): AzureRMVirtualNetwork() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork_facts.py index 04a9893b2da..2bc3bf3c343 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork_facts.py @@ -176,5 +176,6 @@ class AzureRMNetworkInterfaceFacts(AzureRMModuleBase): def main(): AzureRMNetworkInterfaceFacts() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/dimensiondata/dimensiondata_network.py b/lib/ansible/modules/cloud/dimensiondata/dimensiondata_network.py index d8b14a6aebe..7805d9a1ef4 100644 --- a/lib/ansible/modules/cloud/dimensiondata/dimensiondata_network.py +++ b/lib/ansible/modules/cloud/dimensiondata/dimensiondata_network.py @@ -290,5 +290,6 @@ def main(): elif module.state == 'absent': module.state_absent() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_address.py b/lib/ansible/modules/cloud/google/gcp_compute_address.py index b15443dd1eb..e03e46158d8 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_address.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_address.py @@ -327,5 +327,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_backend_bucket.py b/lib/ansible/modules/cloud/google/gcp_compute_backend_bucket.py index 7d7150fb6b2..9f1c22765b8 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_backend_bucket.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_backend_bucket.py @@ -327,5 +327,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_backend_service.py b/lib/ansible/modules/cloud/google/gcp_compute_backend_service.py index ba660e0d155..40bb6a81fb9 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_backend_service.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_backend_service.py @@ -852,5 +852,6 @@ class BackeServiConneDrain(object): u'drainingTimeoutSec': self.request.get(u'drainingTimeoutSec') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_disk.py b/lib/ansible/modules/cloud/google/gcp_compute_disk.py index e3252787aa9..779e46e7993 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_disk.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_disk.py @@ -631,5 +631,6 @@ class DiskSourSnapEncrKey(object): u'sha256': self.request.get(u'sha256') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_firewall.py b/lib/ansible/modules/cloud/google/gcp_compute_firewall.py index c07824e3d2b..01d77b26084 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_firewall.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_firewall.py @@ -473,5 +473,6 @@ class FirewallAllowedArray(object): u'ports': item.get(u'ports') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule.py b/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule.py index cda8b294f40..9faca26add2 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule.py @@ -521,5 +521,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_global_address.py b/lib/ansible/modules/cloud/google/gcp_compute_global_address.py index 687a6ee0517..03b851eec05 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_global_address.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_global_address.py @@ -323,5 +323,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_global_forwarding_rule.py b/lib/ansible/modules/cloud/google/gcp_compute_global_forwarding_rule.py index 51cb2870a41..503e131664c 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_global_forwarding_rule.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_global_forwarding_rule.py @@ -572,5 +572,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_health_check.py b/lib/ansible/modules/cloud/google/gcp_compute_health_check.py index 76bde14b667..de6fb88075d 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_health_check.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_health_check.py @@ -795,5 +795,6 @@ class HealChecSslHealChec(object): u'proxyHeader': self.request.get(u'proxyHeader') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_http_health_check.py b/lib/ansible/modules/cloud/google/gcp_compute_http_health_check.py index ad91715d6a9..49f0b590540 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_http_health_check.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_http_health_check.py @@ -398,5 +398,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_https_health_check.py b/lib/ansible/modules/cloud/google/gcp_compute_https_health_check.py index 4c8c5cc05be..6ee3685f695 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_https_health_check.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_https_health_check.py @@ -397,5 +397,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_image.py b/lib/ansible/modules/cloud/google/gcp_compute_image.py index 14c63a4870a..c096ada3b41 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_image.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_image.py @@ -749,5 +749,6 @@ class ImagSourDiskEncrKey(object): u'sha256': self.request.get(u'sha256') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_instance.py b/lib/ansible/modules/cloud/google/gcp_compute_instance.py index b53a679dff4..67811eb9633 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_instance.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_instance.py @@ -1464,5 +1464,6 @@ class InstanceTags(object): u'items': self.request.get(u'items') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_instance_group.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_group.py index 2aab0ece63c..e6f5bc3efcc 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_instance_group.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_group.py @@ -430,5 +430,6 @@ class InstaGroupNamedPortsArray(object): u'port': item.get(u'port') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager.py index b41e6b14cd9..6283afe093b 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager.py @@ -591,5 +591,6 @@ class InstGrouManaNamePortArray(object): u'port': item.get(u'port') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_instance_template.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_template.py index afce5d8a916..52b9d543bc0 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_instance_template.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_template.py @@ -1439,5 +1439,6 @@ class InstancTemplatTags(object): u'items': self.request.get(u'items') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_network.py b/lib/ansible/modules/cloud/google/gcp_compute_network.py index eb7b6a0c882..6575ca48252 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_network.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_network.py @@ -354,5 +354,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_route.py b/lib/ansible/modules/cloud/google/gcp_compute_route.py index cc86892edfd..793b6c6a1ac 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_route.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_route.py @@ -414,5 +414,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py index cae3a63dae6..9e0346feb06 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py @@ -338,5 +338,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py b/lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py index 86c3b0dd33f..40bbfc43caf 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py @@ -386,5 +386,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py b/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py index 555a2da959f..0434660cf0c 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py @@ -348,5 +348,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy.py b/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy.py index c3a424100c9..a5436c4381f 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy.py @@ -400,5 +400,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_pool.py b/lib/ansible/modules/cloud/google/gcp_compute_target_pool.py index 93f47738461..e033b94db27 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_pool.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_pool.py @@ -419,5 +419,6 @@ def decode_request(response, module): return response + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy.py b/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy.py index 3010bacc486..52dc5c3be2c 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy.py @@ -408,5 +408,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy.py b/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy.py index 994c1cb0ded..71e929d4d75 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy.py @@ -357,5 +357,6 @@ def raise_if_errors(response, err_path, module): if errors is not None: module.fail_json(msg=errors) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_compute_url_map.py b/lib/ansible/modules/cloud/google/gcp_compute_url_map.py index 007f45fe4c8..bab7d289878 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_url_map.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_url_map.py @@ -673,5 +673,6 @@ class UrlMapTestsArray(object): u'service': item.get(u'service') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_container_cluster.py b/lib/ansible/modules/cloud/google/gcp_container_cluster.py index 66cfd52fb02..eec0bd8fa18 100644 --- a/lib/ansible/modules/cloud/google/gcp_container_cluster.py +++ b/lib/ansible/modules/cloud/google/gcp_container_cluster.py @@ -948,5 +948,6 @@ class ClustHorizPodAutos(object): u'disabled': self.request.get(u'disabled') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_container_node_pool.py b/lib/ansible/modules/cloud/google/gcp_container_node_pool.py index 595ba27f4e4..039bf39ffb8 100644 --- a/lib/ansible/modules/cloud/google/gcp_container_node_pool.py +++ b/lib/ansible/modules/cloud/google/gcp_container_node_pool.py @@ -760,5 +760,6 @@ class NodePoolUpgraOptio(object): u'description': self.request.get(u'description') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_dns_managed_zone.py b/lib/ansible/modules/cloud/google/gcp_dns_managed_zone.py index 6d60bb3ec36..9da6a8f2944 100644 --- a/lib/ansible/modules/cloud/google/gcp_dns_managed_zone.py +++ b/lib/ansible/modules/cloud/google/gcp_dns_managed_zone.py @@ -281,5 +281,6 @@ def response_to_hash(module, response): u'creationTime': response.get(u'creationTime') } + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_dns_resource_record_set.py b/lib/ansible/modules/cloud/google/gcp_dns_resource_record_set.py index cd1ec280c44..bb1a2c2d089 100644 --- a/lib/ansible/modules/cloud/google/gcp_dns_resource_record_set.py +++ b/lib/ansible/modules/cloud/google/gcp_dns_resource_record_set.py @@ -457,5 +457,6 @@ def return_if_change_object(module, response): return result + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_pubsub_subscription.py b/lib/ansible/modules/cloud/google/gcp_pubsub_subscription.py index 5547bd4c8d9..53fbb2d3717 100644 --- a/lib/ansible/modules/cloud/google/gcp_pubsub_subscription.py +++ b/lib/ansible/modules/cloud/google/gcp_pubsub_subscription.py @@ -344,5 +344,6 @@ class SubscriPushConfig(object): u'pushEndpoint': self.request.get(u'pushEndpoint') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_pubsub_topic.py b/lib/ansible/modules/cloud/google/gcp_pubsub_topic.py index 0248719f5f3..73d04e329bc 100644 --- a/lib/ansible/modules/cloud/google/gcp_pubsub_topic.py +++ b/lib/ansible/modules/cloud/google/gcp_pubsub_topic.py @@ -223,5 +223,6 @@ def encode_request(request, module): 'topics', module.params['name']]) return request + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_storage_bucket.py b/lib/ansible/modules/cloud/google/gcp_storage_bucket.py index 2df5851a982..c2601fa43a2 100644 --- a/lib/ansible/modules/cloud/google/gcp_storage_bucket.py +++ b/lib/ansible/modules/cloud/google/gcp_storage_bucket.py @@ -1162,5 +1162,6 @@ class BucketWebsite(object): u'notFoundPage': self.request.get(u'notFoundPage') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcp_storage_bucket_access_control.py b/lib/ansible/modules/cloud/google/gcp_storage_bucket_access_control.py index b8c8cbca54f..5f12aa8b6c0 100644 --- a/lib/ansible/modules/cloud/google/gcp_storage_bucket_access_control.py +++ b/lib/ansible/modules/cloud/google/gcp_storage_bucket_access_control.py @@ -359,5 +359,6 @@ class BuckAcceContProjTeam(object): u'team': self.request.get(u'team') }) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/google/gcpubsub.py b/lib/ansible/modules/cloud/google/gcpubsub.py index 882f6948532..879f82565fa 100644 --- a/lib/ansible/modules/cloud/google/gcpubsub.py +++ b/lib/ansible/modules/cloud/google/gcpubsub.py @@ -328,5 +328,6 @@ def main(): json_output.update(mod_params) module.exit_json(**json_output) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/opennebula/one_image_facts.py b/lib/ansible/modules/cloud/opennebula/one_image_facts.py index 2ab5c5f5975..d850a0be9b9 100644 --- a/lib/ansible/modules/cloud/opennebula/one_image_facts.py +++ b/lib/ansible/modules/cloud/opennebula/one_image_facts.py @@ -158,6 +158,7 @@ def get_all_images(client): return pool + IMAGE_STATES = ['INIT', 'READY', 'USED', 'DISABLED', 'LOCKED', 'ERROR', 'CLONE', 'DELETE', 'USED_PERS', 'LOCKED_USED', 'LOCKED_USED_PERS'] diff --git a/lib/ansible/modules/cloud/opennebula/one_vm.py b/lib/ansible/modules/cloud/opennebula/one_vm.py index 87292a2d022..b1020f0b50e 100644 --- a/lib/ansible/modules/cloud/opennebula/one_vm.py +++ b/lib/ansible/modules/cloud/opennebula/one_vm.py @@ -1026,6 +1026,7 @@ def create_exact_count_of_vms(module, client, template_id, exact_count, attribut return changed, instances_list, tagged_instances_list + VM_STATES = ['INIT', 'PENDING', 'HOLD', 'ACTIVE', 'STOPPED', 'SUSPENDED', 'DONE', '', 'POWEROFF', 'UNDEPLOYED', 'CLONING', 'CLONING_FAILURE'] LCM_STATES = ['LCM_INIT', 'PROLOG', 'BOOT', 'RUNNING', 'MIGRATE', 'SAVE_STOP', 'SAVE_SUSPEND', 'SAVE_MIGRATE', 'PROLOG_MIGRATE', 'PROLOG_RESUME', @@ -1175,6 +1176,7 @@ def check_name_attribute(module, attributes): module.fail_json(msg="Ilegal 'NAME' attribute: '" + attributes.get("NAME") + "' .Signs '#' are allowed only at the end of the name and the name cannot contain only '#'.") + TEMPLATE_RESTRICTED_ATTRIBUTES = ["CPU", "VCPU", "OS", "FEATURES", "MEMORY", "DISK", "NIC", "INPUT", "GRAPHICS", "CONTEXT", "CREATED_BY", "CPU_COST", "DISK_COST", "MEMORY_COST", "TEMPLATE_ID", "VMID", "AUTOMATIC_DS_REQUIREMENTS", "DEPLOY_FOLDER", "LABELS"] diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_nics.py b/lib/ansible/modules/cloud/ovirt/ovirt_nics.py index 6046774e0e4..d2cd0143c9d 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_nics.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_nics.py @@ -269,5 +269,6 @@ def main(): finally: connection.close(logout=auth.get('token') is None) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vmpools_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_vmpools_facts.py index ed79c5a73b8..db90f3babcd 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vmpools_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vmpools_facts.py @@ -103,5 +103,6 @@ def main(): finally: connection.close(logout=auth.get('token') is None) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/packet/packet_device.py b/lib/ansible/modules/cloud/packet/packet_device.py index 6e1518b758d..95c3d8b6160 100644 --- a/lib/ansible/modules/cloud/packet/packet_device.py +++ b/lib/ansible/modules/cloud/packet/packet_device.py @@ -636,5 +636,6 @@ def main(): module.fail_json(msg='failed to set device state %s, error: %s' % (state, to_native(e)), exception=traceback.format_exc()) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/smartos/smartos_image_facts.py b/lib/ansible/modules/cloud/smartos/smartos_image_facts.py index 137288e20d9..589f640400e 100644 --- a/lib/ansible/modules/cloud/smartos/smartos_image_facts.py +++ b/lib/ansible/modules/cloud/smartos/smartos_image_facts.py @@ -102,5 +102,6 @@ def main(): module.exit_json(ansible_facts=data) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest_boot_manager.py b/lib/ansible/modules/cloud/vmware/vmware_guest_boot_manager.py index daac3c8b83e..c6d5b761406 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest_boot_manager.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest_boot_manager.py @@ -331,5 +331,6 @@ def main(): pyv = VmBootManager(module) pyv.ensure() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/cloud/vmware/vmware_local_user_facts.py b/lib/ansible/modules/cloud/vmware/vmware_local_user_facts.py index ef609454c9b..833f7d0e492 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_local_user_facts.py +++ b/lib/ansible/modules/cloud/vmware/vmware_local_user_facts.py @@ -107,5 +107,6 @@ def main(): vmware_local_user_facts = VMwareUserFactsManager(module) vmware_local_user_facts.gather_user_facts() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/clustering/etcd3.py b/lib/ansible/modules/clustering/etcd3.py index fdb15549947..a9e84b062a3 100644 --- a/lib/ansible/modules/clustering/etcd3.py +++ b/lib/ansible/modules/clustering/etcd3.py @@ -180,5 +180,6 @@ def run_module(): def main(): run_module() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/database/postgresql/postgresql_db.py b/lib/ansible/modules/database/postgresql/postgresql_db.py index 66fd1cbfaea..9d6df4a98ea 100644 --- a/lib/ansible/modules/database/postgresql/postgresql_db.py +++ b/lib/ansible/modules/database/postgresql/postgresql_db.py @@ -480,5 +480,6 @@ def main(): module.exit_json(changed=changed, db=db) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/database/proxysql/proxysql_backend_servers.py b/lib/ansible/modules/database/proxysql/proxysql_backend_servers.py index 6135179ab57..46bd13042e1 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_backend_servers.py +++ b/lib/ansible/modules/database/proxysql/proxysql_backend_servers.py @@ -509,5 +509,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/database/proxysql/proxysql_global_variables.py b/lib/ansible/modules/database/proxysql/proxysql_global_variables.py index 7b5b319d852..59451954c2c 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_global_variables.py +++ b/lib/ansible/modules/database/proxysql/proxysql_global_variables.py @@ -271,5 +271,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/database/proxysql/proxysql_manage_config.py b/lib/ansible/modules/database/proxysql/proxysql_manage_config.py index 8f5395e740f..7edf868055b 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_manage_config.py +++ b/lib/ansible/modules/database/proxysql/proxysql_manage_config.py @@ -221,5 +221,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/database/proxysql/proxysql_mysql_users.py b/lib/ansible/modules/database/proxysql/proxysql_mysql_users.py index 7d42fc52049..6aba7bb0a71 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_mysql_users.py +++ b/lib/ansible/modules/database/proxysql/proxysql_mysql_users.py @@ -476,5 +476,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/database/proxysql/proxysql_query_rules.py b/lib/ansible/modules/database/proxysql/proxysql_query_rules.py index 44af55f2a1c..568e95a836b 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_query_rules.py +++ b/lib/ansible/modules/database/proxysql/proxysql_query_rules.py @@ -612,5 +612,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/database/proxysql/proxysql_replication_hostgroups.py b/lib/ansible/modules/database/proxysql/proxysql_replication_hostgroups.py index 3760dce0be4..d02fbf0c3db 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_replication_hostgroups.py +++ b/lib/ansible/modules/database/proxysql/proxysql_replication_hostgroups.py @@ -385,5 +385,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/database/proxysql/proxysql_scheduler.py b/lib/ansible/modules/database/proxysql/proxysql_scheduler.py index faa63ef8ae4..ba59a911383 100644 --- a/lib/ansible/modules/database/proxysql/proxysql_scheduler.py +++ b/lib/ansible/modules/database/proxysql/proxysql_scheduler.py @@ -420,5 +420,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/files/assemble.py b/lib/ansible/modules/files/assemble.py index b4a74f104dc..d33f42c3147 100644 --- a/lib/ansible/modules/files/assemble.py +++ b/lib/ansible/modules/files/assemble.py @@ -241,5 +241,6 @@ def main(): result['msg'] = "OK" module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/files/ini_file.py b/lib/ansible/modules/files/ini_file.py index cf12896b1bb..38f8d3fa78a 100644 --- a/lib/ansible/modules/files/ini_file.py +++ b/lib/ansible/modules/files/ini_file.py @@ -323,5 +323,6 @@ def main(): # Mission complete module.exit_json(**results) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/identity/ipa/ipa_service.py b/lib/ansible/modules/identity/ipa/ipa_service.py index b0b65f5c434..ce2f7de2e6b 100644 --- a/lib/ansible/modules/identity/ipa/ipa_service.py +++ b/lib/ansible/modules/identity/ipa/ipa_service.py @@ -203,5 +203,6 @@ def main(): except Exception as e: module.fail_json(msg=to_native(e), exception=traceback.format_exc()) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/identity/ipa/ipa_sudocmdgroup.py b/lib/ansible/modules/identity/ipa/ipa_sudocmdgroup.py index 5310116c649..9f386c68275 100644 --- a/lib/ansible/modules/identity/ipa/ipa_sudocmdgroup.py +++ b/lib/ansible/modules/identity/ipa/ipa_sudocmdgroup.py @@ -173,5 +173,6 @@ def main(): except Exception as e: module.fail_json(msg=to_native(e), exception=traceback.format_exc()) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/identity/keycloak/keycloak_client.py b/lib/ansible/modules/identity/keycloak/keycloak_client.py index 7fcaa67ea1c..f6e0fc7658b 100644 --- a/lib/ansible/modules/identity/keycloak/keycloak_client.py +++ b/lib/ansible/modules/identity/keycloak/keycloak_client.py @@ -807,5 +807,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/identity/keycloak/keycloak_clienttemplate.py b/lib/ansible/modules/identity/keycloak/keycloak_clienttemplate.py index cb7c4e8fcbd..1da26b76a0c 100644 --- a/lib/ansible/modules/identity/keycloak/keycloak_clienttemplate.py +++ b/lib/ansible/modules/identity/keycloak/keycloak_clienttemplate.py @@ -401,5 +401,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/identity/opendj/opendj_backendprop.py b/lib/ansible/modules/identity/opendj/opendj_backendprop.py index dfc22e08d11..38ae60d7ebd 100644 --- a/lib/ansible/modules/identity/opendj/opendj_backendprop.py +++ b/lib/ansible/modules/identity/opendj/opendj_backendprop.py @@ -199,5 +199,6 @@ def main(): else: module.exit_json(changed=False) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/messaging/rabbitmq_exchange.py b/lib/ansible/modules/messaging/rabbitmq_exchange.py index 9f31e57dcf9..c65c846eddd 100644 --- a/lib/ansible/modules/messaging/rabbitmq_exchange.py +++ b/lib/ansible/modules/messaging/rabbitmq_exchange.py @@ -219,5 +219,6 @@ def main(): result['changed'] = False module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/messaging/rabbitmq_parameter.py b/lib/ansible/modules/messaging/rabbitmq_parameter.py index 91039397eb3..9ac93d7a4d3 100644 --- a/lib/ansible/modules/messaging/rabbitmq_parameter.py +++ b/lib/ansible/modules/messaging/rabbitmq_parameter.py @@ -151,5 +151,6 @@ def main(): result['state'] = state module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/messaging/rabbitmq_policy.py b/lib/ansible/modules/messaging/rabbitmq_policy.py index 9109283c33a..8721889b539 100644 --- a/lib/ansible/modules/messaging/rabbitmq_policy.py +++ b/lib/ansible/modules/messaging/rabbitmq_policy.py @@ -163,5 +163,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/messaging/rabbitmq_queue.py b/lib/ansible/modules/messaging/rabbitmq_queue.py index 9d2c490feba..0261e05f437 100644 --- a/lib/ansible/modules/messaging/rabbitmq_queue.py +++ b/lib/ansible/modules/messaging/rabbitmq_queue.py @@ -264,5 +264,6 @@ def main(): result['changed'] = False module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/messaging/rabbitmq_user.py b/lib/ansible/modules/messaging/rabbitmq_user.py index 6d87d7626fd..c8cb83fac66 100644 --- a/lib/ansible/modules/messaging/rabbitmq_user.py +++ b/lib/ansible/modules/messaging/rabbitmq_user.py @@ -312,5 +312,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/messaging/rabbitmq_vhost.py b/lib/ansible/modules/messaging/rabbitmq_vhost.py index 59d8e61a2dc..cd171b85369 100644 --- a/lib/ansible/modules/messaging/rabbitmq_vhost.py +++ b/lib/ansible/modules/messaging/rabbitmq_vhost.py @@ -141,5 +141,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/monitoring/grafana_dashboard.py b/lib/ansible/modules/monitoring/grafana_dashboard.py index f9346aa049b..a07d33b916b 100644 --- a/lib/ansible/modules/monitoring/grafana_dashboard.py +++ b/lib/ansible/modules/monitoring/grafana_dashboard.py @@ -441,5 +441,6 @@ def main(): ) return + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/monitoring/grafana_datasource.py b/lib/ansible/modules/monitoring/grafana_datasource.py index d6145790f4e..00d8c6f087c 100644 --- a/lib/ansible/modules/monitoring/grafana_datasource.py +++ b/lib/ansible/modules/monitoring/grafana_datasource.py @@ -536,5 +536,6 @@ def main(): ) return + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/monitoring/grafana_plugin.py b/lib/ansible/modules/monitoring/grafana_plugin.py index 5cf043917f3..c6be8a3c2b4 100644 --- a/lib/ansible/modules/monitoring/grafana_plugin.py +++ b/lib/ansible/modules/monitoring/grafana_plugin.py @@ -226,5 +226,6 @@ def main(): ) return + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/monitoring/sensu_client.py b/lib/ansible/modules/monitoring/sensu_client.py index 4da3adabb3c..fe1c739fd9e 100644 --- a/lib/ansible/modules/monitoring/sensu_client.py +++ b/lib/ansible/modules/monitoring/sensu_client.py @@ -246,5 +246,6 @@ def main(): module.fail_json(msg='Unable to write file {0}: {1}'.format(path, str(e))) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/monitoring/sensu_handler.py b/lib/ansible/modules/monitoring/sensu_handler.py index 88d6341825b..be69e3d55e9 100644 --- a/lib/ansible/modules/monitoring/sensu_handler.py +++ b/lib/ansible/modules/monitoring/sensu_handler.py @@ -259,5 +259,6 @@ def main(): module.fail_json(msg='Unable to write file {0}: {1}'.format(path, str(e))) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/monitoring/zabbix/zabbix_group_facts.py b/lib/ansible/modules/monitoring/zabbix/zabbix_group_facts.py index 20f822c6652..64c0486a53b 100644 --- a/lib/ansible/modules/monitoring/zabbix/zabbix_group_facts.py +++ b/lib/ansible/modules/monitoring/zabbix/zabbix_group_facts.py @@ -128,5 +128,6 @@ def main(): host_groups = host.get_group_ids_by_group_names(hostgroup_name) module.exit_json(host_groups=host_groups) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/monitoring/zabbix/zabbix_host_facts.py b/lib/ansible/modules/monitoring/zabbix/zabbix_host_facts.py index d6381ddbe17..99bb7667fb3 100644 --- a/lib/ansible/modules/monitoring/zabbix/zabbix_host_facts.py +++ b/lib/ansible/modules/monitoring/zabbix/zabbix_host_facts.py @@ -207,5 +207,6 @@ def main(): else: module.exit_json(ok=False, hosts=[], result="No Host present") + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/a10/a10_service_group.py b/lib/ansible/modules/network/a10/a10_service_group.py index 943fe29c3bc..fed5b85c721 100644 --- a/lib/ansible/modules/network/a10/a10_service_group.py +++ b/lib/ansible/modules/network/a10/a10_service_group.py @@ -331,5 +331,6 @@ def main(): axapi_call(module, session_url + '&method=session.close') module.exit_json(changed=changed, content=result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/aci/aci_aep.py b/lib/ansible/modules/network/aci/aci_aep.py index 387b1bd1cfe..a775c2aa843 100644 --- a/lib/ansible/modules/network/aci/aci_aep.py +++ b/lib/ansible/modules/network/aci/aci_aep.py @@ -254,5 +254,6 @@ def main(): aci.exit_json() + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/aci/aci_contract_subject.py b/lib/ansible/modules/network/aci/aci_contract_subject.py index 0e75715faf2..1a660b71dcc 100644 --- a/lib/ansible/modules/network/aci/aci_contract_subject.py +++ b/lib/ansible/modules/network/aci/aci_contract_subject.py @@ -328,5 +328,6 @@ def main(): aci.exit_json() + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/aos/_aos_asn_pool.py b/lib/ansible/modules/network/aos/_aos_asn_pool.py index 364cbf4206b..49ec51daa7a 100644 --- a/lib/ansible/modules/network/aos/_aos_asn_pool.py +++ b/lib/ansible/modules/network/aos/_aos_asn_pool.py @@ -341,5 +341,6 @@ def main(): asn_pool(module) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/aos/_aos_device.py b/lib/ansible/modules/network/aos/_aos_device.py index 298bf53d4e3..6413456e754 100644 --- a/lib/ansible/modules/network/aos/_aos_device.py +++ b/lib/ansible/modules/network/aos/_aos_device.py @@ -217,5 +217,6 @@ def main(): aos_device(module) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/aos/_aos_external_router.py b/lib/ansible/modules/network/aos/_aos_external_router.py index ffa8f0a6d9f..5aa8c1827e7 100644 --- a/lib/ansible/modules/network/aos/_aos_external_router.py +++ b/lib/ansible/modules/network/aos/_aos_external_router.py @@ -337,5 +337,6 @@ def main(): ext_router(module) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/aos/_aos_ip_pool.py b/lib/ansible/modules/network/aos/_aos_ip_pool.py index 7bf983b5623..52104d5a194 100644 --- a/lib/ansible/modules/network/aos/_aos_ip_pool.py +++ b/lib/ansible/modules/network/aos/_aos_ip_pool.py @@ -348,5 +348,6 @@ def main(): ip_pool(module) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/aos/_aos_logical_device.py b/lib/ansible/modules/network/aos/_aos_logical_device.py index 4a73b1ef205..7cf6022be20 100644 --- a/lib/ansible/modules/network/aos/_aos_logical_device.py +++ b/lib/ansible/modules/network/aos/_aos_logical_device.py @@ -258,5 +258,6 @@ def main(): logical_device(module) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/aos/_aos_logical_device_map.py b/lib/ansible/modules/network/aos/_aos_logical_device_map.py index c6378236ca5..500d46de554 100644 --- a/lib/ansible/modules/network/aos/_aos_logical_device_map.py +++ b/lib/ansible/modules/network/aos/_aos_logical_device_map.py @@ -281,5 +281,6 @@ def main(): logical_device_map(module) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/aos/_aos_login.py b/lib/ansible/modules/network/aos/_aos_login.py index c67b3413abe..7d53338b4b3 100644 --- a/lib/ansible/modules/network/aos/_aos_login.py +++ b/lib/ansible/modules/network/aos/_aos_login.py @@ -134,5 +134,6 @@ def main(): aos_login(module) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/aos/_aos_rack_type.py b/lib/ansible/modules/network/aos/_aos_rack_type.py index 01514d0e8f7..83aa969f130 100644 --- a/lib/ansible/modules/network/aos/_aos_rack_type.py +++ b/lib/ansible/modules/network/aos/_aos_rack_type.py @@ -255,5 +255,6 @@ def main(): rack_type(module) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/aos/_aos_template.py b/lib/ansible/modules/network/aos/_aos_template.py index 0fa7058f956..c26bb95b73f 100644 --- a/lib/ansible/modules/network/aos/_aos_template.py +++ b/lib/ansible/modules/network/aos/_aos_template.py @@ -272,5 +272,6 @@ def main(): aos_template(module) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/avi/avi_actiongroupconfig.py b/lib/ansible/modules/network/avi/avi_actiongroupconfig.py index 2b3184e072c..6a671c2f7d2 100644 --- a/lib/ansible/modules/network/avi/avi_actiongroupconfig.py +++ b/lib/ansible/modules/network/avi/avi_actiongroupconfig.py @@ -149,5 +149,6 @@ def main(): return avi_ansible_api(module, 'actiongroupconfig', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_alertconfig.py b/lib/ansible/modules/network/avi/avi_alertconfig.py index c8821ffc3d3..dc4f2fc7aa8 100644 --- a/lib/ansible/modules/network/avi/avi_alertconfig.py +++ b/lib/ansible/modules/network/avi/avi_alertconfig.py @@ -222,5 +222,6 @@ def main(): return avi_ansible_api(module, 'alertconfig', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_alertemailconfig.py b/lib/ansible/modules/network/avi/avi_alertemailconfig.py index dd1c33bd5e7..b6651bd3fec 100644 --- a/lib/ansible/modules/network/avi/avi_alertemailconfig.py +++ b/lib/ansible/modules/network/avi/avi_alertemailconfig.py @@ -118,5 +118,6 @@ def main(): return avi_ansible_api(module, 'alertemailconfig', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_alertscriptconfig.py b/lib/ansible/modules/network/avi/avi_alertscriptconfig.py index 6114a04c845..b0d03c71501 100644 --- a/lib/ansible/modules/network/avi/avi_alertscriptconfig.py +++ b/lib/ansible/modules/network/avi/avi_alertscriptconfig.py @@ -111,5 +111,6 @@ def main(): return avi_ansible_api(module, 'alertscriptconfig', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_alertsyslogconfig.py b/lib/ansible/modules/network/avi/avi_alertsyslogconfig.py index 305ff04973a..56e1adb5055 100644 --- a/lib/ansible/modules/network/avi/avi_alertsyslogconfig.py +++ b/lib/ansible/modules/network/avi/avi_alertsyslogconfig.py @@ -117,5 +117,6 @@ def main(): return avi_ansible_api(module, 'alertsyslogconfig', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_analyticsprofile.py b/lib/ansible/modules/network/avi/avi_analyticsprofile.py index a3687e9b428..87282cf1be4 100644 --- a/lib/ansible/modules/network/avi/avi_analyticsprofile.py +++ b/lib/ansible/modules/network/avi/avi_analyticsprofile.py @@ -564,5 +564,6 @@ def main(): return avi_ansible_api(module, 'analyticsprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_api_version.py b/lib/ansible/modules/network/avi/avi_api_version.py index f0887c565ed..b26ec0fcfe0 100644 --- a/lib/ansible/modules/network/avi/avi_api_version.py +++ b/lib/ansible/modules/network/avi/avi_api_version.py @@ -85,5 +85,6 @@ def main(): except Exception as e: module.fail_json(msg="Unable to get an AVI session. {}".format(e)) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_applicationpersistenceprofile.py b/lib/ansible/modules/network/avi/avi_applicationpersistenceprofile.py index 887a5cbf4ad..e11baa21278 100644 --- a/lib/ansible/modules/network/avi/avi_applicationpersistenceprofile.py +++ b/lib/ansible/modules/network/avi/avi_applicationpersistenceprofile.py @@ -163,5 +163,6 @@ def main(): return avi_ansible_api(module, 'applicationpersistenceprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_applicationprofile.py b/lib/ansible/modules/network/avi/avi_applicationprofile.py index 5fa531d9807..149275592d1 100644 --- a/lib/ansible/modules/network/avi/avi_applicationprofile.py +++ b/lib/ansible/modules/network/avi/avi_applicationprofile.py @@ -200,5 +200,6 @@ def main(): return avi_ansible_api(module, 'applicationprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_authprofile.py b/lib/ansible/modules/network/avi/avi_authprofile.py index 90aaf9f9556..a2fc88ee55c 100644 --- a/lib/ansible/modules/network/avi/avi_authprofile.py +++ b/lib/ansible/modules/network/avi/avi_authprofile.py @@ -157,5 +157,6 @@ def main(): return avi_ansible_api(module, 'authprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_autoscalelaunchconfig.py b/lib/ansible/modules/network/avi/avi_autoscalelaunchconfig.py index ec576658571..f036d2b05b2 100644 --- a/lib/ansible/modules/network/avi/avi_autoscalelaunchconfig.py +++ b/lib/ansible/modules/network/avi/avi_autoscalelaunchconfig.py @@ -128,5 +128,6 @@ def main(): return avi_ansible_api(module, 'autoscalelaunchconfig', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_backup.py b/lib/ansible/modules/network/avi/avi_backup.py index 0f649e36dfa..49c6cec7ac9 100644 --- a/lib/ansible/modules/network/avi/avi_backup.py +++ b/lib/ansible/modules/network/avi/avi_backup.py @@ -128,5 +128,6 @@ def main(): return avi_ansible_api(module, 'backup', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_backupconfiguration.py b/lib/ansible/modules/network/avi/avi_backupconfiguration.py index 37add350b97..ab60cfc6918 100644 --- a/lib/ansible/modules/network/avi/avi_backupconfiguration.py +++ b/lib/ansible/modules/network/avi/avi_backupconfiguration.py @@ -143,5 +143,6 @@ def main(): return avi_ansible_api(module, 'backupconfiguration', set(['backup_passphrase'])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_certificatemanagementprofile.py b/lib/ansible/modules/network/avi/avi_certificatemanagementprofile.py index a23fb811f4d..44e1b8ff803 100644 --- a/lib/ansible/modules/network/avi/avi_certificatemanagementprofile.py +++ b/lib/ansible/modules/network/avi/avi_certificatemanagementprofile.py @@ -115,5 +115,6 @@ def main(): return avi_ansible_api(module, 'certificatemanagementprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_cloud.py b/lib/ansible/modules/network/avi/avi_cloud.py index 92bed828ad9..50d44dcea04 100644 --- a/lib/ansible/modules/network/avi/avi_cloud.py +++ b/lib/ansible/modules/network/avi/avi_cloud.py @@ -272,5 +272,6 @@ def main(): return avi_ansible_api(module, 'cloud', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_cloudconnectoruser.py b/lib/ansible/modules/network/avi/avi_cloudconnectoruser.py index 2cfe5e9271f..5c65eba4991 100644 --- a/lib/ansible/modules/network/avi/avi_cloudconnectoruser.py +++ b/lib/ansible/modules/network/avi/avi_cloudconnectoruser.py @@ -128,5 +128,6 @@ def main(): return avi_ansible_api(module, 'cloudconnectoruser', set(['private_key'])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_cloudproperties.py b/lib/ansible/modules/network/avi/avi_cloudproperties.py index 24a3fc76b54..79caab1ac53 100644 --- a/lib/ansible/modules/network/avi/avi_cloudproperties.py +++ b/lib/ansible/modules/network/avi/avi_cloudproperties.py @@ -115,5 +115,6 @@ def main(): return avi_ansible_api(module, 'cloudproperties', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_cluster.py b/lib/ansible/modules/network/avi/avi_cluster.py index df06eafb539..871be26f426 100644 --- a/lib/ansible/modules/network/avi/avi_cluster.py +++ b/lib/ansible/modules/network/avi/avi_cluster.py @@ -120,5 +120,6 @@ def main(): return avi_ansible_api(module, 'cluster', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_clusterclouddetails.py b/lib/ansible/modules/network/avi/avi_clusterclouddetails.py index 4bdbad79154..88fed623154 100644 --- a/lib/ansible/modules/network/avi/avi_clusterclouddetails.py +++ b/lib/ansible/modules/network/avi/avi_clusterclouddetails.py @@ -111,5 +111,6 @@ def main(): return avi_ansible_api(module, 'clusterclouddetails', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_controllerproperties.py b/lib/ansible/modules/network/avi/avi_controllerproperties.py index 16aebb12f71..cb22e54ff55 100644 --- a/lib/ansible/modules/network/avi/avi_controllerproperties.py +++ b/lib/ansible/modules/network/avi/avi_controllerproperties.py @@ -383,5 +383,6 @@ def main(): return avi_ansible_api(module, 'controllerproperties', set(['portal_token'])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_customipamdnsprofile.py b/lib/ansible/modules/network/avi/avi_customipamdnsprofile.py index 110da20229b..fb9292f7e44 100644 --- a/lib/ansible/modules/network/avi/avi_customipamdnsprofile.py +++ b/lib/ansible/modules/network/avi/avi_customipamdnsprofile.py @@ -118,5 +118,6 @@ def main(): return avi_ansible_api(module, 'customipamdnsprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_dnspolicy.py b/lib/ansible/modules/network/avi/avi_dnspolicy.py index 4206039e66c..77b0e9fb865 100644 --- a/lib/ansible/modules/network/avi/avi_dnspolicy.py +++ b/lib/ansible/modules/network/avi/avi_dnspolicy.py @@ -123,5 +123,6 @@ def main(): return avi_ansible_api(module, 'dnspolicy', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_errorpagebody.py b/lib/ansible/modules/network/avi/avi_errorpagebody.py index f49a168fe6c..477bae5b30d 100644 --- a/lib/ansible/modules/network/avi/avi_errorpagebody.py +++ b/lib/ansible/modules/network/avi/avi_errorpagebody.py @@ -111,5 +111,6 @@ def main(): return avi_ansible_api(module, 'errorpagebody', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_errorpageprofile.py b/lib/ansible/modules/network/avi/avi_errorpageprofile.py index c40c8b78b02..1621a2fbde6 100644 --- a/lib/ansible/modules/network/avi/avi_errorpageprofile.py +++ b/lib/ansible/modules/network/avi/avi_errorpageprofile.py @@ -129,5 +129,6 @@ def main(): return avi_ansible_api(module, 'errorpageprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_gslb.py b/lib/ansible/modules/network/avi/avi_gslb.py index 70228398615..45a79d977b3 100644 --- a/lib/ansible/modules/network/avi/avi_gslb.py +++ b/lib/ansible/modules/network/avi/avi_gslb.py @@ -176,5 +176,6 @@ def main(): return avi_ansible_api(module, 'gslb', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_gslbapplicationpersistenceprofile.py b/lib/ansible/modules/network/avi/avi_gslbapplicationpersistenceprofile.py index 2042a4290d6..d51bb164701 100644 --- a/lib/ansible/modules/network/avi/avi_gslbapplicationpersistenceprofile.py +++ b/lib/ansible/modules/network/avi/avi_gslbapplicationpersistenceprofile.py @@ -112,5 +112,6 @@ def main(): return avi_ansible_api(module, 'gslbapplicationpersistenceprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_gslbgeodbprofile.py b/lib/ansible/modules/network/avi/avi_gslbgeodbprofile.py index 29735340eec..5cf1937a9a3 100644 --- a/lib/ansible/modules/network/avi/avi_gslbgeodbprofile.py +++ b/lib/ansible/modules/network/avi/avi_gslbgeodbprofile.py @@ -126,5 +126,6 @@ def main(): return avi_ansible_api(module, 'gslbgeodbprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_gslbhealthmonitor.py b/lib/ansible/modules/network/avi/avi_gslbhealthmonitor.py index f6ad0e21487..b931d10b408 100644 --- a/lib/ansible/modules/network/avi/avi_gslbhealthmonitor.py +++ b/lib/ansible/modules/network/avi/avi_gslbhealthmonitor.py @@ -173,5 +173,6 @@ def main(): return avi_ansible_api(module, 'gslbhealthmonitor', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_gslbservice.py b/lib/ansible/modules/network/avi/avi_gslbservice.py index 2851c673f03..03c5399557b 100644 --- a/lib/ansible/modules/network/avi/avi_gslbservice.py +++ b/lib/ansible/modules/network/avi/avi_gslbservice.py @@ -226,5 +226,6 @@ def main(): return avi_ansible_api(module, 'gslbservice', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_hardwaresecuritymodulegroup.py b/lib/ansible/modules/network/avi/avi_hardwaresecuritymodulegroup.py index 85f0298575a..61b26acc765 100644 --- a/lib/ansible/modules/network/avi/avi_hardwaresecuritymodulegroup.py +++ b/lib/ansible/modules/network/avi/avi_hardwaresecuritymodulegroup.py @@ -110,5 +110,6 @@ def main(): return avi_ansible_api(module, 'hardwaresecuritymodulegroup', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_healthmonitor.py b/lib/ansible/modules/network/avi/avi_healthmonitor.py index 7b521076f38..8881c8b0f28 100644 --- a/lib/ansible/modules/network/avi/avi_healthmonitor.py +++ b/lib/ansible/modules/network/avi/avi_healthmonitor.py @@ -195,5 +195,6 @@ def main(): return avi_ansible_api(module, 'healthmonitor', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_httppolicyset.py b/lib/ansible/modules/network/avi/avi_httppolicyset.py index 2ec38d87765..0dc42b61f27 100644 --- a/lib/ansible/modules/network/avi/avi_httppolicyset.py +++ b/lib/ansible/modules/network/avi/avi_httppolicyset.py @@ -166,5 +166,6 @@ def main(): return avi_ansible_api(module, 'httppolicyset', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_ipaddrgroup.py b/lib/ansible/modules/network/avi/avi_ipaddrgroup.py index bfd5f0f9209..fd2cd3c38ff 100644 --- a/lib/ansible/modules/network/avi/avi_ipaddrgroup.py +++ b/lib/ansible/modules/network/avi/avi_ipaddrgroup.py @@ -156,5 +156,6 @@ def main(): return avi_ansible_api(module, 'ipaddrgroup', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_ipamdnsproviderprofile.py b/lib/ansible/modules/network/avi/avi_ipamdnsproviderprofile.py index 1ce046fb4b1..51f61887004 100644 --- a/lib/ansible/modules/network/avi/avi_ipamdnsproviderprofile.py +++ b/lib/ansible/modules/network/avi/avi_ipamdnsproviderprofile.py @@ -168,5 +168,6 @@ def main(): return avi_ansible_api(module, 'ipamdnsproviderprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_l4policyset.py b/lib/ansible/modules/network/avi/avi_l4policyset.py index f9517e833f3..33817b58104 100644 --- a/lib/ansible/modules/network/avi/avi_l4policyset.py +++ b/lib/ansible/modules/network/avi/avi_l4policyset.py @@ -126,5 +126,6 @@ def main(): return avi_ansible_api(module, 'l4policyset', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_microservicegroup.py b/lib/ansible/modules/network/avi/avi_microservicegroup.py index 17dafc24f46..86116ae6112 100644 --- a/lib/ansible/modules/network/avi/avi_microservicegroup.py +++ b/lib/ansible/modules/network/avi/avi_microservicegroup.py @@ -119,5 +119,6 @@ def main(): return avi_ansible_api(module, 'microservicegroup', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_network.py b/lib/ansible/modules/network/avi/avi_network.py index 9053699bcc4..c0acbfd479b 100644 --- a/lib/ansible/modules/network/avi/avi_network.py +++ b/lib/ansible/modules/network/avi/avi_network.py @@ -146,5 +146,6 @@ def main(): return avi_ansible_api(module, 'network', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_networkprofile.py b/lib/ansible/modules/network/avi/avi_networkprofile.py index a265f025492..09a5a160cef 100644 --- a/lib/ansible/modules/network/avi/avi_networkprofile.py +++ b/lib/ansible/modules/network/avi/avi_networkprofile.py @@ -121,5 +121,6 @@ def main(): return avi_ansible_api(module, 'networkprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_networksecuritypolicy.py b/lib/ansible/modules/network/avi/avi_networksecuritypolicy.py index 5600229fad4..d6ff13a39d5 100644 --- a/lib/ansible/modules/network/avi/avi_networksecuritypolicy.py +++ b/lib/ansible/modules/network/avi/avi_networksecuritypolicy.py @@ -134,5 +134,6 @@ def main(): return avi_ansible_api(module, 'networksecuritypolicy', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_pkiprofile.py b/lib/ansible/modules/network/avi/avi_pkiprofile.py index 0bc4125de72..887330460b0 100644 --- a/lib/ansible/modules/network/avi/avi_pkiprofile.py +++ b/lib/ansible/modules/network/avi/avi_pkiprofile.py @@ -148,5 +148,6 @@ def main(): return avi_ansible_api(module, 'pkiprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_pool.py b/lib/ansible/modules/network/avi/avi_pool.py index 50122f2d4ad..265ee963a7b 100644 --- a/lib/ansible/modules/network/avi/avi_pool.py +++ b/lib/ansible/modules/network/avi/avi_pool.py @@ -446,5 +446,6 @@ def main(): return avi_ansible_api(module, 'pool', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_poolgroup.py b/lib/ansible/modules/network/avi/avi_poolgroup.py index cbdef5d6402..01da7f45f7c 100644 --- a/lib/ansible/modules/network/avi/avi_poolgroup.py +++ b/lib/ansible/modules/network/avi/avi_poolgroup.py @@ -158,5 +158,6 @@ def main(): return avi_ansible_api(module, 'poolgroup', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_poolgroupdeploymentpolicy.py b/lib/ansible/modules/network/avi/avi_poolgroupdeploymentpolicy.py index 6f293325533..e1ae8bb626a 100644 --- a/lib/ansible/modules/network/avi/avi_poolgroupdeploymentpolicy.py +++ b/lib/ansible/modules/network/avi/avi_poolgroupdeploymentpolicy.py @@ -157,5 +157,6 @@ def main(): return avi_ansible_api(module, 'poolgroupdeploymentpolicy', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_prioritylabels.py b/lib/ansible/modules/network/avi/avi_prioritylabels.py index 50fe935487d..c8a268c57d1 100644 --- a/lib/ansible/modules/network/avi/avi_prioritylabels.py +++ b/lib/ansible/modules/network/avi/avi_prioritylabels.py @@ -117,5 +117,6 @@ def main(): return avi_ansible_api(module, 'prioritylabels', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_role.py b/lib/ansible/modules/network/avi/avi_role.py index abb495f75b1..a6e9b846d62 100644 --- a/lib/ansible/modules/network/avi/avi_role.py +++ b/lib/ansible/modules/network/avi/avi_role.py @@ -110,5 +110,6 @@ def main(): return avi_ansible_api(module, 'role', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_scheduler.py b/lib/ansible/modules/network/avi/avi_scheduler.py index d6888a7678f..3d0b735ac68 100644 --- a/lib/ansible/modules/network/avi/avi_scheduler.py +++ b/lib/ansible/modules/network/avi/avi_scheduler.py @@ -151,5 +151,6 @@ def main(): return avi_ansible_api(module, 'scheduler', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_seproperties.py b/lib/ansible/modules/network/avi/avi_seproperties.py index dfbe9901a30..c98cb93db49 100644 --- a/lib/ansible/modules/network/avi/avi_seproperties.py +++ b/lib/ansible/modules/network/avi/avi_seproperties.py @@ -110,5 +110,6 @@ def main(): return avi_ansible_api(module, 'seproperties', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_serverautoscalepolicy.py b/lib/ansible/modules/network/avi/avi_serverautoscalepolicy.py index ca05404f063..848944e98b4 100644 --- a/lib/ansible/modules/network/avi/avi_serverautoscalepolicy.py +++ b/lib/ansible/modules/network/avi/avi_serverautoscalepolicy.py @@ -179,5 +179,6 @@ def main(): return avi_ansible_api(module, 'serverautoscalepolicy', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_serviceengine.py b/lib/ansible/modules/network/avi/avi_serviceengine.py index 242a9426a27..00e5502e5cf 100644 --- a/lib/ansible/modules/network/avi/avi_serviceengine.py +++ b/lib/ansible/modules/network/avi/avi_serviceengine.py @@ -168,5 +168,6 @@ def main(): return avi_ansible_api(module, 'serviceengine', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_serviceenginegroup.py b/lib/ansible/modules/network/avi/avi_serviceenginegroup.py index a7bd1c2d03e..a03e63ece56 100644 --- a/lib/ansible/modules/network/avi/avi_serviceenginegroup.py +++ b/lib/ansible/modules/network/avi/avi_serviceenginegroup.py @@ -774,5 +774,6 @@ def main(): return avi_ansible_api(module, 'serviceenginegroup', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_snmptrapprofile.py b/lib/ansible/modules/network/avi/avi_snmptrapprofile.py index cf7ba25c932..f502d9548a8 100644 --- a/lib/ansible/modules/network/avi/avi_snmptrapprofile.py +++ b/lib/ansible/modules/network/avi/avi_snmptrapprofile.py @@ -109,5 +109,6 @@ def main(): return avi_ansible_api(module, 'snmptrapprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_sslkeyandcertificate.py b/lib/ansible/modules/network/avi/avi_sslkeyandcertificate.py index a80d1d0f7c7..1d253515ea2 100644 --- a/lib/ansible/modules/network/avi/avi_sslkeyandcertificate.py +++ b/lib/ansible/modules/network/avi/avi_sslkeyandcertificate.py @@ -169,5 +169,6 @@ def main(): return avi_ansible_api(module, 'sslkeyandcertificate', set(['key'])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_sslprofile.py b/lib/ansible/modules/network/avi/avi_sslprofile.py index a36b183e008..a2b2822942a 100644 --- a/lib/ansible/modules/network/avi/avi_sslprofile.py +++ b/lib/ansible/modules/network/avi/avi_sslprofile.py @@ -208,5 +208,6 @@ def main(): return avi_ansible_api(module, 'sslprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_stringgroup.py b/lib/ansible/modules/network/avi/avi_stringgroup.py index a30b3b21644..46ada6147c2 100644 --- a/lib/ansible/modules/network/avi/avi_stringgroup.py +++ b/lib/ansible/modules/network/avi/avi_stringgroup.py @@ -132,5 +132,6 @@ def main(): return avi_ansible_api(module, 'stringgroup', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_systemconfiguration.py b/lib/ansible/modules/network/avi/avi_systemconfiguration.py index 039507714ba..71f6f750eaf 100644 --- a/lib/ansible/modules/network/avi/avi_systemconfiguration.py +++ b/lib/ansible/modules/network/avi/avi_systemconfiguration.py @@ -170,5 +170,6 @@ def main(): return avi_ansible_api(module, 'systemconfiguration', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_tenant.py b/lib/ansible/modules/network/avi/avi_tenant.py index e2aa6a89b31..9072fe8baf1 100644 --- a/lib/ansible/modules/network/avi/avi_tenant.py +++ b/lib/ansible/modules/network/avi/avi_tenant.py @@ -125,5 +125,6 @@ def main(): return avi_ansible_api(module, 'tenant', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_trafficcloneprofile.py b/lib/ansible/modules/network/avi/avi_trafficcloneprofile.py index fb4e8bf05c5..7966e61d8fe 100644 --- a/lib/ansible/modules/network/avi/avi_trafficcloneprofile.py +++ b/lib/ansible/modules/network/avi/avi_trafficcloneprofile.py @@ -124,5 +124,6 @@ def main(): return avi_ansible_api(module, 'trafficcloneprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_useraccountprofile.py b/lib/ansible/modules/network/avi/avi_useraccountprofile.py index e8982f1fe8c..1639fa9fd15 100644 --- a/lib/ansible/modules/network/avi/avi_useraccountprofile.py +++ b/lib/ansible/modules/network/avi/avi_useraccountprofile.py @@ -134,5 +134,6 @@ def main(): return avi_ansible_api(module, 'useraccountprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_virtualservice.py b/lib/ansible/modules/network/avi/avi_virtualservice.py index 2d5e29c7e8d..4981e374528 100644 --- a/lib/ansible/modules/network/avi/avi_virtualservice.py +++ b/lib/ansible/modules/network/avi/avi_virtualservice.py @@ -602,5 +602,6 @@ def main(): return avi_ansible_api(module, 'virtualservice', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_vrfcontext.py b/lib/ansible/modules/network/avi/avi_vrfcontext.py index 14e09957666..a5e391747d4 100644 --- a/lib/ansible/modules/network/avi/avi_vrfcontext.py +++ b/lib/ansible/modules/network/avi/avi_vrfcontext.py @@ -142,5 +142,6 @@ def main(): return avi_ansible_api(module, 'vrfcontext', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_vsdatascriptset.py b/lib/ansible/modules/network/avi/avi_vsdatascriptset.py index 2f27a6fa28c..102707dd55a 100644 --- a/lib/ansible/modules/network/avi/avi_vsdatascriptset.py +++ b/lib/ansible/modules/network/avi/avi_vsdatascriptset.py @@ -140,5 +140,6 @@ def main(): return avi_ansible_api(module, 'vsdatascriptset', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_vsvip.py b/lib/ansible/modules/network/avi/avi_vsvip.py index bce260bd7a4..752ac899ca1 100644 --- a/lib/ansible/modules/network/avi/avi_vsvip.py +++ b/lib/ansible/modules/network/avi/avi_vsvip.py @@ -138,5 +138,6 @@ def main(): return avi_ansible_api(module, 'vsvip', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_wafpolicy.py b/lib/ansible/modules/network/avi/avi_wafpolicy.py index d97fdd6c37b..63ae3d02cee 100644 --- a/lib/ansible/modules/network/avi/avi_wafpolicy.py +++ b/lib/ansible/modules/network/avi/avi_wafpolicy.py @@ -157,5 +157,6 @@ def main(): return avi_ansible_api(module, 'wafpolicy', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_wafprofile.py b/lib/ansible/modules/network/avi/avi_wafprofile.py index 01e4fb2d47e..56c22162187 100644 --- a/lib/ansible/modules/network/avi/avi_wafprofile.py +++ b/lib/ansible/modules/network/avi/avi_wafprofile.py @@ -121,5 +121,6 @@ def main(): return avi_ansible_api(module, 'wafprofile', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/avi/avi_webhook.py b/lib/ansible/modules/network/avi/avi_webhook.py index 5ec573669b8..5d26b86fbca 100644 --- a/lib/ansible/modules/network/avi/avi_webhook.py +++ b/lib/ansible/modules/network/avi/avi_webhook.py @@ -122,5 +122,6 @@ def main(): return avi_ansible_api(module, 'webhook', set([])) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/bigswitch/bigmon_policy.py b/lib/ansible/modules/network/bigswitch/bigmon_policy.py index e3a288fb170..e125646bd9a 100644 --- a/lib/ansible/modules/network/bigswitch/bigmon_policy.py +++ b/lib/ansible/modules/network/bigswitch/bigmon_policy.py @@ -183,5 +183,6 @@ def main(): except Exception as e: module.fail_json(msg=to_native(e), exception=traceback.format_exc()) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/cloudengine/ce_vrf_interface.py b/lib/ansible/modules/network/cloudengine/ce_vrf_interface.py index 9e1dd546548..6bcaa21f0c5 100644 --- a/lib/ansible/modules/network/cloudengine/ce_vrf_interface.py +++ b/lib/ansible/modules/network/cloudengine/ce_vrf_interface.py @@ -512,5 +512,6 @@ def main(): vrf_intf = VrfInterface(argument_spec) vrf_intf.work() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/cnos/cnos_conditional_command.py b/lib/ansible/modules/network/cnos/cnos_conditional_command.py index fc6b79a482d..6c2bc1a4a0b 100644 --- a/lib/ansible/modules/network/cnos/cnos_conditional_command.py +++ b/lib/ansible/modules/network/cnos/cnos_conditional_command.py @@ -188,5 +188,6 @@ def main(): else: module.fail_json(msg=errorMsg) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/cnos/cnos_conditional_template.py b/lib/ansible/modules/network/cnos/cnos_conditional_template.py index 1ffe6a4f904..781ce8810a8 100644 --- a/lib/ansible/modules/network/cnos/cnos_conditional_template.py +++ b/lib/ansible/modules/network/cnos/cnos_conditional_template.py @@ -214,5 +214,6 @@ def main(): else: module.fail_json(msg=errorMsg) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/cnos/cnos_factory.py b/lib/ansible/modules/network/cnos/cnos_factory.py index 3b398c45343..9b56bfd827f 100644 --- a/lib/ansible/modules/network/cnos/cnos_factory.py +++ b/lib/ansible/modules/network/cnos/cnos_factory.py @@ -149,5 +149,6 @@ def main(): else: module.fail_json(msg=errorMsg) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/cnos/cnos_facts.py b/lib/ansible/modules/network/cnos/cnos_facts.py index e450f1a2875..5abcb23d155 100644 --- a/lib/ansible/modules/network/cnos/cnos_facts.py +++ b/lib/ansible/modules/network/cnos/cnos_facts.py @@ -511,6 +511,7 @@ class Interfaces(FactsBase): parsed.append(line) return parsed + FACT_SUBSETS = dict( default=Default, hardware=Hardware, diff --git a/lib/ansible/modules/network/cnos/cnos_image.py b/lib/ansible/modules/network/cnos/cnos_image.py index 6763351c8e4..9dfa49fb89c 100644 --- a/lib/ansible/modules/network/cnos/cnos_image.py +++ b/lib/ansible/modules/network/cnos/cnos_image.py @@ -220,5 +220,6 @@ def main(): else: module.fail_json(msg=errorMsg) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/cnos/cnos_portchannel.py b/lib/ansible/modules/network/cnos/cnos_portchannel.py index eef2a9a957b..2f13355e498 100644 --- a/lib/ansible/modules/network/cnos/cnos_portchannel.py +++ b/lib/ansible/modules/network/cnos/cnos_portchannel.py @@ -432,5 +432,6 @@ def main(): else: module.fail_json(msg=errorMsg) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/cnos/cnos_reload.py b/lib/ansible/modules/network/cnos/cnos_reload.py index bcd9317c314..23468cfd930 100644 --- a/lib/ansible/modules/network/cnos/cnos_reload.py +++ b/lib/ansible/modules/network/cnos/cnos_reload.py @@ -148,5 +148,6 @@ def main(): else: module.fail_json(msg=errorMsg) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/cnos/cnos_rollback.py b/lib/ansible/modules/network/cnos/cnos_rollback.py index e838ae868c6..27f691f9390 100644 --- a/lib/ansible/modules/network/cnos/cnos_rollback.py +++ b/lib/ansible/modules/network/cnos/cnos_rollback.py @@ -272,5 +272,6 @@ def main(): else: module.fail_json(msg=errorMsg) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/cnos/cnos_save.py b/lib/ansible/modules/network/cnos/cnos_save.py index 0f48ad0c002..c612c0b16d9 100644 --- a/lib/ansible/modules/network/cnos/cnos_save.py +++ b/lib/ansible/modules/network/cnos/cnos_save.py @@ -147,5 +147,6 @@ def main(): else: module.fail_json(msg=errorMsg) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/cnos/cnos_showrun.py b/lib/ansible/modules/network/cnos/cnos_showrun.py index b1bfd5379a6..787d01f68ed 100644 --- a/lib/ansible/modules/network/cnos/cnos_showrun.py +++ b/lib/ansible/modules/network/cnos/cnos_showrun.py @@ -145,5 +145,6 @@ def main(): else: module.fail_json(msg=errorMsg) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/cnos/cnos_template.py b/lib/ansible/modules/network/cnos/cnos_template.py index 50de0260253..a942c0e6f2a 100644 --- a/lib/ansible/modules/network/cnos/cnos_template.py +++ b/lib/ansible/modules/network/cnos/cnos_template.py @@ -185,5 +185,6 @@ def main(): else: module.fail_json(msg=errorMsg) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/cnos/cnos_vlan.py b/lib/ansible/modules/network/cnos/cnos_vlan.py index 31b7bde93de..4d1fd6dc7f8 100644 --- a/lib/ansible/modules/network/cnos/cnos_vlan.py +++ b/lib/ansible/modules/network/cnos/cnos_vlan.py @@ -235,5 +235,6 @@ def main(): else: module.fail_json(msg=errorMsg) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/dellos9/dellos9_config.py b/lib/ansible/modules/network/dellos9/dellos9_config.py index e8195eea8e9..63cf00797d4 100644 --- a/lib/ansible/modules/network/dellos9/dellos9_config.py +++ b/lib/ansible/modules/network/dellos9/dellos9_config.py @@ -306,5 +306,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/enos/enos_facts.py b/lib/ansible/modules/network/enos/enos_facts.py index c8bf758b97b..4205656da2e 100644 --- a/lib/ansible/modules/network/enos/enos_facts.py +++ b/lib/ansible/modules/network/enos/enos_facts.py @@ -422,6 +422,7 @@ class Interfaces(FactsBase): parsed.append(line) return parsed + FACT_SUBSETS = dict( default=Default, hardware=Hardware, diff --git a/lib/ansible/modules/network/eos/eos_banner.py b/lib/ansible/modules/network/eos/eos_banner.py index 18d12d5807b..f14f08fa1e7 100644 --- a/lib/ansible/modules/network/eos/eos_banner.py +++ b/lib/ansible/modules/network/eos/eos_banner.py @@ -195,5 +195,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/eos/eos_linkagg.py b/lib/ansible/modules/network/eos/eos_linkagg.py index b60e8afd679..b0727c25811 100644 --- a/lib/ansible/modules/network/eos/eos_linkagg.py +++ b/lib/ansible/modules/network/eos/eos_linkagg.py @@ -344,5 +344,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/eos/eos_lldp.py b/lib/ansible/modules/network/eos/eos_lldp.py index 19b76c2e92b..b9fbf91e540 100644 --- a/lib/ansible/modules/network/eos/eos_lldp.py +++ b/lib/ansible/modules/network/eos/eos_lldp.py @@ -109,5 +109,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/eos/eos_static_route.py b/lib/ansible/modules/network/eos/eos_static_route.py index 013a6804db4..44a8f58a615 100644 --- a/lib/ansible/modules/network/eos/eos_static_route.py +++ b/lib/ansible/modules/network/eos/eos_static_route.py @@ -249,5 +249,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/eos/eos_system.py b/lib/ansible/modules/network/eos/eos_system.py index 05b24fbd051..9d103938115 100644 --- a/lib/ansible/modules/network/eos/eos_system.py +++ b/lib/ansible/modules/network/eos/eos_system.py @@ -334,5 +334,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/eos/eos_user.py b/lib/ansible/modules/network/eos/eos_user.py index 627c14c96cf..a88b8f2ff6a 100644 --- a/lib/ansible/modules/network/eos/eos_user.py +++ b/lib/ansible/modules/network/eos/eos_user.py @@ -403,5 +403,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/f5/bigip_asm_policy.py b/lib/ansible/modules/network/f5/bigip_asm_policy.py index 32ca47f9218..a6c53ac60d4 100644 --- a/lib/ansible/modules/network/f5/bigip_asm_policy.py +++ b/lib/ansible/modules/network/f5/bigip_asm_policy.py @@ -853,5 +853,6 @@ def main(): cleanup_tokens(client) module.fail_json(msg=str(e)) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/f5/bigip_gtm_server.py b/lib/ansible/modules/network/f5/bigip_gtm_server.py index 842aa801ad1..66c311dba58 100644 --- a/lib/ansible/modules/network/f5/bigip_gtm_server.py +++ b/lib/ansible/modules/network/f5/bigip_gtm_server.py @@ -837,5 +837,6 @@ def main(): cleanup_tokens(client) module.fail_json(msg=str(ex)) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/ios/ios_banner.py b/lib/ansible/modules/network/ios/ios_banner.py index 8694813ce71..f7c63a909f0 100644 --- a/lib/ansible/modules/network/ios/ios_banner.py +++ b/lib/ansible/modules/network/ios/ios_banner.py @@ -182,5 +182,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/ios/ios_config.py b/lib/ansible/modules/network/ios/ios_config.py index 6459025dc0d..7f6865ab748 100644 --- a/lib/ansible/modules/network/ios/ios_config.py +++ b/lib/ansible/modules/network/ios/ios_config.py @@ -514,5 +514,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/ios/ios_interface.py b/lib/ansible/modules/network/ios/ios_interface.py index 93e42bc276b..a12645d4850 100644 --- a/lib/ansible/modules/network/ios/ios_interface.py +++ b/lib/ansible/modules/network/ios/ios_interface.py @@ -486,5 +486,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/ios/ios_linkagg.py b/lib/ansible/modules/network/ios/ios_linkagg.py index e07c18b0e57..e490cae88b4 100644 --- a/lib/ansible/modules/network/ios/ios_linkagg.py +++ b/lib/ansible/modules/network/ios/ios_linkagg.py @@ -312,5 +312,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/ios/ios_system.py b/lib/ansible/modules/network/ios/ios_system.py index 0d59fe8121d..44498b97ffb 100644 --- a/lib/ansible/modules/network/ios/ios_system.py +++ b/lib/ansible/modules/network/ios/ios_system.py @@ -376,5 +376,6 @@ def main(): module.exit_json(**result) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/ios/ios_user.py b/lib/ansible/modules/network/ios/ios_user.py index 75bb2ec0e10..06f4f425a5d 100644 --- a/lib/ansible/modules/network/ios/ios_user.py +++ b/lib/ansible/modules/network/ios/ios_user.py @@ -455,5 +455,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/iosxr/iosxr_command.py b/lib/ansible/modules/network/iosxr/iosxr_command.py index 062abd3ae63..6adc7738f9e 100644 --- a/lib/ansible/modules/network/iosxr/iosxr_command.py +++ b/lib/ansible/modules/network/iosxr/iosxr_command.py @@ -217,5 +217,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/iosxr/iosxr_logging.py b/lib/ansible/modules/network/iosxr/iosxr_logging.py index e1645a91297..43540f5b986 100644 --- a/lib/ansible/modules/network/iosxr/iosxr_logging.py +++ b/lib/ansible/modules/network/iosxr/iosxr_logging.py @@ -721,5 +721,6 @@ def main(): result = config_object.run() module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/iosxr/iosxr_user.py b/lib/ansible/modules/network/iosxr/iosxr_user.py index eb7693cceeb..1eb69a35bc8 100644 --- a/lib/ansible/modules/network/iosxr/iosxr_user.py +++ b/lib/ansible/modules/network/iosxr/iosxr_user.py @@ -703,5 +703,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/junos/junos_banner.py b/lib/ansible/modules/network/junos/junos_banner.py index aac07c2d889..976bd686310 100644 --- a/lib/ansible/modules/network/junos/junos_banner.py +++ b/lib/ansible/modules/network/junos/junos_banner.py @@ -172,5 +172,6 @@ def main(): module.exit_json(**result) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/junos/junos_command.py b/lib/ansible/modules/network/junos/junos_command.py index 15575a9920e..4352de9b97e 100644 --- a/lib/ansible/modules/network/junos/junos_command.py +++ b/lib/ansible/modules/network/junos/junos_command.py @@ -446,5 +446,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/junos/junos_interface.py b/lib/ansible/modules/network/junos/junos_interface.py index bd06f7170bf..6c8ce9246fc 100644 --- a/lib/ansible/modules/network/junos/junos_interface.py +++ b/lib/ansible/modules/network/junos/junos_interface.py @@ -382,5 +382,6 @@ def main(): module.exit_json(**result) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/junos/junos_l3_interface.py b/lib/ansible/modules/network/junos/junos_l3_interface.py index f4cf98721fa..3b8d3935bd3 100644 --- a/lib/ansible/modules/network/junos/junos_l3_interface.py +++ b/lib/ansible/modules/network/junos/junos_l3_interface.py @@ -196,5 +196,6 @@ def main(): module.exit_json(**result) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/junos/junos_linkagg.py b/lib/ansible/modules/network/junos/junos_linkagg.py index 7b251eb55fd..91be5e0fd48 100644 --- a/lib/ansible/modules/network/junos/junos_linkagg.py +++ b/lib/ansible/modules/network/junos/junos_linkagg.py @@ -338,5 +338,6 @@ def main(): module.exit_json(**result) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/junos/junos_lldp_interface.py b/lib/ansible/modules/network/junos/junos_lldp_interface.py index 5e683c74f63..2da78c62f24 100644 --- a/lib/ansible/modules/network/junos/junos_lldp_interface.py +++ b/lib/ansible/modules/network/junos/junos_lldp_interface.py @@ -157,5 +157,6 @@ def main(): module.exit_json(**result) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/junos/junos_logging.py b/lib/ansible/modules/network/junos/junos_logging.py index 60fe0c52d4b..3f99f749db7 100644 --- a/lib/ansible/modules/network/junos/junos_logging.py +++ b/lib/ansible/modules/network/junos/junos_logging.py @@ -279,5 +279,6 @@ def main(): module.exit_json(**result) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/junos/junos_static_route.py b/lib/ansible/modules/network/junos/junos_static_route.py index e34dafd2c8b..fbb1aa28f93 100644 --- a/lib/ansible/modules/network/junos/junos_static_route.py +++ b/lib/ansible/modules/network/junos/junos_static_route.py @@ -231,5 +231,6 @@ def main(): module.exit_json(**result) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/junos/junos_system.py b/lib/ansible/modules/network/junos/junos_system.py index f8f7b4f68e8..638c655ca3f 100644 --- a/lib/ansible/modules/network/junos/junos_system.py +++ b/lib/ansible/modules/network/junos/junos_system.py @@ -185,5 +185,6 @@ def main(): module.exit_json(**result) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/junos/junos_user.py b/lib/ansible/modules/network/junos/junos_user.py index 89033e043da..81015decedc 100644 --- a/lib/ansible/modules/network/junos/junos_user.py +++ b/lib/ansible/modules/network/junos/junos_user.py @@ -336,5 +336,6 @@ def main(): module.exit_json(**result) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/junos/junos_vlan.py b/lib/ansible/modules/network/junos/junos_vlan.py index 89a622b183d..404f63e5cfa 100644 --- a/lib/ansible/modules/network/junos/junos_vlan.py +++ b/lib/ansible/modules/network/junos/junos_vlan.py @@ -219,5 +219,6 @@ def main(): module.exit_json(**result) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/junos/junos_vrf.py b/lib/ansible/modules/network/junos/junos_vrf.py index ef80edb637f..1ea4acae6f9 100644 --- a/lib/ansible/modules/network/junos/junos_vrf.py +++ b/lib/ansible/modules/network/junos/junos_vrf.py @@ -266,5 +266,6 @@ def main(): module.exit_json(**result) + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/network/netconf/netconf_get.py b/lib/ansible/modules/network/netconf/netconf_get.py index a4b9050c805..823bd87aefb 100644 --- a/lib/ansible/modules/network/netconf/netconf_get.py +++ b/lib/ansible/modules/network/netconf/netconf_get.py @@ -254,5 +254,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/netconf/netconf_rpc.py b/lib/ansible/modules/network/netconf/netconf_rpc.py index b1e013b3ab0..bfeae9482f4 100644 --- a/lib/ansible/modules/network/netconf/netconf_rpc.py +++ b/lib/ansible/modules/network/netconf/netconf_rpc.py @@ -258,5 +258,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/netvisor/pn_cluster.py b/lib/ansible/modules/network/netvisor/pn_cluster.py index dada1d16dc6..af326541ce3 100644 --- a/lib/ansible/modules/network/netvisor/pn_cluster.py +++ b/lib/ansible/modules/network/netvisor/pn_cluster.py @@ -112,6 +112,9 @@ changed: import shlex +# AnsibleModule boilerplate +from ansible.module_utils.basic import AnsibleModule + NAME_EXISTS = None NODE1_EXISTS = None NODE2_EXISTS = None @@ -310,8 +313,6 @@ def main(): run_cli(module, cli) -# AnsibleModule boilerplate -from ansible.module_utils.basic import AnsibleModule if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/netvisor/pn_ospf.py b/lib/ansible/modules/network/netvisor/pn_ospf.py index 0bd698132c7..d06badf16fe 100644 --- a/lib/ansible/modules/network/netvisor/pn_ospf.py +++ b/lib/ansible/modules/network/netvisor/pn_ospf.py @@ -101,6 +101,9 @@ changed: import shlex +# AnsibleModule boilerplate +from ansible.module_utils.basic import AnsibleModule + VROUTER_EXISTS = None NETWORK_EXISTS = None @@ -287,8 +290,7 @@ def main(): % (command, vrouter_name, network_ip)) run_cli(module, cli) -# AnsibleModule boilerplate -from ansible.module_utils.basic import AnsibleModule + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/netvisor/pn_ospfarea.py b/lib/ansible/modules/network/netvisor/pn_ospfarea.py index 34739d451da..8e10d38d12f 100644 --- a/lib/ansible/modules/network/netvisor/pn_ospfarea.py +++ b/lib/ansible/modules/network/netvisor/pn_ospfarea.py @@ -116,6 +116,9 @@ changed: import shlex +# AnsibleModule boilerplate +from ansible.module_utils.basic import AnsibleModule + def get_command_from_state(state): """ @@ -214,8 +217,6 @@ def main(): changed=True ) -# AnsibleModule boilerplate -from ansible.module_utils.basic import AnsibleModule if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/netvisor/pn_show.py b/lib/ansible/modules/network/netvisor/pn_show.py index 3fa956ebd40..db14c5ae36c 100644 --- a/lib/ansible/modules/network/netvisor/pn_show.py +++ b/lib/ansible/modules/network/netvisor/pn_show.py @@ -97,6 +97,9 @@ changed: import shlex +# AnsibleModule boilerplate +from ansible.module_utils.basic import AnsibleModule + def pn_cli(module): """ @@ -192,8 +195,6 @@ def main(): run_cli(module, cli) -# AnsibleModule boilerplate -from ansible.module_utils.basic import AnsibleModule if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/netvisor/pn_trunk.py b/lib/ansible/modules/network/netvisor/pn_trunk.py index a9065315cc3..98e005a8447 100644 --- a/lib/ansible/modules/network/netvisor/pn_trunk.py +++ b/lib/ansible/modules/network/netvisor/pn_trunk.py @@ -163,6 +163,9 @@ changed: import shlex +# Ansible boiler-plate +from ansible.module_utils.basic import AnsibleModule + TRUNK_EXISTS = None @@ -445,8 +448,6 @@ def main(): run_cli(module, cli) -# Ansible boiler-plate -from ansible.module_utils.basic import AnsibleModule if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/netvisor/pn_vlag.py b/lib/ansible/modules/network/netvisor/pn_vlag.py index 47962d702c1..67b3ba24e0f 100644 --- a/lib/ansible/modules/network/netvisor/pn_vlag.py +++ b/lib/ansible/modules/network/netvisor/pn_vlag.py @@ -135,6 +135,9 @@ changed: import shlex +# AnsibleModule boilerplate +from ansible.module_utils.basic import AnsibleModule + VLAG_EXISTS = None @@ -340,8 +343,6 @@ def main(): run_cli(module, cli) -# AnsibleModule boilerplate -from ansible.module_utils.basic import AnsibleModule if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/netvisor/pn_vlan.py b/lib/ansible/modules/network/netvisor/pn_vlan.py index b455a5b8143..9c492563839 100644 --- a/lib/ansible/modules/network/netvisor/pn_vlan.py +++ b/lib/ansible/modules/network/netvisor/pn_vlan.py @@ -115,6 +115,9 @@ changed: import shlex +# AnsibleModule boilerplate +from ansible.module_utils.basic import AnsibleModule + VLAN_EXISTS = None MAX_VLAN_ID = 4092 MIN_VLAN_ID = 2 @@ -305,8 +308,6 @@ def main(): run_cli(module, cli) -# AnsibleModule boilerplate -from ansible.module_utils.basic import AnsibleModule if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/netvisor/pn_vrouter.py b/lib/ansible/modules/network/netvisor/pn_vrouter.py index b5271b2c64e..343e41d7118 100644 --- a/lib/ansible/modules/network/netvisor/pn_vrouter.py +++ b/lib/ansible/modules/network/netvisor/pn_vrouter.py @@ -149,6 +149,9 @@ changed: import shlex +# AnsibleModule boilerplate +from ansible.module_utils.basic import AnsibleModule + VROUTER_EXISTS = None VROUTER_NAME_EXISTS = None @@ -410,8 +413,6 @@ def main(): run_cli(module, cli) -# AnsibleModule boilerplate -from ansible.module_utils.basic import AnsibleModule if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/netvisor/pn_vrouterbgp.py b/lib/ansible/modules/network/netvisor/pn_vrouterbgp.py index ef3fe495d87..a8a33af28ba 100644 --- a/lib/ansible/modules/network/netvisor/pn_vrouterbgp.py +++ b/lib/ansible/modules/network/netvisor/pn_vrouterbgp.py @@ -162,6 +162,9 @@ changed: import shlex +# Ansible boiler-plate +from ansible.module_utils.basic import AnsibleModule + VROUTER_EXISTS = None NEIGHBOR_EXISTS = None @@ -467,8 +470,7 @@ def main(): cli += ' route-map-out ' + route_mapout run_cli(module, cli) -# Ansible boiler-plate -from ansible.module_utils.basic import AnsibleModule + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/netvisor/pn_vrouterif.py b/lib/ansible/modules/network/netvisor/pn_vrouterif.py index 7f17778186a..4f7f425158f 100644 --- a/lib/ansible/modules/network/netvisor/pn_vrouterif.py +++ b/lib/ansible/modules/network/netvisor/pn_vrouterif.py @@ -161,6 +161,9 @@ changed: import shlex +# Ansible boiler-plate +from ansible.module_utils.basic import AnsibleModule + VROUTER_EXISTS = None INTERFACE_EXISTS = None NIC_EXISTS = None @@ -476,8 +479,7 @@ def main(): cli += ' %s vrouter-name %s nic %s ' % (command, vrouter_name, nic_str) run_cli(module, cli) -# Ansible boiler-plate -from ansible.module_utils.basic import AnsibleModule + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/netvisor/pn_vrouterlbif.py b/lib/ansible/modules/network/netvisor/pn_vrouterlbif.py index 94c55cb54d0..d11c5981ad1 100644 --- a/lib/ansible/modules/network/netvisor/pn_vrouterlbif.py +++ b/lib/ansible/modules/network/netvisor/pn_vrouterlbif.py @@ -102,6 +102,9 @@ changed: import shlex +# Ansible boiler-plate +from ansible.module_utils.basic import AnsibleModule + VROUTER_EXISTS = None LB_INTERFACE_EXISTS = None # Index range @@ -321,8 +324,6 @@ def main(): run_cli(module, cli) -# Ansible boiler-plate -from ansible.module_utils.basic import AnsibleModule if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/nxos/nxos_file_copy.py b/lib/ansible/modules/network/nxos/nxos_file_copy.py index 000da54a0d1..5ee983476c7 100644 --- a/lib/ansible/modules/network/nxos/nxos_file_copy.py +++ b/lib/ansible/modules/network/nxos/nxos_file_copy.py @@ -423,5 +423,6 @@ def main(): module.exit_json(**results) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/nxos/nxos_igmp_snooping.py b/lib/ansible/modules/network/nxos/nxos_igmp_snooping.py index 93721e61e1f..4e1160c1a2f 100644 --- a/lib/ansible/modules/network/nxos/nxos_igmp_snooping.py +++ b/lib/ansible/modules/network/nxos/nxos_igmp_snooping.py @@ -282,5 +282,6 @@ def main(): module.exit_json(**results) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/nxos/nxos_l3_interface.py b/lib/ansible/modules/network/nxos/nxos_l3_interface.py index c34bb92683e..8d1d1cb1f40 100644 --- a/lib/ansible/modules/network/nxos/nxos_l3_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_l3_interface.py @@ -240,5 +240,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/nxos/nxos_linkagg.py b/lib/ansible/modules/network/nxos/nxos_linkagg.py index f858945d953..af022dfc246 100644 --- a/lib/ansible/modules/network/nxos/nxos_linkagg.py +++ b/lib/ansible/modules/network/nxos/nxos_linkagg.py @@ -394,5 +394,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/nxos/nxos_ntp_auth.py b/lib/ansible/modules/network/nxos/nxos_ntp_auth.py index 5cd96c702e5..1a5289983ff 100644 --- a/lib/ansible/modules/network/nxos/nxos_ntp_auth.py +++ b/lib/ansible/modules/network/nxos/nxos_ntp_auth.py @@ -318,5 +318,6 @@ def main(): module.exit_json(**results) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/nxos/nxos_nxapi.py b/lib/ansible/modules/network/nxos/nxos_nxapi.py index 504edc40da6..f212fc7d97c 100644 --- a/lib/ansible/modules/network/nxos/nxos_nxapi.py +++ b/lib/ansible/modules/network/nxos/nxos_nxapi.py @@ -404,5 +404,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/nxos/nxos_reboot.py b/lib/ansible/modules/network/nxos/nxos_reboot.py index cd79147fb71..a04e393913c 100644 --- a/lib/ansible/modules/network/nxos/nxos_reboot.py +++ b/lib/ansible/modules/network/nxos/nxos_reboot.py @@ -89,5 +89,6 @@ def main(): module.exit_json(**results) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/nxos/nxos_snapshot.py b/lib/ansible/modules/network/nxos/nxos_snapshot.py index 748f4ea0940..ad21459c243 100644 --- a/lib/ansible/modules/network/nxos/nxos_snapshot.py +++ b/lib/ansible/modules/network/nxos/nxos_snapshot.py @@ -376,5 +376,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/nxos/nxos_static_route.py b/lib/ansible/modules/network/nxos/nxos_static_route.py index 234e7452fd3..7002d8b7c30 100644 --- a/lib/ansible/modules/network/nxos/nxos_static_route.py +++ b/lib/ansible/modules/network/nxos/nxos_static_route.py @@ -290,5 +290,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/nxos/nxos_system.py b/lib/ansible/modules/network/nxos/nxos_system.py index b2db9105153..c55b87b7c5b 100644 --- a/lib/ansible/modules/network/nxos/nxos_system.py +++ b/lib/ansible/modules/network/nxos/nxos_system.py @@ -398,5 +398,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/nxos/nxos_user.py b/lib/ansible/modules/network/nxos/nxos_user.py index 0c40f1f375a..9c8de1e62cd 100644 --- a/lib/ansible/modules/network/nxos/nxos_user.py +++ b/lib/ansible/modules/network/nxos/nxos_user.py @@ -376,5 +376,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/ordnance/ordnance_facts.py b/lib/ansible/modules/network/ordnance/ordnance_facts.py index ae4742f192f..11165f31260 100644 --- a/lib/ansible/modules/network/ordnance/ordnance_facts.py +++ b/lib/ansible/modules/network/ordnance/ordnance_facts.py @@ -216,6 +216,7 @@ class Interfaces(FactsBase): if match: return match.group(1) + FACT_SUBSETS = dict( interfaces=Interfaces, config=Config, diff --git a/lib/ansible/modules/network/panos/panos_admin.py b/lib/ansible/modules/network/panos/panos_admin.py index 399eae6a65e..a629b3e923c 100644 --- a/lib/ansible/modules/network/panos/panos_admin.py +++ b/lib/ansible/modules/network/panos/panos_admin.py @@ -186,5 +186,6 @@ def main(): module.exit_json(changed=changed, msg="okey dokey") + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/panos/panos_admpwd.py b/lib/ansible/modules/network/panos/panos_admpwd.py index 375df068b0b..130acf5c4ec 100644 --- a/lib/ansible/modules/network/panos/panos_admpwd.py +++ b/lib/ansible/modules/network/panos/panos_admpwd.py @@ -203,5 +203,6 @@ def main(): x = sys.exc_info()[1] module.fail_json(msg=x) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/panos/panos_check.py b/lib/ansible/modules/network/panos/panos_check.py index 396e84036d7..00dba29b45e 100644 --- a/lib/ansible/modules/network/panos/panos_check.py +++ b/lib/ansible/modules/network/panos/panos_check.py @@ -137,5 +137,6 @@ def main(): module.fail_json(msg="Timeout") + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/panos/panos_commit.py b/lib/ansible/modules/network/panos/panos_commit.py index ffc9964b3fa..8c8447e2d90 100644 --- a/lib/ansible/modules/network/panos/panos_commit.py +++ b/lib/ansible/modules/network/panos/panos_commit.py @@ -117,5 +117,6 @@ def main(): module.exit_json(changed=True, msg="okey dokey") + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/panos/panos_dag.py b/lib/ansible/modules/network/panos/panos_dag.py index 3c16935571b..6b7e0f90a76 100644 --- a/lib/ansible/modules/network/panos/panos_dag.py +++ b/lib/ansible/modules/network/panos/panos_dag.py @@ -135,5 +135,6 @@ def main(): module.exit_json(changed=changed, msg="okey dokey") + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/panos/panos_lic.py b/lib/ansible/modules/network/panos/panos_lic.py index 0ac7944566e..070812e24c4 100644 --- a/lib/ansible/modules/network/panos/panos_lic.py +++ b/lib/ansible/modules/network/panos/panos_lic.py @@ -162,5 +162,6 @@ def main(): module.exit_json(changed=True, msg="okey dokey") + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/radware/vdirect_commit.py b/lib/ansible/modules/network/radware/vdirect_commit.py index fea5f87e83b..29284baf83a 100644 --- a/lib/ansible/modules/network/radware/vdirect_commit.py +++ b/lib/ansible/modules/network/radware/vdirect_commit.py @@ -337,5 +337,6 @@ def main(): except Exception as e: module.fail_json(msg=str(e)) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/radware/vdirect_file.py b/lib/ansible/modules/network/radware/vdirect_file.py index 9808c7b94f0..33388933dfb 100644 --- a/lib/ansible/modules/network/radware/vdirect_file.py +++ b/lib/ansible/modules/network/radware/vdirect_file.py @@ -238,5 +238,6 @@ def main(): except Exception as e: module.fail_json(msg=str(e)) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/radware/vdirect_runnable.py b/lib/ansible/modules/network/radware/vdirect_runnable.py index 73725962980..c0d867f0382 100644 --- a/lib/ansible/modules/network/radware/vdirect_runnable.py +++ b/lib/ansible/modules/network/radware/vdirect_runnable.py @@ -319,5 +319,6 @@ def main(): except Exception as e: module.fail_json(msg=str(e)) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/slxos/slxos_vlan.py b/lib/ansible/modules/network/slxos/slxos_vlan.py index fa5c719d83e..6594270eb6c 100644 --- a/lib/ansible/modules/network/slxos/slxos_vlan.py +++ b/lib/ansible/modules/network/slxos/slxos_vlan.py @@ -306,5 +306,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/vyos/vyos_banner.py b/lib/ansible/modules/network/vyos/vyos_banner.py index 19d55fd9348..d2151c5f9dc 100644 --- a/lib/ansible/modules/network/vyos/vyos_banner.py +++ b/lib/ansible/modules/network/vyos/vyos_banner.py @@ -173,5 +173,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/vyos/vyos_interface.py b/lib/ansible/modules/network/vyos/vyos_interface.py index 78cc60fda43..a52d2eb422e 100644 --- a/lib/ansible/modules/network/vyos/vyos_interface.py +++ b/lib/ansible/modules/network/vyos/vyos_interface.py @@ -428,5 +428,6 @@ def main(): module.fail_json(msg=msg, failed_conditions=failed_conditions) module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/vyos/vyos_l3_interface.py b/lib/ansible/modules/network/vyos/vyos_l3_interface.py index 85c401f9d67..4d432e9267b 100644 --- a/lib/ansible/modules/network/vyos/vyos_l3_interface.py +++ b/lib/ansible/modules/network/vyos/vyos_l3_interface.py @@ -280,5 +280,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/vyos/vyos_linkagg.py b/lib/ansible/modules/network/vyos/vyos_linkagg.py index adab99380c4..4cb19cad2a9 100644 --- a/lib/ansible/modules/network/vyos/vyos_linkagg.py +++ b/lib/ansible/modules/network/vyos/vyos_linkagg.py @@ -260,5 +260,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/vyos/vyos_lldp.py b/lib/ansible/modules/network/vyos/vyos_lldp.py index 712fe51dacb..88159ea4c4a 100644 --- a/lib/ansible/modules/network/vyos/vyos_lldp.py +++ b/lib/ansible/modules/network/vyos/vyos_lldp.py @@ -116,5 +116,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/vyos/vyos_lldp_interface.py b/lib/ansible/modules/network/vyos/vyos_lldp_interface.py index 88f0c9546ed..57503b92f9b 100644 --- a/lib/ansible/modules/network/vyos/vyos_lldp_interface.py +++ b/lib/ansible/modules/network/vyos/vyos_lldp_interface.py @@ -223,5 +223,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/vyos/vyos_logging.py b/lib/ansible/modules/network/vyos/vyos_logging.py index 90ce7d50892..6f4361d25bf 100644 --- a/lib/ansible/modules/network/vyos/vyos_logging.py +++ b/lib/ansible/modules/network/vyos/vyos_logging.py @@ -258,5 +258,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/vyos/vyos_static_route.py b/lib/ansible/modules/network/vyos/vyos_static_route.py index c09327d9fa0..a41b0491faa 100644 --- a/lib/ansible/modules/network/vyos/vyos_static_route.py +++ b/lib/ansible/modules/network/vyos/vyos_static_route.py @@ -260,5 +260,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/network/vyos/vyos_user.py b/lib/ansible/modules/network/vyos/vyos_user.py index e43b7ef95f0..cc3668ca78c 100644 --- a/lib/ansible/modules/network/vyos/vyos_user.py +++ b/lib/ansible/modules/network/vyos/vyos_user.py @@ -335,5 +335,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/notification/snow_record.py b/lib/ansible/modules/notification/snow_record.py index 01ef58ad5b1..e9208dc7d23 100644 --- a/lib/ansible/modules/notification/snow_record.py +++ b/lib/ansible/modules/notification/snow_record.py @@ -327,5 +327,6 @@ def run_module(): def main(): run_module() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/notification/syslogger.py b/lib/ansible/modules/notification/syslogger.py index eb793b6fa44..1ec1c3493a5 100644 --- a/lib/ansible/modules/notification/syslogger.py +++ b/lib/ansible/modules/notification/syslogger.py @@ -168,5 +168,6 @@ def run_module(): def main(): run_module() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/packaging/language/maven_artifact.py b/lib/ansible/modules/packaging/language/maven_artifact.py index 02afe130b13..1d8d6f8c070 100644 --- a/lib/ansible/modules/packaging/language/maven_artifact.py +++ b/lib/ansible/modules/packaging/language/maven_artifact.py @@ -555,5 +555,6 @@ def main(): else: module.exit_json(state=state, dest=dest, changed=changed) + 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 76743d2e32b..9c5e8e1d59e 100644 --- a/lib/ansible/modules/packaging/os/apt_rpm.py +++ b/lib/ansible/modules/packaging/os/apt_rpm.py @@ -171,5 +171,6 @@ def main(): elif p['state'] in ['absent', 'removed']: remove_packages(module, packages) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/packaging/os/openbsd_pkg.py b/lib/ansible/modules/packaging/os/openbsd_pkg.py index feeed07614e..d224f3977f0 100644 --- a/lib/ansible/modules/packaging/os/openbsd_pkg.py +++ b/lib/ansible/modules/packaging/os/openbsd_pkg.py @@ -634,5 +634,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/packaging/os/zypper.py b/lib/ansible/modules/packaging/os/zypper.py index 2f08b4c7192..5c084a57239 100644 --- a/lib/ansible/modules/packaging/os/zypper.py +++ b/lib/ansible/modules/packaging/os/zypper.py @@ -198,6 +198,9 @@ from xml.dom.minidom import parseString as parseXML from ansible.module_utils.six import iteritems from ansible.module_utils._text import to_native +# import module snippets +from ansible.module_utils.basic import AnsibleModule + class Package: def __init__(self, name, prefix, version): @@ -522,7 +525,6 @@ def main(): module.exit_json(name=name, state=state, update_cache=update_cache, **retvals) -# import module snippets -from ansible.module_utils.basic import AnsibleModule + if __name__ == "__main__": main() diff --git a/lib/ansible/modules/remote_management/hpilo/hpilo_facts.py b/lib/ansible/modules/remote_management/hpilo/hpilo_facts.py index 1c8b7a890bf..1369575b873 100644 --- a/lib/ansible/modules/remote_management/hpilo/hpilo_facts.py +++ b/lib/ansible/modules/remote_management/hpilo/hpilo_facts.py @@ -241,5 +241,6 @@ def main(): module.exit_json(ansible_facts=facts) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/remote_management/imc/imc_rest.py b/lib/ansible/modules/remote_management/imc/imc_rest.py index 64774032af1..e0cb231f465 100644 --- a/lib/ansible/modules/remote_management/imc/imc_rest.py +++ b/lib/ansible/modules/remote_management/imc/imc_rest.py @@ -422,5 +422,6 @@ def main(): result['elapsed'] = (datetime.datetime.utcnow() - start).seconds module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/remote_management/ipmi/ipmi_boot.py b/lib/ansible/modules/remote_management/ipmi/ipmi_boot.py index 9b3a6c0dd8f..ab1b72d1fa1 100644 --- a/lib/ansible/modules/remote_management/ipmi/ipmi_boot.py +++ b/lib/ansible/modules/remote_management/ipmi/ipmi_boot.py @@ -182,5 +182,6 @@ def main(): except Exception as e: module.fail_json(msg=str(e)) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/remote_management/ipmi/ipmi_power.py b/lib/ansible/modules/remote_management/ipmi/ipmi_power.py index 1d65cd62d97..c0336216bff 100644 --- a/lib/ansible/modules/remote_management/ipmi/ipmi_power.py +++ b/lib/ansible/modules/remote_management/ipmi/ipmi_power.py @@ -127,5 +127,6 @@ def main(): except Exception as e: module.fail_json(msg=str(e)) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/remote_management/redfish/redfish_facts.py b/lib/ansible/modules/remote_management/redfish/redfish_facts.py index 074c7c1c9f4..ac89ac9e673 100644 --- a/lib/ansible/modules/remote_management/redfish/redfish_facts.py +++ b/lib/ansible/modules/remote_management/redfish/redfish_facts.py @@ -262,5 +262,6 @@ def main(): # Return data back module.exit_json(ansible_facts=dict(redfish_facts=result)) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/source_control/gitlab_deploy_key.py b/lib/ansible/modules/source_control/gitlab_deploy_key.py index e71a52bd202..eae4ac2fd1a 100644 --- a/lib/ansible/modules/source_control/gitlab_deploy_key.py +++ b/lib/ansible/modules/source_control/gitlab_deploy_key.py @@ -229,5 +229,6 @@ def main(): else: module.fail_json(msg='Failure', error=response) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/source_control/gitlab_hooks.py b/lib/ansible/modules/source_control/gitlab_hooks.py index 7e17b8ea852..07f066577fe 100644 --- a/lib/ansible/modules/source_control/gitlab_hooks.py +++ b/lib/ansible/modules/source_control/gitlab_hooks.py @@ -296,5 +296,6 @@ def main(): else: module.fail_json(msg='Failure', error=response) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/storage/netapp/na_cdot_license.py b/lib/ansible/modules/storage/netapp/na_cdot_license.py index 7f432bdeab7..82a16b0a046 100644 --- a/lib/ansible/modules/storage/netapp/na_cdot_license.py +++ b/lib/ansible/modules/storage/netapp/na_cdot_license.py @@ -289,5 +289,6 @@ def main(): v = NetAppCDOTLicense() v.apply() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/storage/netapp/na_cdot_svm.py b/lib/ansible/modules/storage/netapp/na_cdot_svm.py index 3eff7159716..6f9b38ae7e2 100644 --- a/lib/ansible/modules/storage/netapp/na_cdot_svm.py +++ b/lib/ansible/modules/storage/netapp/na_cdot_svm.py @@ -241,5 +241,6 @@ def main(): v = NetAppCDOTSVM() v.apply() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/storage/netapp/na_cdot_user.py b/lib/ansible/modules/storage/netapp/na_cdot_user.py index d635e548665..bbfe002811d 100644 --- a/lib/ansible/modules/storage/netapp/na_cdot_user.py +++ b/lib/ansible/modules/storage/netapp/na_cdot_user.py @@ -296,5 +296,6 @@ def main(): v = NetAppCDOTUser() v.apply() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/storage/netapp/na_cdot_user_role.py b/lib/ansible/modules/storage/netapp/na_cdot_user_role.py index a4d82ceb0a0..93bef8d95c8 100644 --- a/lib/ansible/modules/storage/netapp/na_cdot_user_role.py +++ b/lib/ansible/modules/storage/netapp/na_cdot_user_role.py @@ -222,5 +222,6 @@ def main(): v = NetAppCDOTUserRole() v.apply() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/storage/netapp/na_cdot_volume.py b/lib/ansible/modules/storage/netapp/na_cdot_volume.py index 458fa54af93..337303b3afc 100644 --- a/lib/ansible/modules/storage/netapp/na_cdot_volume.py +++ b/lib/ansible/modules/storage/netapp/na_cdot_volume.py @@ -435,5 +435,6 @@ def main(): v = NetAppCDOTVolume() v.apply() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/storage/netapp/na_ontap_broadcast_domain.py b/lib/ansible/modules/storage/netapp/na_ontap_broadcast_domain.py index 9181082549a..ad11ae2e6c9 100644 --- a/lib/ansible/modules/storage/netapp/na_ontap_broadcast_domain.py +++ b/lib/ansible/modules/storage/netapp/na_ontap_broadcast_domain.py @@ -249,5 +249,6 @@ def main(): obj = NetAppOntapBroadcastDomain() obj.apply() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/storage/netapp/sf_account_manager.py b/lib/ansible/modules/storage/netapp/sf_account_manager.py index 84e755e522a..5d75ea5528f 100644 --- a/lib/ansible/modules/storage/netapp/sf_account_manager.py +++ b/lib/ansible/modules/storage/netapp/sf_account_manager.py @@ -260,5 +260,6 @@ def main(): v = SolidFireAccount() v.apply() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/storage/netapp/sf_check_connections.py b/lib/ansible/modules/storage/netapp/sf_check_connections.py index 419327c6485..093bf382769 100644 --- a/lib/ansible/modules/storage/netapp/sf_check_connections.py +++ b/lib/ansible/modules/storage/netapp/sf_check_connections.py @@ -176,5 +176,6 @@ def main(): v = SolidFireConnection() v.check() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/storage/netapp/sf_snapshot_schedule_manager.py b/lib/ansible/modules/storage/netapp/sf_snapshot_schedule_manager.py index e6091888279..a73eeaae5c3 100644 --- a/lib/ansible/modules/storage/netapp/sf_snapshot_schedule_manager.py +++ b/lib/ansible/modules/storage/netapp/sf_snapshot_schedule_manager.py @@ -381,5 +381,6 @@ def main(): v = SolidFireSnapShotSchedule() v.apply() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/storage/netapp/sf_volume_access_group_manager.py b/lib/ansible/modules/storage/netapp/sf_volume_access_group_manager.py index ca9646f7249..4f4da5edfd8 100644 --- a/lib/ansible/modules/storage/netapp/sf_volume_access_group_manager.py +++ b/lib/ansible/modules/storage/netapp/sf_volume_access_group_manager.py @@ -241,5 +241,6 @@ def main(): v = SolidFireVolumeAccessGroup() v.apply() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/storage/purestorage/purefa_ds.py b/lib/ansible/modules/storage/purestorage/purefa_ds.py index ecd313a63d6..1e326fb28b7 100644 --- a/lib/ansible/modules/storage/purestorage/purefa_ds.py +++ b/lib/ansible/modules/storage/purestorage/purefa_ds.py @@ -263,5 +263,6 @@ def main(): else: module.exit_json(changed=False) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/storage/purestorage/purefa_facts.py b/lib/ansible/modules/storage/purestorage/purefa_facts.py index 8e1709b2410..f96319e5aaa 100644 --- a/lib/ansible/modules/storage/purestorage/purefa_facts.py +++ b/lib/ansible/modules/storage/purestorage/purefa_facts.py @@ -574,5 +574,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/storage/purestorage/purefa_hg.py b/lib/ansible/modules/storage/purestorage/purefa_hg.py index e5784b19d0b..983a887765b 100644 --- a/lib/ansible/modules/storage/purestorage/purefa_hg.py +++ b/lib/ansible/modules/storage/purestorage/purefa_hg.py @@ -254,5 +254,6 @@ def main(): else: make_hostgroup(module, array) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/system/aix_inittab.py b/lib/ansible/modules/system/aix_inittab.py index 5705be57347..165ebbb8b79 100644 --- a/lib/ansible/modules/system/aix_inittab.py +++ b/lib/ansible/modules/system/aix_inittab.py @@ -237,5 +237,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/system/alternatives.py b/lib/ansible/modules/system/alternatives.py index 3c1df4064f2..7b49447f58d 100644 --- a/lib/ansible/modules/system/alternatives.py +++ b/lib/ansible/modules/system/alternatives.py @@ -160,5 +160,6 @@ def main(): else: module.exit_json(changed=False) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/system/awall.py b/lib/ansible/modules/system/awall.py index 3108b75f942..818e41bb4cd 100644 --- a/lib/ansible/modules/system/awall.py +++ b/lib/ansible/modules/system/awall.py @@ -148,6 +148,6 @@ def main(): module.fail_json(msg="no action defined") -# import module snippets + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/system/dconf.py b/lib/ansible/modules/system/dconf.py index 3526818e84c..c5cda633d7c 100644 --- a/lib/ansible/modules/system/dconf.py +++ b/lib/ansible/modules/system/dconf.py @@ -370,5 +370,6 @@ def main(): changed = dconf.reset(module.params['key']) module.exit_json(changed=changed) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/system/nosh.py b/lib/ansible/modules/system/nosh.py index a9f50f3b6a7..0dc3c38b051 100644 --- a/lib/ansible/modules/system/nosh.py +++ b/lib/ansible/modules/system/nosh.py @@ -414,5 +414,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/system/pamd.py b/lib/ansible/modules/system/pamd.py index 59add7fb650..161f2e6f506 100644 --- a/lib/ansible/modules/system/pamd.py +++ b/lib/ansible/modules/system/pamd.py @@ -796,5 +796,6 @@ def main(): module.exit_json(changed=changes > 0, ansible_facts=facts) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/system/vdo.py b/lib/ansible/modules/system/vdo.py index 716893de8f0..900c4d73b6a 100644 --- a/lib/ansible/modules/system/vdo.py +++ b/lib/ansible/modules/system/vdo.py @@ -868,5 +868,6 @@ def run_module(): def main(): run_module() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/web_infrastructure/apache2_mod_proxy.py b/lib/ansible/modules/web_infrastructure/apache2_mod_proxy.py index 88acb22b1dc..8ccebd8111e 100644 --- a/lib/ansible/modules/web_infrastructure/apache2_mod_proxy.py +++ b/lib/ansible/modules/web_infrastructure/apache2_mod_proxy.py @@ -431,6 +431,7 @@ def main(): else: module.fail_json(msg=str(module.params['member_host']) + ' is not a member of the balancer ' + str(module.params['balancer_vhost']) + '!') + from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.urls import fetch_url if __name__ == '__main__': diff --git a/lib/ansible/modules/web_infrastructure/apache2_module.py b/lib/ansible/modules/web_infrastructure/apache2_module.py index cdbfe988508..c09fafc55ac 100644 --- a/lib/ansible/modules/web_infrastructure/apache2_module.py +++ b/lib/ansible/modules/web_infrastructure/apache2_module.py @@ -108,6 +108,9 @@ stderr: import re +# import module snippets +from ansible.module_utils.basic import AnsibleModule + def _run_threaded(module): control_binary = _get_ctl_binary(module) @@ -259,7 +262,6 @@ def main(): if module.params['state'] in ['present', 'absent']: _set_state(module, module.params['state']) -# import module snippets -from ansible.module_utils.basic import AnsibleModule + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/web_infrastructure/gunicorn.py b/lib/ansible/modules/web_infrastructure/gunicorn.py index b209c144a60..f6a829dc409 100644 --- a/lib/ansible/modules/web_infrastructure/gunicorn.py +++ b/lib/ansible/modules/web_infrastructure/gunicorn.py @@ -223,5 +223,6 @@ def main(): else: module.fail_json(msg='Failed to start gunicorn {0}'.format(err), error=err) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/web_infrastructure/jboss.py b/lib/ansible/modules/web_infrastructure/jboss.py index a74a7f6e49f..1629ab1bed1 100644 --- a/lib/ansible/modules/web_infrastructure/jboss.py +++ b/lib/ansible/modules/web_infrastructure/jboss.py @@ -143,5 +143,6 @@ def main(): module.exit_json(**result) + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/web_infrastructure/jira.py b/lib/ansible/modules/web_infrastructure/jira.py index 9d84bb7ee5c..fcdfb73a30b 100644 --- a/lib/ansible/modules/web_infrastructure/jira.py +++ b/lib/ansible/modules/web_infrastructure/jira.py @@ -367,6 +367,7 @@ def link(restbase, user, passwd, params): return ret + # Some parameters are required depending on the operation: OP_REQUIRED = dict(create=['project', 'issuetype', 'summary', 'description'], comment=['issue', 'comment'], diff --git a/lib/ansible/modules/web_infrastructure/rundeck_acl_policy.py b/lib/ansible/modules/web_infrastructure/rundeck_acl_policy.py index ac912b77fe8..70f79df3ab4 100644 --- a/lib/ansible/modules/web_infrastructure/rundeck_acl_policy.py +++ b/lib/ansible/modules/web_infrastructure/rundeck_acl_policy.py @@ -220,5 +220,6 @@ def main(): elif module.params['state'] == 'absent': rundeck.remove_acl() + if __name__ == '__main__': main() diff --git a/lib/ansible/modules/web_infrastructure/supervisorctl.py b/lib/ansible/modules/web_infrastructure/supervisorctl.py index b1755d67e23..edacfe39cea 100644 --- a/lib/ansible/modules/web_infrastructure/supervisorctl.py +++ b/lib/ansible/modules/web_infrastructure/supervisorctl.py @@ -236,5 +236,6 @@ def main(): module.fail_json(name=name, msg="ERROR (no such process)") take_action_on_processes(processes, lambda s: s in ('RUNNING', 'STARTING'), 'stop', 'stopped') + if __name__ == '__main__': main() diff --git a/lib/ansible/parsing/yaml/dumper.py b/lib/ansible/parsing/yaml/dumper.py index 155d42986ca..df3627d99f3 100644 --- a/lib/ansible/parsing/yaml/dumper.py +++ b/lib/ansible/parsing/yaml/dumper.py @@ -43,6 +43,7 @@ def represent_hostvars(self, data): def represent_vault_encrypted_unicode(self, data): return self.represent_scalar(u'!vault', data._ciphertext.decode(), style='|') + if PY3: represent_unicode = yaml.representer.SafeRepresenter.represent_str else: diff --git a/lib/ansible/plugins/callback/dense.py b/lib/ansible/plugins/callback/dense.py index f055802a023..fc752fe50c4 100644 --- a/lib/ansible/plugins/callback/dense.py +++ b/lib/ansible/plugins/callback/dense.py @@ -493,6 +493,7 @@ class CallbackModule_dense(CallbackModule_default): screen_only=True ) + # When using -vv or higher, simply do the default action if display.verbosity >= 2 or not HAS_OD: CallbackModule = CallbackModule_default diff --git a/lib/ansible/plugins/filter/ipaddr.py b/lib/ansible/plugins/filter/ipaddr.py index fe3c3dbdf72..b12101e8e1b 100644 --- a/lib/ansible/plugins/filter/ipaddr.py +++ b/lib/ansible/plugins/filter/ipaddr.py @@ -176,6 +176,7 @@ def _ip_netmask_query(v): if v.ip != v.network: return str(v.ip) + ' ' + str(v.netmask) + ''' def _ip_wildcard_query(v): if v.size == 2: diff --git a/lib/ansible/plugins/inventory/scaleway.py b/lib/ansible/plugins/inventory/scaleway.py index 17670dd2ea3..e84d00135d4 100644 --- a/lib/ansible/plugins/inventory/scaleway.py +++ b/lib/ansible/plugins/inventory/scaleway.py @@ -142,6 +142,7 @@ def extract_zone(server_info): except (KeyError, TypeError): return None + extractors = { "public_ipv4": extract_public_ipv4, "private_ipv4": extract_private_ipv4, diff --git a/lib/ansible/utils/hashing.py b/lib/ansible/utils/hashing.py index 3c5b125b0b6..11e58444fdc 100644 --- a/lib/ansible/utils/hashing.py +++ b/lib/ansible/utils/hashing.py @@ -69,6 +69,7 @@ def secure_hash(filename, hash_func=sha1): raise AnsibleError("error while accessing the file %s, error was: %s" % (filename, e)) return digest.hexdigest() + # The checksum algorithm must match with the algorithm in ShellModule.checksum() method checksum = secure_hash checksum_s = secure_hash_s diff --git a/packaging/release/versionhelper/version_helper.py b/packaging/release/versionhelper/version_helper.py index fab4dbb3f3f..163494b6aeb 100644 --- a/packaging/release/versionhelper/version_helper.py +++ b/packaging/release/versionhelper/version_helper.py @@ -190,5 +190,6 @@ def main(): for propname in props: print('{0}: {1}'.format(propname, getattr(v, propname))) + if __name__ == '__main__': main() diff --git a/test/integration/targets/async/library/async_test.py b/test/integration/targets/async/library/async_test.py index e4093bcb302..3098bc601cb 100644 --- a/test/integration/targets/async/library/async_test.py +++ b/test/integration/targets/async/library/async_test.py @@ -39,4 +39,5 @@ def main(): if 'trailing_junk' in fail_mode: print("trailing junk after module output") + main() diff --git a/test/integration/targets/async_fail/library/async_test.py b/test/integration/targets/async_fail/library/async_test.py index 873f7e78813..838f2f07ea4 100644 --- a/test/integration/targets/async_fail/library/async_test.py +++ b/test/integration/targets/async_fail/library/async_test.py @@ -46,4 +46,5 @@ def main(): if 'trailing_junk' in fail_mode: print("trailing junk after module output") + main() diff --git a/test/integration/targets/var_precedence/ansible-var-precedence-check.py b/test/integration/targets/var_precedence/ansible-var-precedence-check.py index 375d87dfc5b..f19cd1c5ef7 100755 --- a/test/integration/targets/var_precedence/ansible-var-precedence-check.py +++ b/test/integration/targets/var_precedence/ansible-var-precedence-check.py @@ -536,5 +536,6 @@ def main(): shutil.rmtree(TESTDIR) index += 1 + if __name__ == "__main__": main() diff --git a/test/legacy/cleanup_gce.py b/test/legacy/cleanup_gce.py index bb6f4e879ce..f98798a6700 100644 --- a/test/legacy/cleanup_gce.py +++ b/test/legacy/cleanup_gce.py @@ -69,6 +69,7 @@ def parse_args(): gce_credentials.check_required(opts, parser) return (opts, args) + if __name__ == '__main__': (opts, args) = parse_args() diff --git a/test/units/module_utils/network/aci/test_aci.py b/test/units/module_utils/network/aci/test_aci.py index 99957d3b245..1e8c14f4a49 100644 --- a/test/units/module_utils/network/aci/test_aci.py +++ b/test/units/module_utils/network/aci/test_aci.py @@ -43,6 +43,7 @@ class AltACIModule(ACIModule): self.module = AltModule self.params = self.module.params + aci = AltACIModule() diff --git a/test/units/module_utils/network/common/test_parsing.py b/test/units/module_utils/network/common/test_parsing.py index b19fa9bd116..7dcbea51f7b 100644 --- a/test/units/module_utils/network/common/test_parsing.py +++ b/test/units/module_utils/network/common/test_parsing.py @@ -41,5 +41,6 @@ class TestNotKeyword(unittest.TestCase): def test_conditionals_w_not_keyword(self): assert c1(test_results) and c2(test_results) and c3(test_results) + if __name__ == '__main__': unittest.main() diff --git a/test/units/modules/network/nxos/nxos_module.py b/test/units/modules/network/nxos/nxos_module.py index 1948cfc0aaa..342ec550d05 100644 --- a/test/units/modules/network/nxos/nxos_module.py +++ b/test/units/modules/network/nxos/nxos_module.py @@ -32,6 +32,7 @@ def set_module_args(args): return _set_module_args(args) + fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/plugins/connection/test_connection.py b/test/units/plugins/connection/test_connection.py index ea5f540fcdb..a2f89655797 100644 --- a/test/units/plugins/connection/test_connection.py +++ b/test/units/plugins/connection/test_connection.py @@ -54,6 +54,7 @@ def import_mock(name, *args): return mock_ncclient return builtin_import(name, *args) + if PY3: with patch('builtins.__import__', side_effect=import_mock): from ansible.plugins.connection.netconf import Connection as NetconfConnection diff --git a/test/units/plugins/connection/test_netconf.py b/test/units/plugins/connection/test_netconf.py index bed851b747d..850bf8898a0 100644 --- a/test/units/plugins/connection/test_netconf.py +++ b/test/units/plugins/connection/test_netconf.py @@ -43,6 +43,7 @@ def import_mock(name, *args): return mock_ncclient return builtin_import(name, *args) + if PY3: with patch('builtins.__import__', side_effect=import_mock): from ansible.plugins.connection import netconf