Merge pull request #5823 from chrismeyersfsu/fix-instance_migration2

fix instance migration is_isolated() issue

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot]
2020-02-05 14:52:18 +00:00
committed by GitHub

View File

@@ -7,7 +7,10 @@ from django.db import migrations
def _generate_new_uuid_for_iso_nodes(apps, schema_editor):
Instance = apps.get_model('main', 'Instance')
for instance in Instance.objects.all():
if instance.is_isolated():
# The below code is a copy paste of instance.is_isolated()
# We can't call is_isolated because we are using the "old" version
# of the Instance definition.
if instance.rampart_groups.filter(controller__isnull=False).exists():
instance.uuid = str(uuid4())
instance.save()