1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

Merge pull request #203 from chrismeyersfsu/fix-cred_openstack

require project field for openstack credential
This commit is contained in:
Chris Church 2015-05-12 17:28:09 -04:00
commit b20ba23538

View File

@ -215,6 +215,12 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique):
raise ValidationError('Password required for VMware credential.')
return password
def clean_project(self):
project = self.project or ''
if self.kind == 'openstack' and not project:
raise ValidationError('Project name required for OpenStack credential.')
return project
def _validate_ssh_private_key(self, data):
"""Validate that the given SSH private key or certificate is,
in fact, valid.