diff --git a/contrib/inventory/apache-libcloud.py b/contrib/inventory/apache-libcloud.py index 7d6bba2515f53d..067076fdf5422f 100755 --- a/contrib/inventory/apache-libcloud.py +++ b/contrib/inventory/apache-libcloud.py @@ -344,5 +344,6 @@ def json_format_dict(self, data, pretty=False): def main(): LibcloudInventory() + if __name__ == '__main__': main() diff --git a/contrib/inventory/apstra_aos.py b/contrib/inventory/apstra_aos.py index 2ffd3290f06081..c793f29aad9a3b 100755 --- a/contrib/inventory/apstra_aos.py +++ b/contrib/inventory/apstra_aos.py @@ -583,6 +583,7 @@ def add_device_status_to_var(self, device_name, device): 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 c6702dcce10aea..64c300cab82877 100755 --- a/contrib/inventory/cloudforms.py +++ b/contrib/inventory/cloudforms.py @@ -482,4 +482,5 @@ def json_format_dict(self, data, pretty=False): else: return json.dumps(data) + CloudFormsInventory() diff --git a/contrib/inventory/cobbler.py b/contrib/inventory/cobbler.py index 2762041dc9de7e..87e855faa54e43 100755 --- a/contrib/inventory/cobbler.py +++ b/contrib/inventory/cobbler.py @@ -312,4 +312,5 @@ def json_format_dict(self, data, pretty=False): else: return json.dumps(data) + CobblerInventory() diff --git a/contrib/inventory/consul_io.py b/contrib/inventory/consul_io.py index b7197291fdb399..57bad6f93415a7 100755 --- a/contrib/inventory/consul_io.py +++ b/contrib/inventory/consul_io.py @@ -528,4 +528,5 @@ def get_consul_api(self): 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 9a41ebe3d41944..9e344828b36e18 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 fe82c059bd0be2..99200168f67099 100755 --- a/contrib/inventory/foreman.py +++ b/contrib/inventory/foreman.py @@ -436,5 +436,6 @@ def run(self): 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 e72f343e36f26d..5c5773e0aaa42e 100755 --- a/contrib/inventory/gce.py +++ b/contrib/inventory/gce.py @@ -534,6 +534,7 @@ def json_format_dict(self, data, pretty=False): 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 c026c20009ec76..86a6b22c2d771d 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 958414f3729fcf..947091079ae937 100755 --- a/contrib/inventory/mdt_dynamic_inventory.py +++ b/contrib/inventory/mdt_dynamic_inventory.py @@ -129,6 +129,7 @@ def parse_cli_args(self): 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 91c72dac60674c..8f428000d8a881 100755 --- a/contrib/inventory/nagios_livestatus.py +++ b/contrib/inventory/nagios_livestatus.py @@ -173,4 +173,5 @@ def __init__(self): 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 e5377119c79dad..a4477e1e2637ac 100755 --- a/contrib/inventory/nagios_ndo.py +++ b/contrib/inventory/nagios_ndo.py @@ -105,4 +105,5 @@ def __init__(self): 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 1c4b474362ef29..d7fca297bacad1 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 6ea355198c2790..9ac85aae794a8c 100755 --- a/contrib/inventory/ovirt.py +++ b/contrib/inventory/ovirt.py @@ -288,5 +288,6 @@ def json_format_dict(data, pretty=False): else: return json.dumps(data) + # Run the script OVirtInventory() diff --git a/contrib/inventory/ovirt4.py b/contrib/inventory/ovirt4.py index cf2f7ad3c98b1b..33fb5b3a8a2d8b 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 0d0c7b63fd0961..1e66d28b14549c 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 30cab1a21d67cb..4e2a1191529aac 100755 --- a/contrib/inventory/rudder.py +++ b/contrib/inventory/rudder.py @@ -294,5 +294,6 @@ def to_safe(self, word): 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 bddb0db6f9394c..d53b6fa26dc043 100755 --- a/contrib/inventory/softlayer.py +++ b/contrib/inventory/softlayer.py @@ -198,4 +198,5 @@ def get_all_servers(self): self.get_virtual_servers() self.get_physical_servers() + SoftLayerInventory() diff --git a/contrib/inventory/vbox.py b/contrib/inventory/vbox.py index 6326dad3fe4b17..61ecf2826af10a 100755 --- a/contrib/inventory/vbox.py +++ b/contrib/inventory/vbox.py @@ -30,6 +30,7 @@ def default(self, obj): return list(obj) return json.JSONEncoder.default(self, obj) + VBOX = "VBoxManage" diff --git a/contrib/inventory/zabbix.py b/contrib/inventory/zabbix.py index 48b3017194c569..0f57bff14f2c30 100755 --- a/contrib/inventory/zabbix.py +++ b/contrib/inventory/zabbix.py @@ -152,4 +152,5 @@ def __init__(self): 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 4d3d96c32f654e..deef4481b286e1 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 121e2dc2e97f45..ea5d44bf3d032b 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 a97b59e6630fbc..c4c81d76d4c4a1 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 @@ def __enter__(self): 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 701c8bdc0b5424..83f28c0e3a5b4e 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 300b55d0a82f17..edb8fa3aab424b 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 e6aeebef5198f5..2a0608b2ef530a 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 732394eaa61a9c..c7636f5647e37c 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 53e8397868c091..bcdf53aec5872e 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 cd305de2252c48..4bc670a64501ef 100644 --- a/lib/ansible/module_utils/six/__init__.py +++ b/lib/ansible/module_utils/six/__init__.py @@ -228,6 +228,7 @@ def get_code(self, fullname): 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 25dc35504eb06c..4c145b4d69d4e0 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 13181993484ee3..e8bc3e3cff77fc 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 895d1928285df4..1eb2d20d14d00a 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 bb23569c2ab08e..857e0d4dea4d2a 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 8b7fe8f87051bd..ea45f8115734c7 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 23103e8c8a1ec1..eb6c51bd183b9e 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 8bcf5cd84e5d9f..6dbf4eebb54e55 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 c07b9d060091d8..34eb0b4cf77c7e 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 f4edeb65f9af20..b58314d5b51ec0 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 d33fe571fe33f5..50c4564ffd635f 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 260be30fcac78f..00896d3a6010fa 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 bf608083f6c79f..f2e18df05cd819 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 2789384ecdecc8..434223ca3d9788 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 67c9336f4b8d77..e97320845ccac2 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 78478d88429796..bfeecbe89eb34c 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 3fe8a656876de8..298d5daf3061ad 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 7268d041102699..8da678a30a3bcd 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 936c4049f016cc..9ee712ad1a18cc 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 @@ def list_zone(self): 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 431935da3549ce..a63f22c451c283 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 4ed09ec238c7ce..99f6be82d02396 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 @@ def list_items(self): 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 23e276f9c70790..430682ff343940 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 80f47782176974..deb9b5dc15a5dd 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 @@ def delete_image(self): 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 5d9423caf2a2dd..cb81edc8550430 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 dbbc00c4d1bc55..2edcdb9d71b78c 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 @@ def _set_rsa_parameters(dest, src): 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 d1919d9355bf86..e0b9a8d5625225 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 @@ def delete_secret(self, name): 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 2c713521dc5449..330fb2f48ce6f7 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 1a7f82425424aa..1f62e715bbe5d3 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 aa54f5544cfe09..5ea8904d9b8fb8 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 95abcea47d8d31..c9b6ea3b3ff749 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 dcdb17b90481b2..45fe0e8fb512b8 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 29788af661e52d..83ef90a45c4445 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 33359eda363d95..2ba4d8e035a1fc 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 @@ def list_all(self): 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 6f4790460589d5..dfee3392513fa0 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 e424c7065ba971..bfec5871008cb7 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 8dc5639da997b8..35dd8c66bd125b 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 @@ def delete_pip(self): 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 7a6b60897dfb10..8a2c8178071640 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 @@ def name_exists(self): 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 f73b315ad6d4a2..5c0ea2ec9d9221 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 @@ def list_items(self): 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 92bc67a734a327..53badb4d54b29a 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 @@ def list_items(self): 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 3e4b736142dc76..345da65368cda4 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 d69980e6829be1..46c833f6fa9887 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 6a679a93b2704f..3a22f1bc48b0dd 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 @@ def list_by_resource_group(self): 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 d48519b7407a67..67cb4522b6e4c7 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 @@ def account_has_blob_containers(self): 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 711ef174c97808..9e9a56cc334647 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 @@ def update_blob_content_settings(self): 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 ca22460fa104b1..62753f9e63f79a 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 @@ def parse_nsg(self): 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 401ea8c0a995d5..48d08bb9db2514 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 a470a06738ed43..83416869cf28b5 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 @@ def vm_size_is_valid(self): 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 dbdec678a7eacb..7484d9c7ede6e0 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 4fb4b694cb0f48..a55945008d52b4 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 @@ def list_publishers(self): 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 b3d1832a797cfa..eb55334dc1c543 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 @@ def delete_virtual_network(self): 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 04a9893b2daa62..2bc3bf3c343dd1 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 @@ def list_items(self): 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 d8b14a6aebe54c..7805d9a1ef4e3d 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 b15443dd1eb958..e03e46158d80d3 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 7d7150fb6b2ff1..9f1c22765b878a 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 ba660e0d1551a1..40bb6a81fb938c 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 @@ def from_response(self): 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 e3252787aa9ee2..779e46e7993242 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 @@ def from_response(self): 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 c07824e3d2bdab..01d77b26084d3c 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 @@ def _response_from_item(self, item): 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 cda8b294f406ed..9faca26add2cf8 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 687a6ee0517198..03b851eec057d8 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 51cb2870a41bc2..503e131664c72e 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 76bde14b667b97..de6fb88075dc1c 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 @@ def from_response(self): 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 ad91715d6a9093..49f0b59054090d 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 4c8c5cc05be41c..6ee3685f695535 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 14c63a4870a57c..c096ada3b41db7 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 @@ def from_response(self): 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 b53a679dff40bd..67811eb963367f 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 @@ def from_response(self): 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 2aab0ece63c4c7..e6f5bc3efcc2b5 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 @@ def _response_from_item(self, item): 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 b41e6b14cd9e6b..6283afe093b2af 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 @@ def _response_from_item(self, item): 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 afce5d8a9165ea..52b9d543bc0b37 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 @@ def from_response(self): 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 eb7b6a0c88298d..6575ca48252463 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 cc86892edfd2f5..793b6c6a1aceb8 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 cae3a63dae6dfe..9e0346feb067a0 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 86c3b0dd33f263..40bbfc43caf1fd 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 555a2da959fa7c..0434660cf0c59d 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 c3a424100c9044..a5436c4381fcd6 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 93f477384617ac..e033b94db271c3 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 3010bacc486776..52dc5c3be2c756 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 994c1cb0dedc38..71e929d4d75e56 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 007f45fe4c8d6d..bab7d2898788a4 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 @@ def _response_from_item(self, item): 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 66cfd52fb02539..eec0bd8fa18261 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 @@ def from_response(self): 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 595ba27f4e45c6..039bf39ffb833a 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 @@ def from_response(self): 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 6d60bb3ec3657b..9da6a8f2944596 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 cd1ec280c4420c..bb1a2c2d089d69 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 5547bd4c8d9e0d..53fbb2d37170f7 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 @@ def from_response(self): 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 0248719f5f3c8b..73d04e329bc071 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 2df5851a98243c..c2601fa43a2fad 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 @@ def from_response(self): 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 b8c8cbca54f0f5..5f12aa8b6c0753 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 @@ def from_response(self): 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 882f69485327e9..879f82565fa9f8 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 2ab5c5f59751b0..d850a0be9b95de 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 87292a2d022341..b1020f0b50e2fe 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 6046774e0e4759..d2cd0143c9d99e 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 ed79c5a73b89bd..db90f3babcde8c 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 6e1518b758df2f..95c3d8b6160d1c 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 137288e20d9ebb..589f640400e819 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 daac3c8b83ede3..c6d5b76140604b 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 ef609454c9b4bf..833f7d0e4925f8 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 fdb155499477e7..a9e84b062a314a 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 66fd1cbfaea7b6..9d6df4a98eaadd 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 6135179ab57d7c..46bd13042e1bf3 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 7b5b319d852cda..59451954c2c0aa 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 8f5395e740f028..7edf868055b062 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 7d42fc520494a6..6aba7bb0a714d9 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 44af55f2a1c406..568e95a836bcbe 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 3760dce0be4da8..d02fbf0c3db247 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 faa63ef8ae4da5..ba59a911383c23 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 b4a74f104dc4ad..d33f42c3147325 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 cf12896b1bbb61..38f8d3fa78a134 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 b0b65f5c434620..ce2f7de2e6b1bd 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 5310116c649087..9f386c68275eca 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 7fcaa67ea1c5c3..f6e0fc7658b55a 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 cb7c4e8fcbdb4f..1da26b76a0c8d6 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 dfc22e08d11faa..38ae60d7ebd250 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 9f31e57dcf96d5..c65c846eddda00 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 91039397eb3749..9ac93d7a4d3e9d 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 9109283c33a538..8721889b539c9c 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 9d2c490febaa6b..0261e05f437e22 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 6d87d7626fd91a..c8cb83fac66677 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 59d8e61a2dc7db..cd171b85369733 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 f9346aa049bce8..a07d33b916b282 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 d6145790f4eb3f..00d8c6f087c053 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 5cf043917f324a..c6be8a3c2b42c7 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 4da3adabb3c95b..fe1c739fd9eb5a 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 88d6341825b03e..be69e3d55e9860 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 20f822c665251f..64c0486a53bebc 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 d6381ddbe1714e..99bb7667fb3535 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 943fe29c3bc458..fed5b85c721167 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 387b1bd1cfe15f..a775c2aa843c71 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 0e75715faf29b3..1a660b71dcc945 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 364cbf4206b9eb..49ec51daa7a21f 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 298bf53d4e33f7..6413456e754baf 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 ffa8f0a6d9fade..5aa8c1827e7db4 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 7bf983b5623337..52104d5a194b3f 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 4a73b1ef205855..7cf6022be20409 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 c6378236ca5676..500d46de5541b2 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 c67b3413abefff..7d53338b4b3fee 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 01514d0e8f78e2..83aa969f130eeb 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 0fa7058f95688e..c26bb95b73f132 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 2b3184e072ca01..6a671c2f7d2564 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 c8821ffc3d3c96..dc4f2fc7aa8f4b 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 dd1c33bd5e79fd..b6651bd3fecb2b 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 6114a04c84550f..b0d03c71501174 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 305ff04973a7dc..56e1adb5055b41 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 a3687e9b428973..87282cf1be452c 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 f0887c565ede75..b26ec0fcfe0daa 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 887a5cbf4ada86..e11baa21278bd2 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 5fa531d980785c..149275592d1bb4 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 90aaf9f9556740..a2fc88ee55c55c 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 ec5766585714df..f036d2b05b212f 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 0f649e36dfaa30..49c6cec7ac91c8 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 37add350b97068..ab60cfc69186d8 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 a23fb811f4d851..44e1b8ff803e11 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 92bed828ad9875..50d44dcea04bdf 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 2cfe5e9271fa6e..5c65eba49916b1 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 24a3fc76b54ade..79caab1ac53e40 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 df06eafb539777..871be26f4263bc 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 4bdbad79154a5a..88fed623154d17 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 16aebb12f71498..cb22e54ff556f8 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 110da20229bcde..fb9292f7e446e2 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 4206039e66ca8d..77b0e9fb86576a 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 f49a168fe6c92e..477bae5b30d1a9 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 c40c8b78b026c5..1621a2fbde6699 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 70228398615b13..45a79d977b3e4d 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 2042a4290d646e..d51bb1647010e2 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 29735340eec602..5cf1937a9a3ace 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 f6ad0e21487cfd..b931d10b4088dd 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 2851c673f032cc..03c5399557b246 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 85f0298575a231..61b26acc765ec6 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 7b521076f381d0..8881c8b0f282a1 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 2ec38d87765a7f..0dc42b61f278e4 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 bfd5f0f9209d2e..fd2cd3c38ff7a5 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 1ce046fb4b1a59..51f61887004c31 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 f9517e833f3884..33817b581040fe 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 17dafc24f46060..86116ae61126b4 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 9053699bcc4b25..c0acbfd479b73f 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 a265f0254920ee..09a5a160cef16a 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 5600229fad4691..d6ff13a39d57f9 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 0bc4125de72763..887330460b0658 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 50122f2d4adad4..265ee963a7bd18 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 cbdef5d6402a39..01da7f45f7c33a 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 6f293325533b87..e1ae8bb626af68 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 50fe935487dcba..c8a268c57d1edd 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 abb495f75b1e95..a6e9b846d6213b 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 d6888a7678f539..3d0b735ac68e3e 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 dfbe9901a30f9d..c98cb93db49e48 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 ca05404f063da5..848944e98b485c 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 242a9426a2789c..00e5502e5cff80 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 a7bd1c2d03ea6f..a03e63ece56ed2 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 cf7ba25c932dd0..f502d9548a898a 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 a80d1d0f7c77e1..1d253515ea26d2 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 a36b183e008363..a2b2822942af0c 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 a30b3b21644237..46ada6147c2928 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 039507714ba058..71f6f750eaf31b 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 e2aa6a89b31025..9072fe8baf1b4e 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 fb4e8bf05c5b7f..7966e61d8fe0c0 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 e8982f1fe8c53c..1639fa9fd15be0 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 2d5e29c7e8d26f..4981e3745280fa 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 14e0995766653c..a5e391747d4d17 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 2f27a6fa28ca30..102707dd55a4b3 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 bce260bd7a46f1..752ac899ca1897 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 d97fdd6c37b4f3..63ae3d02ceef7b 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 01e4fb2d47ea09..56c22162187d8b 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 5ec573669b8cb0..5d26b86fbcaf62 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 e3a288fb170644..e125646bd9a170 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 9e1dd54654830f..6bcaa21f0c5be7 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 fc6b79a482d9a4..6c2bc1a4a0b03c 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 1ffe6a4f90478a..781ce8810a8ab6 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 3b398c45343803..9b56bfd827f23f 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 e450f1a28755d1..5abcb23d155afc 100644 --- a/lib/ansible/modules/network/cnos/cnos_facts.py +++ b/lib/ansible/modules/network/cnos/cnos_facts.py @@ -511,6 +511,7 @@ def parse_neighbors(self, neighbors): 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 6763351c8e4074..9dfa49fb89ca33 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 eef2a9a957b16a..2f13355e498656 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 bcd9317c31427c..23468cfd930166 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 e838ae868c6730..27f691f93903a3 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 0f48ad0c002491..c612c0b16d95bf 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 b1bfd5379a6bd9..787d01f68ed3be 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 50de02602538c9..a942c0e6f2aee3 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 31b7bde93de959..4d1fd6dc7f8678 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 e8195eea8e9d76..63cf00797d49c7 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 c8bf758b97b02d..4205656da2e5e7 100644 --- a/lib/ansible/modules/network/enos/enos_facts.py +++ b/lib/ansible/modules/network/enos/enos_facts.py @@ -422,6 +422,7 @@ def parse_interfaces(self, data): 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 18d12d5807bbcf..f14f08fa1e73d7 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 b60e8afd6799bc..b0727c25811434 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 19b76c2e92b9e6..b9fbf91e540e43 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 013a6804db49cb..44a8f58a615c28 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 05b24fbd05165c..9d103938115bcb 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 627c14c96cf63e..a88b8f2ff6ad61 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 32ca47f921805c..a6c53ac60d4ac7 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 842aa801ad19ad..66c311dba58d25 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 8694813ce711a2..f7c63a909f04e9 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 6459025dc0de5e..7f6865ab748f10 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 93e42bc276b801..a12645d4850852 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 e07c18b0e57dca..e490cae88b4937 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 0d59fe8121d5bc..44498b97ffbae0 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 75bb2ec0e10705..06f4f425a5d4a3 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 062abd3ae63569..6adc7738f9eb4f 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 e1645a912970e7..43540f5b986296 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 eb7693cceeb754..1eb69a35bc82e4 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 aac07c2d889418..976bd686310705 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 15575a9920e4ae..4352de9b97e12c 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 bd06f7170bf776..6c8ce9246fcea7 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 f4cf98721fa28a..3b8d3935bd3bbc 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 7b251eb55fd1d8..91be5e0fd48e3f 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 5e683c74f639a2..2da78c62f24212 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 60fe0c52d4b551..3f99f749db79e2 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 e34dafd2c8be87..fbb1aa28f93d84 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 f8f7b4f68e816b..638c655ca3fe65 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 89033e043da394..81015decedc5e1 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 89a622b183d47a..404f63e5cfa672 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 ef80edb637f575..1ea4acae6f9e65 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 a4b9050c805f25..823bd87aefb811 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 b1e013b3ab03e0..bfeae9482f4f99 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 dada1d16dc64dd..af326541ce3b24 100644 --- a/lib/ansible/modules/network/netvisor/pn_cluster.py +++ b/lib/ansible/modules/network/netvisor/pn_cluster.py @@ -112,6 +112,9 @@ 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 0bd698132c7993..d06badf16fed25 100644 --- a/lib/ansible/modules/network/netvisor/pn_ospf.py +++ b/lib/ansible/modules/network/netvisor/pn_ospf.py @@ -101,6 +101,9 @@ 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 34739d451da56d..8e10d38d12f181 100644 --- a/lib/ansible/modules/network/netvisor/pn_ospfarea.py +++ b/lib/ansible/modules/network/netvisor/pn_ospfarea.py @@ -116,6 +116,9 @@ 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 3fa956ebd40d2d..db14c5ae36c05c 100644 --- a/lib/ansible/modules/network/netvisor/pn_show.py +++ b/lib/ansible/modules/network/netvisor/pn_show.py @@ -97,6 +97,9 @@ 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 a9065315cc3bf3..98e005a8447399 100644 --- a/lib/ansible/modules/network/netvisor/pn_trunk.py +++ b/lib/ansible/modules/network/netvisor/pn_trunk.py @@ -163,6 +163,9 @@ 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 47962d702c1363..67b3ba24e0f36e 100644 --- a/lib/ansible/modules/network/netvisor/pn_vlag.py +++ b/lib/ansible/modules/network/netvisor/pn_vlag.py @@ -135,6 +135,9 @@ 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 b455a5b8143bce..9c492563839e58 100644 --- a/lib/ansible/modules/network/netvisor/pn_vlan.py +++ b/lib/ansible/modules/network/netvisor/pn_vlan.py @@ -115,6 +115,9 @@ 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 b5271b2c64e5a2..343e41d711812a 100644 --- a/lib/ansible/modules/network/netvisor/pn_vrouter.py +++ b/lib/ansible/modules/network/netvisor/pn_vrouter.py @@ -149,6 +149,9 @@ 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 ef3fe495d872f2..a8a33af28bac40 100644 --- a/lib/ansible/modules/network/netvisor/pn_vrouterbgp.py +++ b/lib/ansible/modules/network/netvisor/pn_vrouterbgp.py @@ -162,6 +162,9 @@ 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 7f17778186a113..4f7f425158f6c1 100644 --- a/lib/ansible/modules/network/netvisor/pn_vrouterif.py +++ b/lib/ansible/modules/network/netvisor/pn_vrouterif.py @@ -161,6 +161,9 @@ 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 94c55cb54d09a5..d11c5981ad1065 100644 --- a/lib/ansible/modules/network/netvisor/pn_vrouterlbif.py +++ b/lib/ansible/modules/network/netvisor/pn_vrouterlbif.py @@ -102,6 +102,9 @@ 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 000da54a0d14f0..5ee983476c73d0 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 93721e61e1f86d..4e1160c1a2fb9f 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 c34bb92683e5fe..8d1d1cb1f40278 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 f858945d953c7d..af022dfc246fee 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 5cd96c702e57bd..1a5289983ff83e 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 504edc40da6965..f212fc7d97ce1b 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 cd79147fb7108d..a04e393913cec6 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 748f4ea0940791..ad21459c243f32 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 234e7452fd3140..7002d8b7c301f6 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 b2db9105153636..c55b87b7c5bf79 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 0c40f1f375ad59..9c8de1e62cd460 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 ae4742f192fdb0..11165f31260401 100644 --- a/lib/ansible/modules/network/ordnance/ordnance_facts.py +++ b/lib/ansible/modules/network/ordnance/ordnance_facts.py @@ -216,6 +216,7 @@ def parse_operstatus(self, data): 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 399eae6a65e587..a629b3e923c233 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 375df068b0b915..130acf5c4ec17a 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 396e84036d7ec3..00dba29b45e158 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 ffc9964b3fad71..8c8447e2d90eb2 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 3c16935571b32d..6b7e0f90a76dc2 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 0ac7944566ead6..070812e24c4d7b 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 fea5f87e83be74..29284baf83a708 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 9808c7b94f07b8..33388933dfbf2d 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 737259629809d0..c0d867f0382420 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 fa5c719d83e59a..6594270eb6c2a1 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 19d55fd934842a..d2151c5f9dc4fa 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 78cc60fda43001..a52d2eb422e638 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 85c401f9d67630..4d432e9267b816 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 adab99380c4bdb..4cb19cad2a99f3 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 712fe51dacb71a..88159ea4c4af5d 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 88f0c9546edc1d..57503b92f9b203 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 90ce7d50892601..6f4361d25bf7ab 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 c09327d9fa067f..a41b0491faa4a8 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 e43b7ef95f07fd..cc3668ca78c9e4 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 01ef58ad5b18e2..e9208dc7d23216 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 eb793b6fa44942..1ec1c3493a503a 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 02afe130b13f79..1d8d6f8c070a0d 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 76743d2e32b8c0..9c5e8e1d59e3a7 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 feeed07614e767..d224f3977f0d63 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 2f08b4c7192ac8..5c084a57239113 100644 --- a/lib/ansible/modules/packaging/os/zypper.py +++ b/lib/ansible/modules/packaging/os/zypper.py @@ -198,6 +198,9 @@ 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 1c8b7a890bf299..1369575b8731e3 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 64774032af1c46..e0cb231f46578c 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 9b3a6c0dd8fc07..ab1b72d1fa1979 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 1d65cd62d973a4..c0336216bff21e 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 074c7c1c9f4d91..ac89ac9e673881 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 e71a52bd20272a..eae4ac2fd1a4af 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 7e17b8ea852972..07f066577fe097 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 7f432bdeab76ae..82a16b0a046bb2 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 3eff7159716e4f..6f9b38ae7e27b9 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 d635e548665e87..bbfe002811d990 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 a4d82ceb0a0928..93bef8d95c868e 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 458fa54af93317..337303b3afcd62 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 9181082549afc6..ad11ae2e6c962b 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 84e755e522a1fb..5d75ea5528fca2 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 419327c648521c..093bf38276906f 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 e60918882795c0..a73eeaae5c38c8 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 ca9646f7249353..4f4da5edfd80d6 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 ecd313a63d6bfd..1e326fb28b73da 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 8e1709b2410be0..f96319e5aaa8ed 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 e5784b19d0bbaa..983a887765b3c2 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 5705be573478ca..165ebbb8b796a9 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 3c1df4064f2c50..7b49447f58d2aa 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 3108b75f9426d0..818e41bb4cd081 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 3526818e84c9c9..c5cda633d7c7be 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 a9f50f3b6a72d9..0dc3c38b051413 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 59add7fb650e3f..161f2e6f5063ce 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 716893de8f07f1..900c4d73b6abcd 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 88acb22b1dcf81..8ccebd8111eb6a 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 cdbfe9885084db..c09fafc55acc2d 100644 --- a/lib/ansible/modules/web_infrastructure/apache2_module.py +++ b/lib/ansible/modules/web_infrastructure/apache2_module.py @@ -108,6 +108,9 @@ 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 b209c144a6067f..f6a829dc409fdd 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 a74a7f6e49ff81..1629ab1bed1708 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 9d84bb7ee5c621..fcdfb73a30b8fd 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 ac912b77fe8ddf..70f79df3ab4673 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 b1755d67e23b44..edacfe39cea80d 100644 --- a/lib/ansible/modules/web_infrastructure/supervisorctl.py +++ b/lib/ansible/modules/web_infrastructure/supervisorctl.py @@ -236,5 +236,6 @@ def take_action_on_processes(processes, status_filter, action, expected_result): 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 155d42986ca48c..df3627d99f3568 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 f055802a023732..fc752fe50c48e4 100644 --- a/lib/ansible/plugins/callback/dense.py +++ b/lib/ansible/plugins/callback/dense.py @@ -493,6 +493,7 @@ def v2_playbook_on_stats(self, stats): 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 fe3c3dbdf7208d..b12101e8e1b12d 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 17670dd2ea318c..e84d00135d442a 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 3c5b125b0b63b5..11e58444fdca89 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 fab4dbb3f3ff32..163494b6aebcc6 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 e4093bcb3021e6..3098bc601cbac1 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 873f7e78813d7f..838f2f07ea4b3d 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 375d87dfc5b01d..f19cd1c5ef70db 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 bb6f4e879ce89f..f98798a67007d0 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 99957d3b2457f0..1e8c14f4a49dd0 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 @@ def __init__(self): 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 b19fa9bd116f00..7dcbea51f7b091 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 @@ def test_key_value_instance_variable_assignment(self): 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 1948cfc0aaa13b..342ec550d05a1d 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 ea5f540fcdb827..a2f896557975b2 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 bed851b747db2f..850bf8898a0fd4 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