From 06eabc44104512d9682bb3ee88f84f81ee376a8d Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Thu, 3 Aug 2017 08:22:01 -0400 Subject: [PATCH] silence benign errors from inventory computed fields task --- awx/main/tasks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 9858d1db0f..1acd5ab432 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -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)) 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)