properly set InventorySource.status for CLI-based inventory_import

see: https://github.com/ansible/tower/issues/2476
This commit is contained in:
Ryan Petrello 2018-07-17 14:04:50 -04:00
parent d2eeafd5f5
commit 7adc6c6f73
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -1062,6 +1062,8 @@ class Command(BaseCommand):
self.inventory_update.result_traceback = tb
self.inventory_update.status = status
self.inventory_update.save(update_fields=['status', 'result_traceback'])
self.inventory_source.status = status
self.inventory_source.save(update_fields=['status'])
if exc and isinstance(exc, CommandError):
sys.exit(1)