Add new credential become methods, inject instead of set in database

This commit is contained in:
Wayne Witzel III
2018-04-20 11:51:49 -04:00
parent 44470200a2
commit 8fa98d0d54
5 changed files with 40 additions and 3 deletions
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# AWX
from awx.main.migrations import _credentialtypes as credentialtypes
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0034_v330_more_oauth2_help_text'),
]
operations = [
migrations.RunPython(credentialtypes.remove_become_methods),
]
+6
View File
@@ -197,3 +197,9 @@ def add_azure_cloud_environment_field(apps, schema_editor):
name='Microsoft Azure Resource Manager')
azure_rm_credtype.inputs = CredentialType.defaults.get('azure_rm')().inputs
azure_rm_credtype.save()
def remove_become_methods(apps, schema_editor):
become_credtype = CredentialType.objects.get(kind='ssh')
become_credtype.inputs = CredentialType.defaults.get('ssh')().inputs
become_credtype.save()