From 7181bd1c9bd1158e168ae3a5a796b737cdc4c2b0 Mon Sep 17 00:00:00 2001 From: Aaron Tan Date: Thu, 26 Oct 2017 11:15:07 -0400 Subject: [PATCH] Follow up fix #7737 The original fix introduced migration failure, this PR managed to fix that. Signed-off-by: Aaron Tan --- awx/main/migrations/_credentialtypes.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/awx/main/migrations/_credentialtypes.py b/awx/main/migrations/_credentialtypes.py index c9732b6239..e0ccb873ea 100644 --- a/awx/main/migrations/_credentialtypes.py +++ b/awx/main/migrations/_credentialtypes.py @@ -179,10 +179,7 @@ def create_ovirt4_credtype(apps, schema_editor): def add_azure_cloud_environment_field(apps, schema_editor): - azure_rm_credtype = CredentialType.defaults.get('azure_rm', None) - if azure_rm_credtype: - azure_rm_credtype = azure_rm_credtype() - azure_rm_credtype.pk = CredentialType.objects.get( - kind='cloud', name='Microsoft Azure Resource Manager' - ).pk - azure_rm_credtype.save() + azure_rm_credtype = CredentialType.objects.get(kind='cloud', + name='Microsoft Azure Resource Manager') + azure_rm_credtype.inputs = CredentialType.defaults.get('azure_rm')().inputs + azure_rm_credtype.save()