From 2eff25aef87b27050b05841a7bafc401c951a270 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 22 Aug 2019 10:08:27 -0700 Subject: [PATCH] Update ansible-test network inventory handling. DCI uses an inventory directory instead of a file, along with --no-temp-workdir. This changes the inventory check to keep that scenario working until all DCI jobs can be migrated to Zuul. --- test/lib/ansible_test/_internal/executor.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/lib/ansible_test/_internal/executor.py b/test/lib/ansible_test/_internal/executor.py index 33e43e6e692..27e3e5b0a38 100644 --- a/test/lib/ansible_test/_internal/executor.py +++ b/test/lib/ansible_test/_internal/executor.py @@ -399,7 +399,13 @@ def command_network_integration(args): else: inventory_path = os.path.join(data_context().content.root, inventory_relative_path) - if not args.explain and not args.platform and not os.path.isfile(inventory_path): + if args.no_temp_workdir: + # temporary solution to keep DCI tests working + inventory_exists = os.path.exists(inventory_path) + else: + inventory_exists = os.path.isfile(inventory_path) + + if not args.explain and not args.platform and not inventory_exists: raise ApplicationError( 'Inventory not found: %s\n' 'Use --inventory to specify the inventory path.\n'