1
0
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:
Wayne Witzel III 2016-09-23 09:12:36 -04:00
parent 6ab70a2f60
commit fd18e2eebd

View 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),
]