fixed isolated instance query

* Was considering an isolated instance: any instance that has at least 1
group with no controller. This is technically correct since an iso node
can not be a part of a non-iso group.
* The query is now more robust and considers a node an iso node if ALL
groups that a node belong to ALL have a controller.
* Also added better debugging for the special tower instance group
* Added a check for the existance of the special tower group so that
logs are less "messy" during the install process.
This commit is contained in:
chris meyers
2018-04-03 13:50:57 -04:00
parent 652bdf7875
commit c3100afd0e
3 changed files with 11 additions and 7 deletions

View File

@@ -114,7 +114,7 @@ class InstanceManager(models.Manager):
return "tower"
def all_non_isolated(self):
return self.filter(rampart_groups__controller__isnull=True).distinct()
return self.exclude(rampart_groups__controller__isnull=False)
class InstanceGroupManager(models.Manager):