1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 01:21:21 +03:00

Update group cluster policies on save, not just created

Currently updating policy settings doesn't trigger a re-evaluation of
instance group policies, this makes sure we re-evaluate in the event
that anything changes.
This commit is contained in:
Matthew Jones 2018-04-24 21:40:11 -04:00
parent 2d9c4cff32
commit 05419d010b
No known key found for this signature in database
GPG Key ID: 76A4C17A97590C1C

View File

@ -192,9 +192,8 @@ class JobOrigin(models.Model):
@receiver(post_save, sender=InstanceGroup) @receiver(post_save, sender=InstanceGroup)
def on_instance_group_saved(sender, instance, created=False, raw=False, **kwargs): def on_instance_group_saved(sender, instance, created=False, raw=False, **kwargs):
if created: from awx.main.tasks import apply_cluster_membership_policies
from awx.main.tasks import apply_cluster_membership_policies connection.on_commit(lambda: apply_cluster_membership_policies.apply_async())
connection.on_commit(lambda: apply_cluster_membership_policies.apply_async())
@receiver(post_save, sender=Instance) @receiver(post_save, sender=Instance)