AC-550 Expose license errors flag, update how license error shows in inventory update stdout.

This commit is contained in:
Chris Church 2013-10-31 12:49:39 -04:00
parent 895c908f5a
commit 18ecdb65da
2 changed files with 6 additions and 4 deletions

View File

@ -743,5 +743,7 @@ class Command(NoArgsCommand):
self.inventory_update.save(update_fields=['status', 'result_traceback'])
transaction.commit()
if exc:
if exc and isinstance(exc, CommandError):
sys.exit(1)
elif exc:
raise exc

View File

@ -65,8 +65,8 @@ SUMMARIZABLE_FK_FIELDS = {
'job_template': DEFAULT_SUMMARY_FIELDS,
'last_job': DEFAULT_SUMMARY_FIELDS + ('status', 'failed',),
'last_job_host_summary': DEFAULT_SUMMARY_FIELDS + ('failed',),
'last_update': DEFAULT_SUMMARY_FIELDS + ('status', 'failed',),
'current_update': DEFAULT_SUMMARY_FIELDS + ('status', 'failed',),
'last_update': DEFAULT_SUMMARY_FIELDS + ('status', 'failed', 'license_error'),
'current_update': DEFAULT_SUMMARY_FIELDS + ('status', 'failed', 'license_error'),
'inventory_source': ('source', 'last_updated', 'status'),
}
@ -723,7 +723,7 @@ class InventoryUpdateSerializer(BaseSerializer):
fields = ('id', 'url', 'related', 'summary_fields', 'created',
'modified', 'inventory_source', 'status', 'failed',
'result_stdout', 'result_traceback', 'job_args', 'job_cwd',
'job_env')
'job_env', 'license_error')
def get_related(self, obj):
if obj is None: