mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 11:40:05 -03:30
docs and review change for IS multivault
Mention inventory sources /credentials/ endpoint in docs Also change means of identifying projects for the purose of injecting custom credentials
This commit is contained in:
@@ -2735,11 +2735,8 @@ class InventorySourceCredentialsList(SubListAttachDetachAPIView):
|
||||
if error:
|
||||
return {'msg': error}
|
||||
if sub.credential_type == 'vault':
|
||||
# Vault credentials are only exclusive with others of same ID
|
||||
if sub.unique_hash() in [cred.unique_hash() for cred in parent.credentials.all()]:
|
||||
return {"msg": _(
|
||||
"A credential of type {credential_type} is already assigned to this inventory source."
|
||||
).format(credential_type=sub.unique_hash(display=True))}
|
||||
# TODO: support this
|
||||
return {"msg": _("Vault credentials are not yet supported for inventory sources.")}
|
||||
else:
|
||||
# Cloud credentials are exclusive with all other cloud credentials
|
||||
cloud_cred_qs = parent.credentials.exclude(credential_type__kind='vault')
|
||||
|
||||
@@ -927,8 +927,8 @@ class BaseTask(LogErrorsTask):
|
||||
elif isinstance(instance, InventoryUpdate):
|
||||
# TODO: allow multiple custom creds for inv updates
|
||||
credentials = [instance.get_cloud_credential()]
|
||||
elif hasattr(instance, 'credential'):
|
||||
# once other UnifiedJobs (project updates)
|
||||
elif isinstance(instance, Project):
|
||||
# once (or if) project updates
|
||||
# move from a .credential -> .credentials model, we can
|
||||
# lose this block
|
||||
credentials = [instance.credential]
|
||||
|
||||
Reference in New Issue
Block a user