Fix tests

This commit is contained in:
Shane McDonald 2020-10-09 15:33:13 -04:00 committed by Alan Rominger
parent 96fc38d182
commit e61f79c8c3
No known key found for this signature in database
GPG Key ID: C2D7EAAA12B63559

View File

@ -875,7 +875,6 @@ class Command(BaseCommand):
raw_source = options.get('source', None)
if not raw_source:
raise CommandError('--source is required')
source = Command.get_source_absolute_path(raw_source)
verbosity = int(options.get('verbosity', 1))
self.set_logging_level(verbosity)
venv_path = options.get('venv', None)
@ -893,8 +892,11 @@ class Command(BaseCommand):
raise CommandError('Inventory with %s = %s returned multiple results' % list(q.items())[0])
logger.info('Updating inventory %d: %s' % (inventory.pk, inventory.name))
# Create ad-hoc inventory source and inventory update objects
with ignore_inventory_computed_fields():
source = Command.get_source_absolute_path(raw_source)
inventory_source, created = InventorySource.objects.get_or_create(
inventory=inventory,
source='file',