mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03: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:
parent
e54fd19bca
commit
a36bf4af64
@ -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()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user