[in progress] Azure support.

This commit is contained in:
Luke Sneeringer
2014-07-28 13:22:58 -05:00
parent e19984d6db
commit 95567ff004
8 changed files with 324 additions and 29 deletions

View File

@@ -14,6 +14,7 @@ from django.core.urlresolvers import reverse
# AWX
from awx.main import storage
from awx.main.constants import CLOUD_PROVIDERS
from awx.main.utils import decrypt_field
from awx.main.models.base import *
@@ -34,6 +35,7 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique):
('rax', _('Rackspace')),
('vmware', _('VMWare')),
('gce', _('Google Compute Engine')),
('azure', _('Windows Azure')),
]
PASSWORD_FIELDS = ('password', 'ssh_key_data', 'ssh_key_unlock',
@@ -312,7 +314,7 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique):
# If update_fields has been specified, add our field names to it,
# if hit hasn't been specified, then we're just doing a normal save.
update_fields = kwargs.get('update_fields', [])
cloud = self.kind in ('aws', 'rax', 'gce', 'vmware', 'azure')
cloud = self.kind in CLOUD_PROVIDERS + ('aws',)
if self.cloud != cloud:
self.cloud = cloud
if 'cloud' not in update_fields: