mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 10:57:35 -02:30
Fix VMware capitalization
This commit is contained in:
@@ -176,7 +176,7 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique):
|
|||||||
"""
|
"""
|
||||||
host = self.host or ''
|
host = self.host or ''
|
||||||
if not host and self.kind == 'vmware':
|
if not host and self.kind == 'vmware':
|
||||||
raise ValidationError('Host required for VMWare credential.')
|
raise ValidationError('Host required for VMware credential.')
|
||||||
return host
|
return host
|
||||||
|
|
||||||
def clean_username(self):
|
def clean_username(self):
|
||||||
@@ -187,7 +187,7 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique):
|
|||||||
raise ValidationError('Username required for Rackspace '
|
raise ValidationError('Username required for Rackspace '
|
||||||
'credential.')
|
'credential.')
|
||||||
if not username and self.kind == 'vmware':
|
if not username and self.kind == 'vmware':
|
||||||
raise ValidationError('Username required for VMWare credential.')
|
raise ValidationError('Username required for VMware credential.')
|
||||||
return username
|
return username
|
||||||
|
|
||||||
def clean_password(self):
|
def clean_password(self):
|
||||||
@@ -197,7 +197,7 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique):
|
|||||||
if not password and self.kind == 'rax':
|
if not password and self.kind == 'rax':
|
||||||
raise ValidationError('API key required for Rackspace credential.')
|
raise ValidationError('API key required for Rackspace credential.')
|
||||||
if not password and self.kind == 'vmware':
|
if not password and self.kind == 'vmware':
|
||||||
raise ValidationError('Password required for VMWare credential.')
|
raise ValidationError('Password required for VMware credential.')
|
||||||
return password
|
return password
|
||||||
|
|
||||||
def _validate_ssh_private_key(self, data):
|
def _validate_ssh_private_key(self, data):
|
||||||
|
|||||||
@@ -757,7 +757,7 @@ class InventorySourceOptions(BaseModel):
|
|||||||
('ec2', _('Amazon EC2')),
|
('ec2', _('Amazon EC2')),
|
||||||
('gce', _('Google Compute Engine')),
|
('gce', _('Google Compute Engine')),
|
||||||
('azure', _('Microsoft Azure')),
|
('azure', _('Microsoft Azure')),
|
||||||
('vmware', _('VMWare')),
|
('vmware', _('VMware')),
|
||||||
]
|
]
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
@@ -858,8 +858,8 @@ class InventorySourceOptions(BaseModel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_vmware_region_choices(self):
|
def get_vmware_region_choices(self):
|
||||||
"""Return a complete list of regions in VMWare, as a list of two-tuples
|
"""Return a complete list of regions in VMware, as a list of two-tuples
|
||||||
(but note that VMWare doesn't actually have regions!).
|
(but note that VMware doesn't actually have regions!).
|
||||||
"""
|
"""
|
||||||
return [('all', 'All')]
|
return [('all', 'All')]
|
||||||
|
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ if __name__ == '__main__':
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# If any of the VMWare environment variables are set, they trump
|
# If any of the VMware environment variables are set, they trump
|
||||||
# the INI configuration.
|
# the INI configuration.
|
||||||
if 'VMWARE_HOST' in os.environ:
|
if 'VMWARE_HOST' in os.environ:
|
||||||
auth_host = os.environ['VMWARE_HOST']
|
auth_host = os.environ['VMWARE_HOST']
|
||||||
@@ -219,7 +219,7 @@ if __name__ == '__main__':
|
|||||||
if 'VMWARE_PASSWORD' in os.environ:
|
if 'VMWARE_PASSWORD' in os.environ:
|
||||||
auth_password = os.environ['VMWARE_PASSWORD']
|
auth_password = os.environ['VMWARE_PASSWORD']
|
||||||
|
|
||||||
# Create the VMWare client.
|
# Create the VMware client.
|
||||||
client = Client(auth_host, auth_user, auth_password)
|
client = Client(auth_host, auth_user, auth_password)
|
||||||
|
|
||||||
# Actually do the work.
|
# Actually do the work.
|
||||||
|
|||||||
Reference in New Issue
Block a user