CiscoDevNet / ansible-dcnm

Apache License 2.0
47 stars 37 forks source link

VerifyPlaybookParams(): parameter validation fixes #335

Closed allenrobel closed 3 weeks ago

allenrobel commented 1 month ago

Fixes for incorrect parameter validation

  1. VerifyPlaybookParams().update_decision_set()

Conditional for playbook_is_valid should compare to False explicitly since playbook_is_valid might be None.

  1. VerifyPlaybookParams().update_decision_set()

If checks for all sources for the parameter value (playbook, controller, template default) return None (i.e. the parameter should not be considered when validating the dependent parameter), then we now set the decision_set to {True} (meaning "accept" the parameter as valid).

  1. Add a knob skip_validation which, if True, will send the playbook to NDFC without verifying its content. The idea being that this knob will help determine if parameter validation is disallowing something that NDFC would accept. Default for skip_validation is False.

  2. Improve KeyError() message content to include class_name and method_name.

  3. plugins/modules/dcnm_fabric.py: EXAMPLE section. Added example using skip_validation

  4. plugins/modules/dcnm_fabric.py: EXAMPLE section. Added example that generates an error message and provides interpretation of the error message.