mirror of
https://github.com/ansible/awx.git
synced 2026-03-21 02:47:35 -02:30
fix instance migration is_isolated() issue
* Older versions of Instance model code may not contain the is_isolated() method. This change accounts for that fact.
This commit is contained in:
@@ -7,7 +7,10 @@ from django.db import migrations
|
|||||||
def _generate_new_uuid_for_iso_nodes(apps, schema_editor):
|
def _generate_new_uuid_for_iso_nodes(apps, schema_editor):
|
||||||
Instance = apps.get_model('main', 'Instance')
|
Instance = apps.get_model('main', 'Instance')
|
||||||
for instance in Instance.objects.all():
|
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.uuid = str(uuid4())
|
||||||
instance.save()
|
instance.save()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user