Follow up fix #7737

The original fix introduced migration failure, this PR managed to fix
that.

Signed-off-by: Aaron Tan <jangsutsr@gmail.com>
This commit is contained in:
Aaron Tan 2017-10-26 11:15:07 -04:00
parent 9e8ac3b09b
commit 7181bd1c9b
No known key found for this signature in database
GPG Key ID: B0B709D324AE4963

View File

@ -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()