Skip to content

Commit 524a9e7

Browse files
committed
[ignore] Fixed sanity issue in ndo_tenant_custom_qos_policy.
1 parent 08d5ec8 commit 524a9e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugins/modules/ndo_tenant_custom_qos_policy.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,8 @@ def main():
491491

492492
custom_qos_policies = template_object.template.get("tenantPolicyTemplate", {}).get("template", {}).get("qosPolicies", [])
493493
object_description = "Custom QoS Policy"
494+
custom_qos_policy_attrs_path = None
495+
match = None
494496

495497
if state in ["query", "absent"] and custom_qos_policies == []:
496498
mso.exit_json()
@@ -517,15 +519,15 @@ def main():
517519
dscpMappings=dscp_mappings,
518520
)
519521

520-
if mso.existing:
522+
if mso.existing and match:
521523
append_update_ops_data(ops, match.details, custom_qos_policy_attrs_path, mso_values)
522524
mso.sanitize(match.details, collate=True)
523525
else:
524526
mso.sanitize(mso_values)
525527
ops.append(dict(op="add", path="/tenantPolicyTemplate/template/qosPolicies/-", value=mso.sent))
526528

527529
elif state == "absent":
528-
if mso.existing:
530+
if mso.existing and match:
529531
ops.append(dict(op="remove", path=custom_qos_policy_attrs_path))
530532

531533
if not module.check_mode and ops:

0 commit comments

Comments
 (0)