Merge pull request #168 from AlanCoding/silence_computed_fields

silence benign errors from inventory computed fields task
This commit is contained in:
Alan Rominger 2017-08-08 09:24:30 -04:00 committed by GitHub
commit 8e22c7e668

View File

@ -394,7 +394,13 @@ def update_inventory_computed_fields(inventory_id, should_update_hosts=True):
logger.error("Update Inventory Computed Fields failed due to missing inventory: " + str(inventory_id))
return
i = i[0]
i.update_computed_fields(update_hosts=should_update_hosts)
try:
i.update_computed_fields(update_hosts=should_update_hosts)
except DatabaseError as e:
if 'did not affect any rows' in str(e):
logger.debug('Exiting duplicate update_inventory_computed_fields task.')
return
raise
@task(queue='tower', base=LogErrorsTask)