diff --git a/awx/main/management/commands/inventory_import.py b/awx/main/management/commands/inventory_import.py index 0974dcb7fa..af4c2d88d7 100644 --- a/awx/main/management/commands/inventory_import.py +++ b/awx/main/management/commands/inventory_import.py @@ -1104,7 +1104,8 @@ class Command(BaseCommand): self.inventory_source.status = status self.inventory_source.save(update_fields=['status']) - if exc and isinstance(exc, CommandError): - sys.exit(1) - elif exc: + if exc: + logger.error(str(exc)) + if isinstance(exc, CommandError): + sys.exit(1) raise exc