mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 08:37:48 -02:30
Enforce mutually exclusive options in credential module of the collection (#14363)
This commit is contained in:
@@ -46,6 +46,7 @@ options:
|
|||||||
organization:
|
organization:
|
||||||
description:
|
description:
|
||||||
- Organization name, ID, or named URL that should own the credential.
|
- Organization name, ID, or named URL that should own the credential.
|
||||||
|
- This parameter is mutually exclusive with C(team) and C(user).
|
||||||
type: str
|
type: str
|
||||||
credential_type:
|
credential_type:
|
||||||
description:
|
description:
|
||||||
@@ -93,10 +94,12 @@ options:
|
|||||||
user:
|
user:
|
||||||
description:
|
description:
|
||||||
- User name, ID, or named URL that should own this credential.
|
- User name, ID, or named URL that should own this credential.
|
||||||
|
- This parameter is mutually exclusive with C(organization) and C(team).
|
||||||
type: str
|
type: str
|
||||||
team:
|
team:
|
||||||
description:
|
description:
|
||||||
- Team name, ID, or named URL that should own this credential.
|
- Team name, ID, or named URL that should own this credential.
|
||||||
|
- This parameter is mutually exclusive with C(organization) and C(user).
|
||||||
type: str
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
@@ -219,8 +222,13 @@ def main():
|
|||||||
state=dict(choices=['present', 'absent', 'exists'], default='present'),
|
state=dict(choices=['present', 'absent', 'exists'], default='present'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
mutually_exclusive = [("organization", "user", "team")]
|
||||||
|
|
||||||
# Create a module for ourselves
|
# Create a module for ourselves
|
||||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
module = ControllerAPIModule(
|
||||||
|
argument_spec=argument_spec,
|
||||||
|
mutually_exclusive=mutually_exclusive
|
||||||
|
)
|
||||||
|
|
||||||
# Extract our parameters
|
# Extract our parameters
|
||||||
name = module.params.get('name')
|
name = module.params.get('name')
|
||||||
|
|||||||
Reference in New Issue
Block a user