silence benign errors from inventory computed fields task

This commit is contained in:
AlanCoding
2017-08-03 08:22:01 -04:00
parent 2f07c0a2e5
commit 06eabc4410

View File

@@ -393,7 +393,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)) logger.error("Update Inventory Computed Fields failed due to missing inventory: " + str(inventory_id))
return return
i = i[0] 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) @task(queue='tower', base=LogErrorsTask)