Merge pull request #1222 from chrismeyersfsu/fix-isolated_query

use non-deprecated way of setting many2many
This commit is contained in:
Chris Meyers 2018-04-03 14:40:26 -04:00 committed by GitHub
commit 21e8661fae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -148,7 +148,7 @@ def apply_cluster_membership_policies(self):
tower_q = InstanceGroup.objects.filter(name='tower')
if tower_q.exists():
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()]
logger.info(six.text_type("Setting 'tower' group instances to {}").format(instances_hostnames))
tower_inst.save()