Skip to content

Commit

Permalink
[ignore] leverage mutually exclusive instead of in codeconditional
Browse files Browse the repository at this point in the history
  • Loading branch information
akinross authored and lhercot committed Aug 6, 2024
1 parent 6ab6ab5 commit 661ae60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions plugins/modules/mso_schema_site_bd_l3out.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ def main():
site=dict(type="str", required=True),
template=dict(type="str", required=True),
bd=dict(type="str", required=True),
l3out=dict(type="dict", options=mso_l3out_reference_spec(), aliases=["name"]), # This parameter is not required for querying all objects
l3out=dict(
type="dict", options=mso_l3out_reference_spec(), aliases=["name"], mutually_exclusive=[("tenant", "schema"), ("tenant", "template")]
), # This parameter is not required for querying all objects
state=dict(type="str", default="present", choices=["absent", "present", "query"]),
)

Expand Down Expand Up @@ -207,9 +209,6 @@ def main():

if l3out:

if l3out.get("tenant") and (l3out.get("schema") or l3out.get("template")):
module.fail_json(msg="L3out tenant cannot be specified in combination with schema or template")

if l3out.get("tenant"):
l3out_ref = "uni/tn-{0}/out-{1}".format(l3out.get("tenant"), l3out.get("name"))
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,11 @@
- nm_remove_l3out_on_apic.previous.tenant == "ansible_test"
- nm_remove_l3out_on_apic.current == {}
- nm_create_l3out_schema_error is failed
- nm_create_l3out_schema_error.msg == "L3out tenant cannot be specified in combination with schema or template"
- nm_create_l3out_schema_error.msg == "parameters are mutually exclusive{{":"}} tenant|schema found in l3out"
- nm_create_l3out_template_error is failed
- nm_create_l3out_template_error.msg == "L3out tenant cannot be specified in combination with schema or template"
- nm_create_l3out_template_error.msg == "parameters are mutually exclusive{{":"}} tenant|template found in l3out"
- nm_create_l3out_both_error is failed
- nm_create_l3out_both_error.msg == "L3out tenant cannot be specified in combination with schema or template"
- nm_create_l3out_both_error.msg == "parameters are mutually exclusive{{":"}} tenant|schema, tenant|template found in l3out"

always:

Expand Down

0 comments on commit 661ae60

Please sign in to comment.