1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

log specific errors for problems managing lost instance

This commit is contained in:
AlanCoding 2017-08-08 14:48:21 -04:00
parent cddd9dfbef
commit 93aed04389

View File

@ -246,8 +246,11 @@ def cluster_node_heartbeat(self):
other_inst.save(update_fields=['capacity'])
logger.error("Host {} last checked in at {}, marked as lost.".format(
other_inst.hostname, other_inst.modified))
except (IntegrityError, OperationalError):
pass # another instance is updating the lost instance
except DatabaseError as e:
if 'did not affect any rows' in str(e):
logger.debug('Another instance has marked {} as lost'.format(other_inst.hostname))
else:
logger.exception('Error marking {} as lost'.format(other_inst.hostname))
@task(bind=True, base=LogErrorsTask)