deny topology changes to iso instances via api

This commit is contained in:
chris meyers
2018-07-06 10:58:33 -04:00
parent b445e66ffa
commit aeca21ab5b
3 changed files with 27 additions and 1 deletions

View File

@@ -120,6 +120,8 @@ class Instance(BaseModel):
def is_controller(self):
return Instance.objects.filter(rampart_groups__controller__instances=self).exists()
def is_isolated(self):
return self.rampart_groups.filter(controller__isnull=False).exists()
def refresh_capacity(self):
cpu = get_cpu_capacity()