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

use non-deprecated way of setting many2many

This commit is contained in:
chris meyers 2018-04-03 14:31:37 -04:00
parent 9677a9841c
commit 88fbb6706f

View File

@ -148,7 +148,7 @@ def apply_cluster_membership_policies(self):
tower_q = InstanceGroup.objects.filter(name='tower') tower_q = InstanceGroup.objects.filter(name='tower')
if tower_q.exists(): if tower_q.exists():
tower_inst = tower_q[0] tower_inst = tower_q[0]
tower_inst.instances = Instance.objects.all_non_isolated() tower_inst.instances.set(Instance.objects.all_non_isolated())
instances_hostnames = [i.hostname for i in tower_inst.instances.all()] instances_hostnames = [i.hostname for i in tower_inst.instances.all()]
logger.info(six.text_type("Setting 'tower' group instances to {}").format(instances_hostnames)) logger.info(six.text_type("Setting 'tower' group instances to {}").format(instances_hostnames))
tower_inst.save() tower_inst.save()