mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 09:51:09 +03:00
add host variable dash fix as a migration
This commit is contained in:
parent
6ab70a2f60
commit
fd18e2eebd
23
awx/main/migrations/0033_v303_v245_host_variable_fix.py
Normal file
23
awx/main/migrations/0033_v303_v245_host_variable_fix.py
Normal file
@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
from awx.main.migrations import _migration_utils as migration_utils
|
||||
|
||||
|
||||
def update_dashed_host_variables(apps, schema_editor):
|
||||
Host = apps.get_model('main', 'Host')
|
||||
for host in Host.objects.filter(variables='---'):
|
||||
host.variables = ''
|
||||
host.save()
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('main', '0032_v302_credential_permissions_update'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(migration_utils.set_current_apps_for_migrations),
|
||||
migrations.RunPython(update_dashed_host_variables),
|
||||
]
|
Loading…
Reference in New Issue
Block a user