Use default cloud name if one isn't passed to azure plugin

This commit is contained in:
Jake McDermott
2020-01-17 12:36:04 -05:00
parent 1bf0bc8203
commit 11af21972d

View File

@@ -52,13 +52,13 @@ azure_keyvault_inputs = {
'type': 'string', 'type': 'string',
'help_text': _('Used to specify a specific secret version (if left empty, the latest version will be used).'), 'help_text': _('Used to specify a specific secret version (if left empty, the latest version will be used).'),
}], }],
'required': ['url', 'client', 'secret', 'tenant', 'cloud', 'secret_field'], 'required': ['url', 'client', 'secret', 'tenant', 'secret_field'],
} }
def azure_keyvault_backend(**kwargs): def azure_keyvault_backend(**kwargs):
url = kwargs['url'] url = kwargs['url']
[cloud] = [c for c in clouds if c.name == kwargs['cloud_name']] [cloud] = [c for c in clouds if c.name == kwargs.get('cloud_name', default_cloud.name)]
def auth_callback(server, resource, scope): def auth_callback(server, resource, scope):
credentials = ServicePrincipalCredentials( credentials = ServicePrincipalCredentials(