From b5986c0eb6d39647ea04a2d48d04d999c65e6e8a Mon Sep 17 00:00:00 2001 From: samitab Date: Fri, 20 Oct 2023 19:52:14 +1000 Subject: [PATCH] [ignore] Handle classes that don't support annotation --- plugins/modules/aci_rest.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/modules/aci_rest.py b/plugins/modules/aci_rest.py index 4e2442cb4..20d4f942f 100644 --- a/plugins/modules/aci_rest.py +++ b/plugins/modules/aci_rest.py @@ -291,6 +291,8 @@ from ansible_collections.cisco.aci.plugins.module_utils.aci import ACIModule, aci_argument_spec, aci_annotation_spec from ansible.module_utils._text import to_text +ANNOTATION_UNSUPPORTED = ["tagTag"] + def update_qsl(url, params): """Add or update a URL query string""" @@ -310,7 +312,9 @@ def update_qsl(url, params): def add_annotation(annotation, payload): """Add annotation to payload only if it has not already been added""" if annotation: - for val in payload.values(): + for key, val in payload.items(): + if key in ANNOTATION_UNSUPPORTED: + return att = val.get("attributes", {}) if "annotation" not in att.keys(): att["annotation"] = annotation @@ -320,6 +324,8 @@ def add_annotation_xml(annotation, tree): """Add annotation to payload xml only if it has not already been added""" if annotation: for element in tree.iter(): + if element.tag in ANNOTATION_UNSUPPORTED: + return ann = element.get("annotation") if ann is None: element.set("annotation", annotation)