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.
This commit is contained in:
Matt Clay 2019-08-22 10:08:27 -07:00
parent e5861eb468
commit 2eff25aef8

View file

@ -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'