From cb68110296af1cd5ee62c032894a7e6608615576 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 9 Aug 2019 11:06:21 -0700 Subject: [PATCH] Clean up ansible-test inventory templates. (#60321) * Move ansible-test inventory templates. * Remove obsolete inventoy.remote.template file. --- .gitignore | 1 - test/integration/inventory.remote.template | 9 --------- test/lib/ansible_test/_internal/executor.py | 7 +++++-- .../ansible_test/config}/inventory.networking.template | 0 .../ansible_test/config}/inventory.winrm.template | 0 5 files changed, 5 insertions(+), 12 deletions(-) delete mode 100644 test/integration/inventory.remote.template rename test/{integration => lib/ansible_test/config}/inventory.networking.template (100%) rename test/{integration => lib/ansible_test/config}/inventory.winrm.template (100%) diff --git a/.gitignore b/.gitignore index d0f1ac5f523..e94a9d8a03c 100644 --- a/.gitignore +++ b/.gitignore @@ -88,7 +88,6 @@ packaging/release/ansible_release /test/results/logs/*.log /test/results/data/*.json /test/integration/cloud-config-aws.yml -/test/integration/inventory.remote /test/integration/inventory.networking /test/integration/inventory.winrm /test/integration/cloud-config-aws.yml diff --git a/test/integration/inventory.remote.template b/test/integration/inventory.remote.template deleted file mode 100644 index 147b1977608..00000000000 --- a/test/integration/inventory.remote.template +++ /dev/null @@ -1,9 +0,0 @@ -[posix] -remote - -[posix:vars] -ansible_connection=ssh -ansible_host=@ansible_host -ansible_port=@ansible_port -ansible_user=@ansible_user -ansible_python_interpreter=/usr/local/bin/python2 diff --git a/test/lib/ansible_test/_internal/executor.py b/test/lib/ansible_test/_internal/executor.py index f9caf59437c..4657e3d681d 100644 --- a/test/lib/ansible_test/_internal/executor.py +++ b/test/lib/ansible_test/_internal/executor.py @@ -61,6 +61,7 @@ from .util import ( cmd_quote, ANSIBLE_LIB_ROOT, ANSIBLE_TEST_DATA_ROOT, + ANSIBLE_TEST_CONFIG_ROOT, ) from .util_common import ( @@ -384,6 +385,7 @@ def command_network_integration(args): :type args: NetworkIntegrationConfig """ default_filename = 'test/integration/inventory.networking' + template_path = os.path.join(ANSIBLE_TEST_CONFIG_ROOT, os.path.basename(default_filename)) + '.template' if args.inventory: filename = os.path.join('test/integration', args.inventory) @@ -398,7 +400,7 @@ def command_network_integration(args): 'Inventory not found: %s\n' 'Use --inventory to specify the inventory path.\n' 'Use --platform to provision resources and generate an inventory file.\n' - 'See also inventory template: %s.template' % (filename, default_filename) + 'See also inventory template: %s' % (filename, template_path) ) all_targets = tuple(walk_network_integration_targets(include_hidden=True)) @@ -562,9 +564,10 @@ def command_windows_integration(args): :type args: WindowsIntegrationConfig """ filename = 'test/integration/inventory.winrm' + template_path = os.path.join(ANSIBLE_TEST_CONFIG_ROOT, os.path.basename(filename)) + '.template' if not args.explain and not args.windows and not os.path.isfile(filename): - raise ApplicationError('Use the --windows option or provide an inventory file (see %s.template).' % filename) + raise ApplicationError('Use the --windows option or provide an inventory file (see %s).' % template_path) all_targets = tuple(walk_windows_integration_targets(include_hidden=True)) internal_targets = command_integration_filter(args, all_targets, init_callback=windows_init) diff --git a/test/integration/inventory.networking.template b/test/lib/ansible_test/config/inventory.networking.template similarity index 100% rename from test/integration/inventory.networking.template rename to test/lib/ansible_test/config/inventory.networking.template diff --git a/test/integration/inventory.winrm.template b/test/lib/ansible_test/config/inventory.winrm.template similarity index 100% rename from test/integration/inventory.winrm.template rename to test/lib/ansible_test/config/inventory.winrm.template