mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 21:07:39 -02:30
Add tests for changed flag on job events.
This commit is contained in:
@@ -1130,11 +1130,9 @@ class JobEvent(models.Model):
|
||||
def save(self, *args, **kwargs):
|
||||
if self.event in self.FAILED_EVENTS:
|
||||
self.failed = True
|
||||
try:
|
||||
if self.event_data['res']['changed']:
|
||||
self.changed = True
|
||||
except (KeyError, IndexError, AttributeError):
|
||||
pass
|
||||
res = self.event_data.get('res', None)
|
||||
if isinstance(res, dict) and res.get('changed', False):
|
||||
self.changed = True
|
||||
try:
|
||||
if not self.host and self.event_data.get('host', ''):
|
||||
self.host = self.job.inventory.hosts.get(name=self.event_data['host'])
|
||||
|
||||
Reference in New Issue
Block a user