mirror of https://github.com/ansible/ansible.git
Add sanity import test to ansible-test. (#26730)
* Add sanity import test to ansible-test. * Run sanity import test on all python versions.pull/26735/head
parent
74cc99fa35
commit
0b784c65b1
@ -0,0 +1 @@
|
||||
../../../../../lib/ansible/module_utils
|
@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env python
|
||||
"""Import the given python module(s) and report error(s) encountered."""
|
||||
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import imp
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
|
||||
def main():
|
||||
"""Main program function."""
|
||||
base_dir = os.getcwd()
|
||||
messages = set()
|
||||
|
||||
for path in sys.argv[1:]:
|
||||
try:
|
||||
with open(path, 'r') as module_fd:
|
||||
imp.load_module('module_import_test', module_fd, os.path.abspath(path), ('.py', 'r', imp.PY_SOURCE))
|
||||
except Exception as ex: # pylint: disable=locally-disabled, broad-except
|
||||
exc_type, _, exc_tb = sys.exc_info()
|
||||
message = str(ex)
|
||||
results = list(reversed(traceback.extract_tb(exc_tb)))
|
||||
source = None
|
||||
line = None
|
||||
|
||||
for result in results:
|
||||
if result[0].startswith(base_dir):
|
||||
source = result[0][len(base_dir) + 1:].replace('test/runner/import/', '')
|
||||
line = result[1]
|
||||
break
|
||||
|
||||
if not source:
|
||||
source = path
|
||||
line = 0
|
||||
message += ' (in %s:%d)' % (results[-1][0], results[-1][1])
|
||||
|
||||
error = '%s:%d:0: %s: %s' % (source, line, exc_type.__name__, message)
|
||||
|
||||
if error not in messages:
|
||||
messages.add(error)
|
||||
print(error)
|
||||
|
||||
if messages:
|
||||
exit(10)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -0,0 +1 @@
|
||||
injector.py
|
@ -0,0 +1,112 @@
|
||||
lib/ansible/module_utils/ansible_tower.py
|
||||
lib/ansible/module_utils/avi.py
|
||||
lib/ansible/module_utils/azure_rm_common.py
|
||||
lib/ansible/module_utils/ovirt.py
|
||||
lib/ansible/module_utils/six/__init__.py
|
||||
lib/ansible/modules/cloud/amazon/cloudformation.py
|
||||
lib/ansible/modules/cloud/amazon/cloudtrail.py
|
||||
lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options.py
|
||||
lib/ansible/modules/cloud/amazon/ec2_vpc_igw.py
|
||||
lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py
|
||||
lib/ansible/modules/cloud/amazon/ec2_win_password.py
|
||||
lib/ansible/modules/cloud/amazon/iam_cert_facts.py
|
||||
lib/ansible/modules/cloud/amazon/s3_sync.py
|
||||
lib/ansible/modules/cloud/azure/azure.py
|
||||
lib/ansible/modules/cloud/centurylink/clc_firewall_policy.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_account.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_affinitygroup.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_cluster.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_domain.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_facts.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_firewall.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_host.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_instance_nic.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_instancegroup.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_ip_address.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_iso.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule_member.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_network.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_network_acl.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_network_acl_rule.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_pod.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_project.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_region.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_resourcelimit.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_role.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_sshkeypair.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_staticnat.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_vpc.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_vpn_gateway.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_zone.py
|
||||
lib/ansible/modules/cloud/cloudstack/cs_zone_facts.py
|
||||
lib/ansible/modules/cloud/dimensiondata/dimensiondata_network.py
|
||||
lib/ansible/modules/cloud/docker/docker_secret.py
|
||||
lib/ansible/modules/cloud/google/gc_storage.py
|
||||
lib/ansible/modules/cloud/google/gcdns_record.py
|
||||
lib/ansible/modules/cloud/google/gcdns_zone.py
|
||||
lib/ansible/modules/cloud/misc/serverless.py
|
||||
lib/ansible/modules/cloud/openstack/os_client_config.py
|
||||
lib/ansible/modules/cloud/openstack/os_ironic.py
|
||||
lib/ansible/modules/cloud/ovirt/ovirt_disks.py
|
||||
lib/ansible/modules/cloud/univention/udm_user.py
|
||||
lib/ansible/modules/cloud/vmware/vca_nat.py
|
||||
lib/ansible/modules/cloud/webfaction/webfaction_app.py
|
||||
lib/ansible/modules/cloud/webfaction/webfaction_db.py
|
||||
lib/ansible/modules/cloud/webfaction/webfaction_domain.py
|
||||
lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py
|
||||
lib/ansible/modules/cloud/webfaction/webfaction_site.py
|
||||
lib/ansible/modules/clustering/consul_acl.py
|
||||
lib/ansible/modules/clustering/consul_kv.py
|
||||
lib/ansible/modules/messaging/rabbitmq_binding.py
|
||||
lib/ansible/modules/messaging/rabbitmq_exchange.py
|
||||
lib/ansible/modules/messaging/rabbitmq_queue.py
|
||||
lib/ansible/modules/monitoring/circonus_annotation.py
|
||||
lib/ansible/modules/network/cloudengine/ce_file_copy.py
|
||||
lib/ansible/modules/network/cumulus/_cl_img_install.py
|
||||
lib/ansible/modules/network/f5/bigip_command.py
|
||||
lib/ansible/modules/network/f5/bigip_config.py
|
||||
lib/ansible/modules/network/f5/bigip_gtm_pool.py
|
||||
lib/ansible/modules/network/f5/bigip_gtm_wide_ip.py
|
||||
lib/ansible/modules/network/f5/bigip_hostname.py
|
||||
lib/ansible/modules/network/f5/bigip_iapp_service.py
|
||||
lib/ansible/modules/network/f5/bigip_iapp_template.py
|
||||
lib/ansible/modules/network/f5/bigip_irule.py
|
||||
lib/ansible/modules/network/f5/bigip_pool.py
|
||||
lib/ansible/modules/network/f5/bigip_provision.py
|
||||
lib/ansible/modules/network/f5/bigip_qkview.py
|
||||
lib/ansible/modules/network/f5/bigip_snmp.py
|
||||
lib/ansible/modules/network/f5/bigip_snmp_trap.py
|
||||
lib/ansible/modules/network/f5/bigip_ssl_certificate.py
|
||||
lib/ansible/modules/network/f5/bigip_user.py
|
||||
lib/ansible/modules/network/f5/bigip_virtual_address.py
|
||||
lib/ansible/modules/network/ios/ios_static_route.py
|
||||
lib/ansible/modules/network/lenovo/cnos_backup.py
|
||||
lib/ansible/modules/network/lenovo/cnos_bgp.py
|
||||
lib/ansible/modules/network/lenovo/cnos_command.py
|
||||
lib/ansible/modules/network/lenovo/cnos_conditional_command.py
|
||||
lib/ansible/modules/network/lenovo/cnos_conditional_template.py
|
||||
lib/ansible/modules/network/lenovo/cnos_factory.py
|
||||
lib/ansible/modules/network/lenovo/cnos_facts.py
|
||||
lib/ansible/modules/network/lenovo/cnos_image.py
|
||||
lib/ansible/modules/network/lenovo/cnos_interface.py
|
||||
lib/ansible/modules/network/lenovo/cnos_portchannel.py
|
||||
lib/ansible/modules/network/lenovo/cnos_reload.py
|
||||
lib/ansible/modules/network/lenovo/cnos_rollback.py
|
||||
lib/ansible/modules/network/lenovo/cnos_save.py
|
||||
lib/ansible/modules/network/lenovo/cnos_showrun.py
|
||||
lib/ansible/modules/network/lenovo/cnos_template.py
|
||||
lib/ansible/modules/network/lenovo/cnos_vlag.py
|
||||
lib/ansible/modules/network/lenovo/cnos_vlan.py
|
||||
lib/ansible/modules/network/nxos/nxos_file_copy.py
|
||||
lib/ansible/modules/packaging/language/maven_artifact.py
|
||||
lib/ansible/modules/packaging/os/rhn_channel.py
|
||||
lib/ansible/modules/packaging/os/rhn_register.py
|
||||
lib/ansible/modules/storage/infinidat/infini_export.py
|
||||
lib/ansible/modules/storage/infinidat/infini_export_client.py
|
||||
lib/ansible/modules/storage/infinidat/infini_fs.py
|
||||
lib/ansible/modules/storage/infinidat/infini_host.py
|
||||
lib/ansible/modules/storage/infinidat/infini_pool.py
|
||||
lib/ansible/modules/storage/infinidat/infini_vol.py
|
||||
lib/ansible/modules/utilities/helper/_accelerate.py
|
||||
lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_wait.py
|
Loading…
Reference in New Issue