1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Make the inventory_import command log an error message on exception

when it happens in the big try/except block in the middle of handle().
Previously it wasn't doing anything with it, except exiting with a
code of 1.
This commit is contained in:
Jeff Bradberry 2019-02-21 15:57:44 -05:00
parent 7eba55fbde
commit 046385d72e

View File

@ -1104,7 +1104,8 @@ class Command(BaseCommand):
self.inventory_source.status = status self.inventory_source.status = status
self.inventory_source.save(update_fields=['status']) self.inventory_source.save(update_fields=['status'])
if exc and isinstance(exc, CommandError): if exc:
sys.exit(1) logger.error(str(exc))
elif exc: if isinstance(exc, CommandError):
sys.exit(1)
raise exc raise exc