diff --git a/ansible_collections/arista/avd/docs/contribution/eos_designs_internal_notes.md b/ansible_collections/arista/avd/docs/contribution/eos_designs_internal_notes.md index 7acccda3b21..ab654d5f3c3 100644 --- a/ansible_collections/arista/avd/docs/contribution/eos_designs_internal_notes.md +++ b/ansible_collections/arista/avd/docs/contribution/eos_designs_internal_notes.md @@ -43,8 +43,7 @@ The module is used in `arista.avd.eos_designs` to set facts for devices, which a ```yaml template_output: false> - conversion_mode: <"warning" | "info" | "debug" | "quiet" | "disabled" | default -> "debug"> - validation_mode: <"error" | "warning" | "info" | "debug" | "disabled" | default -> "warning"> + validation_mode: <"error" | "warning" | default -> "error"> cprofile_file: ``` diff --git a/ansible_collections/arista/avd/docs/contribution/input-variable-validation.md b/ansible_collections/arista/avd/docs/contribution/input-variable-validation.md index 22bff983268..49c944a422c 100644 --- a/ansible_collections/arista/avd/docs/contribution/input-variable-validation.md +++ b/ansible_collections/arista/avd/docs/contribution/input-variable-validation.md @@ -28,75 +28,35 @@ The current implementation supports the automatic conversions listed below. | `bool`, `str` | `int` | | `int`, `str` | `bool` | | `bool`, `int` | `str` | -| `dict`*, `list`** | `list` | - -\* If `primary_key` is set on the `list` schema, conversion from `dict`-of-`dicts` to `list`-of-`dicts` will insert the `primary_key` -with the value of the outer dictionary key in each `dict`. If `primary_key` is *not* set on the `list` schema, only the input `dict` -keys are returned as `list` items (any input `dict` values are lost). -\*\* If `primary_key` is set on the `list` schema, conversion from `list` to `list`-of-`dicts` will insert the `primary_key` with the -value of the input `list` items in each `dict`. An example of input variable conversion is `bgp_as`. `bgp_as` is expected as a string (`str`) since 32-bit AS numbers can be -written with dot-notation such as `"65001.10000"`. Most deployments use 16-bit AS numbers, where the setting `bgp_as: 65001` will be interpreted as an integer in YAML, unless it is enclosed in quotes `bgp_as: "65001"`. In the schema for `bgp_as` the `convert_types` option is configured to `['int']` which means AVD Action Plugins will automatically convert +written with dot-notation such as `"65001.10000"`. Most deployments use 16-bit AS numbers, where the setting `bgp_as: 65001` +will be interpreted as an integer in YAML, unless it is enclosed in quotes `bgp_as: "65001"`. In the schema for `bgp_as` the +`convert_types` option is configured to `['int']` which means AVD Action Plugins will automatically convert `bgp_as: 65001` to `bgp_as: "65001"`. -Type conversion is also used for introducing changes to the data models without affecting existing deployments. For example, -in AVD 4.0, the data models using "Dictionaries with wildcard keys" has been be changed to lists. -Ex. the old data model: - -```yaml -tenants: - mytenant: - vrfs: - myvrf: - ... -``` - -has been be changed to: - -```yaml -tenants: - - name: mytenant - vrfs: - - name: myvrf - ... -``` - -The input data will be converted automatically and validated according to the new model to allow for a gracious introduction of this data-model changes in late 3.x versions. - -Type conversion is turned on by default. - -!!! CAUTION - Although conversion can be disabled, this is **not** recommended, and will most likely lead to issues with AVD or the generated - configuration. Data conversion also handles data deprecation and upgrades. +Data conversion processing also handles deprecation warnings. ## Validation Options Schema validation is built in to the central Action plugins used in AVD. Each plugin runs variable type conversion first and then performs validation of the converted data. -By default the data conversions are logged with `-v` and data validation issues will trigger warnings - not blocking further processing. +By default any data validation issues will trigger errors - blocking further processing. This behavior can be adjusted by setting the variables described below. -```yaml -# Conversion Mode for AVD input data conversion | Optional -# During conversion, messages will generated with information about the host(s) and key(s) which required conversion. -# "disabled" means that conversion will not run - avoid this since conversion is also handling data deprecation and upgrade. -# "error" will produce error messages and fail the task. -# "warning" will produce warning messages. -# "info" will produce regular log messages. -# "debug" will produce hidden debug messages viewable with -v. -# "quiet" will not produce any messages -avd_data_conversion_mode: < "disabled" | "error" | "warning" | "info" | "debug" | "quiet" | default -> "debug" > +!!! danger + The input variable `avd_data_validation_mode` now has a default value of `error`, and while it can be set to `warning`, this is highly discouraged. + All AVD code relies on the validation to ensure valid data, so the code assumes that the data is valid. + If the validation mode is set to `warning`, execution will continue with invalid data, which can lead to hard-to-read errors or incorrect behavior. + +```yaml # Validation Mode for AVD input data validation | Optional # During validation, messages will generated with information about the host(s) and key(s) which failed validation. -# "disabled" means that validation will not run. # "error" will produce error messages and fail the task. # "warning" will produce warning messages. -# "info" will produce regular log messages. -# "debug" will produce hidden debug messages viewable with -v. -avd_data_validation_mode: < "disabled" | "error" | "warning" | "info" | "debug" | default -> "warning" > +avd_data_validation_mode: < "error" | "warning" | default -> "error" > ``` ## Schema Details @@ -228,13 +188,11 @@ The meta-schema does not allow for other keys to be set in the schema. | Key | Type | Required | Default | Value Restrictions | Description | | ----| ---- | -------- | ------- | ------------------ | ----------- | | type | String | True | | Valid Values:
- `"list"` | Type of variable using the Python short names for each type.
`list` for List | -| convert_types | List, items: String | | | | List of types to auto-convert from.
For `list` auto-conversion is supported from `dict` if `primary_key` is set on the list schema | | default | List | | | | Default value | | items | Dict | | | | Dictionary describing the schema of each list item. This is a recursive schema, so the value must conform to AVD Schema | | max_length | Integer | | | | Maximum length | | min_length | Integer | | | | Minimum length | | primary_key | String | | | Pattern: `^[a-z][a-z0-9_]*$` | Name of a primary key in a list of dictionaries.
The configured key is implicitly required and must have unique values between the list elements | -| secondary_key | String | | | Pattern: `^[a-z][a-z0-9_]*$` | Name of a secondary key, which is used with `convert_types:['dict']` in case of values not being dictionaries | | unique_keys | List, items: String | | | Item Pattern: `^[a-z][a-z0-9_]*$` | Name of a key in a list of dictionaries.
The configured key must have unique values between the list elements.
This can also be a variable path using dot-notation like `parent_key.child_key` in case of nested lists of dictionaries. | | display_name | String | | | Regex Pattern: `"^[^\n]+$"` | Free text display name for forms and documentation (single line) | | description | String | | | Minimum Length: 1 | Free text description for forms and documentation (multi line) | diff --git a/ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/eos_cli_config_gen.md b/ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/eos_cli_config_gen.md index 662f93f182c..f2364f7fa34 100644 --- a/ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/eos_cli_config_gen.md +++ b/ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/eos_cli_config_gen.md @@ -34,8 +34,7 @@ The `arista.avd.eos_cli_config_gen` module is an Ansible Action Plugin providing | generate_device_config | bool | optional | True | | Flag to generate the device configuration. | | generate_device_doc | bool | optional | True | | Flag to generate the device documentation. | | device_doc_toc | bool | optional | True | | Flag to generate the table of content for the device documentation. | -| conversion_mode | str | False | debug | Valid values:
- error
- warning
- info
- debug
- quiet
- disabled | Run data conversion in either "error", "warning", "info", "debug", "quiet" or "disabled" mode.
Conversion will perform type conversion of input variables as defined in the schema.
Conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated.
During conversion, messages will be generated with information about the host(s) and key(s) which required conversion.
conversion_mode:disabled means that conversion will not run.
conversion_mode:error will produce error messages and fail the task.
conversion_mode:warning will produce warning messages.
conversion_mode:info will produce regular log messages.
conversion_mode:debug will produce hidden messages viewable with -v.
conversion_mode:quiet will not produce any messages. | -| validation_mode | str | False | warning | Valid values:
- error
- warning
- info
- debug
- disabled | Run validation in either "error", "warning", "info", "debug" or "disabled" mode.
Validation will validate the input variables according to the schema.
During validation, messages will be generated with information about the host(s) and key(s) which failed validation.
validation_mode:disabled means that validation will not run.
validation_mode:error will produce error messages and fail the task.
validation_mode:warning will produce warning messages.
validation_mode:info will produce regular log messages.
validation_mode:debug will produce hidden messages viewable with -v. | +| validation_mode | str | False | error | Valid values:
- error
- warning | Run validation in either "error" or "warning" mode.
Validation will validate the input variables according to the schema.
During validation, messages will be generated with information about the host(s) and key(s) which failed validation.
validation_mode:error will produce error messages and fail the task.
validation_mode:warning will produce warning messages. | | cprofile_file | str | False | None | | Filename for storing cprofile data used to debug performance issues.
Running cprofile will slow down performance in it self, so only set this while troubleshooting. | ## Examples diff --git a/ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/eos_designs_facts.md b/ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/eos_designs_facts.md index 0600fcdb928..dcacf34e9e8 100644 --- a/ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/eos_designs_facts.md +++ b/ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/eos_designs_facts.md @@ -36,8 +36,7 @@ The module is used in `arista.avd.eos_designs` to set facts for devices, which a | Argument | Type | Required | Default | Value Restrictions | Description | | -------- | ---- | -------- | ------- | ------------------ | ----------- | | template_output | bool | False | None | | If true, the output data will be run through another jinja2 rendering before returning. This is to resolve any input values with inline jinja using variables/facts set by the input templates. | -| conversion_mode | str | False | debug | Valid values:
- error
- warning
- info
- debug
- quiet
- disabled | Run data conversion in either "error", "warning", "info", "debug", "quiet" or "disabled" mode.
Conversion will perform type conversion of input variables as defined in the schema.
Conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated.
During conversion, messages will be generated with information about the host(s) and key(s) which required conversion.
conversion_mode:disabled means that conversion will not run.
conversion_mode:error will produce error messages and fail the task.
conversion_mode:warning will produce warning messages.
conversion_mode:info will produce regular log messages.
conversion_mode:debug will produce hidden messages viewable with -v.
conversion_mode:quiet will not produce any messages. | -| validation_mode | str | False | warning | Valid values:
- error
- warning
- info
- debug
- disabled | Run validation in either "error", "warning", "info", "debug" or "disabled" mode.
Validation will validate the input variables according to the schema.
During validation, messages will be generated with information about the host(s) and key(s) which failed validation.
validation_mode:disabled means that validation will not run.
validation_mode:error will produce error messages and fail the task.
validation_mode:warning will produce warning messages.
validation_mode:info will produce regular log messages.
validation_mode:debug will produce hidden messages viewable with -v. | +| validation_mode | str | False | error | Valid values:
- error
- warning | Run validation in either "error" or "warning" mode.
Validation will validate the input variables according to the schema.
During validation, messages will be generated with information about the host(s) and key(s) which failed validation.
validation_mode:error will produce error messages and fail the task.
validation_mode:warning will produce warning messages. | | cprofile_file | str | False | None | | Filename for storing cprofile data used to debug performance issues.
Running cprofile will slow down performance in it self, so only set this while troubleshooting. | ## Examples diff --git a/ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/eos_designs_structured_config.md b/ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/eos_designs_structured_config.md index 737ee58a9a5..4516c0897d7 100644 --- a/ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/eos_designs_structured_config.md +++ b/ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/eos_designs_structured_config.md @@ -38,8 +38,7 @@ The `arista.avd.eos_designs_structured_config` module is an Ansible Action Plugi | dest | str | False | None | | Destination path. If set, the output facts will also be written to this path.
Autodetects data format based on file suffix. '.yml', '.yaml' -> YAML, default -> JSON | | mode | str | False | None | | File mode (ex. "0o664") for dest file. See 'ansible.builtin.copy' module for details. | | template_output | bool | False | None | | If true, the output data will be run through another jinja2 rendering before returning.
This is to resolve any input values with inline jinja using variables/facts set by the input templates. | -| conversion_mode | str | False | debug | Valid values:
- error
- warning
- info
- debug
- quiet
- disabled | Run data conversion in either "error", "warning", "info", "debug", "quiet" or "disabled" mode.
Conversion will perform type conversion of input variables as defined in the schema.
Conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated.
During conversion, messages will be generated with information about the host(s) and key(s) which required conversion.
conversion_mode:disabled means that conversion will not run.
conversion_mode:error will produce error messages and fail the task.
conversion_mode:warning will produce warning messages.
conversion_mode:info will produce regular log messages.
conversion_mode:debug will produce hidden messages viewable with -v.
conversion_mode:quiet will not produce any messages. | -| validation_mode | str | False | warning | Valid values:
- error
- warning
- info
- debug
- disabled | Run validation in either "error", "warning", "info", "debug" or "disabled" mode.
Validation will validate the input variables according to the schema.
During validation, messages will be generated with information about the host(s) and key(s) which failed validation.
validation_mode:disabled means that validation will not run.
validation_mode:error will produce error messages and fail the task.
validation_mode:warning will produce warning messages.
validation_mode:info will produce regular log messages.
validation_mode:debug will produce hidden messages viewable with -v. | +| validation_mode | str | False | error | Valid values:
- error
- warning | Run validation in either "error" or "warning" mode.
Validation will validate the input variables according to the schema.
During validation, messages will be generated with information about the host(s) and key(s) which failed validation.
validation_mode:error will produce error messages and fail the task.
validation_mode:warning will produce warning messages. | | cprofile_file | str | False | None | | Filename for storing cprofile data used to debug performance issues.
Running cprofile will slow down performance in it self, so only set this while troubleshooting. | ## Examples diff --git a/ansible_collections/arista/avd/docs/porting-guides/5.x.x.md b/ansible_collections/arista/avd/docs/porting-guides/5.x.x.md index 41f791d14ad..057426c3ccc 100644 --- a/ansible_collections/arista/avd/docs/porting-guides/5.x.x.md +++ b/ansible_collections/arista/avd/docs/porting-guides/5.x.x.md @@ -28,6 +28,7 @@ In AVD 4.0.0 and across both `eos_designs` and `eos_cli_config_gen`, *all* "dict In AVD 4.x inputs were auto-converted to the new data models. As of AVD 5.0.0 the automatic conversion from dict-of-dicts has been removed, so it is required to update the input data to the new data models. +The `avd_data_conversion_mode` key has also been removed. Errors will be raised for each data model not conforming to the list type when running AVD: diff --git a/ansible_collections/arista/avd/docs/release-notes/5.x.x.md b/ansible_collections/arista/avd/docs/release-notes/5.x.x.md index df5daabac30..ce2d1ca6c50 100644 --- a/ansible_collections/arista/avd/docs/release-notes/5.x.x.md +++ b/ansible_collections/arista/avd/docs/release-notes/5.x.x.md @@ -46,6 +46,7 @@ In AVD 4.0.0 and across both `eos_designs` and `eos_cli_config_gen`, *all* "dict In AVD 4.x inputs were auto-converted to the new data models. As of AVD 5.0.0 the automatic conversion from dict-of-dicts has been removed, so it is required to update the input data to the new data models. +The `avd_data_conversion_mode` key has also been removed. See the [porting guide](../porting-guides/5.x.x.md#data-model-changes-from-dict-of-dicts-to-list-of-dicts) for details. @@ -54,6 +55,12 @@ See the [porting guide](../porting-guides/5.x.x.md#data-model-changes-from-dict- In AVD 5.0.0, all `eos_designs` and `eos_cli_config_gen` keys are validated by schemas and execution will stop for any violations. If additional custom keys are desired, a key starting with an underscore `_`, will be ignored. +!!! danger + The input variable `avd_data_validation_mode` now has a default value of `error`, and while it can be set to `warning`, this is highly discouraged. + All AVD code relies on the validation to ensure valid data, so the code assumes that the data is valid. + + If the validation mode is set to `warning`, execution will continue with invalid data, which can lead to hard-to-read errors or incorrect behavior. + ### Breaking or behavioral changes in eos_cli_config_gen Breaking changes may require modifications to the inventory or playbook. See the [Porting guide for AVD 5.x.x](../porting-guides/5.x.x.md) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/group_vars/all.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/group_vars/all.yml index 1513ffe357f..489c44b4fec 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/group_vars/all.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/group_vars/all.yml @@ -8,6 +8,3 @@ management_interfaces: vrf: MGMT ip_address: 10.73.255.122/24 gateway: 10.73.255.2 - -avd_data_validation_mode: "error" -avd_data_conversion_mode: "error" diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/inventory/group_vars/all.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/inventory/group_vars/all.yml index 259093e253f..ca321a2ab29 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/inventory/group_vars/all.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/inventory/group_vars/all.yml @@ -1,6 +1,3 @@ --- root_dir: '{{ playbook_dir }}' is_for_test: true - -avd_data_validation_mode: "error" -avd_data_conversion_mode: "info" diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen_negative_unit_tests/inventory/group_vars/all.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen_negative_unit_tests/inventory/group_vars/all.yml index 445d1a61e50..e82058bc1ba 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen_negative_unit_tests/inventory/group_vars/all.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen_negative_unit_tests/inventory/group_vars/all.yml @@ -1,5 +1,5 @@ --- root_dir: '{{ playbook_dir }}' -# Only warning for validation (default) to trigger the errors +# Only warning for validation to trigger the errors avd_data_validation_mode: "warning" diff --git a/ansible_collections/arista/avd/molecule/eos_config_deploy_cvp/molecule.yml b/ansible_collections/arista/avd/molecule/eos_config_deploy_cvp/molecule.yml index b56df7c4bd7..02a39f1bf08 100644 --- a/ansible_collections/arista/avd/molecule/eos_config_deploy_cvp/molecule.yml +++ b/ansible_collections/arista/avd/molecule/eos_config_deploy_cvp/molecule.yml @@ -35,6 +35,5 @@ provisioner: - --tags=generate,build - --skip-tags=online - --extra-vars - - "avd_data_conversion_mode=error" verifier: name: ansible diff --git a/ansible_collections/arista/avd/molecule/eos_designs-l2ls/inventory/group_vars/all.yml b/ansible_collections/arista/avd/molecule/eos_designs-l2ls/inventory/group_vars/all.yml index 10fe5a5552a..e7e19d60245 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-l2ls/inventory/group_vars/all.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-l2ls/inventory/group_vars/all.yml @@ -1,5 +1,2 @@ --- root_dir: '{{ playbook_dir }}' - -avd_data_validation_mode: "error" -avd_data_conversion_mode: "error" diff --git a/ansible_collections/arista/avd/molecule/eos_designs-mpls-isis-sr-ldp/inventory/group_vars/all.yml b/ansible_collections/arista/avd/molecule/eos_designs-mpls-isis-sr-ldp/inventory/group_vars/all.yml index 1bca4ff7a2f..ed97d539c09 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-mpls-isis-sr-ldp/inventory/group_vars/all.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-mpls-isis-sr-ldp/inventory/group_vars/all.yml @@ -1,4 +1 @@ --- - -avd_data_validation_mode: "error" -avd_data_conversion_mode: "error" diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/inventory/group_vars/all.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/inventory/group_vars/all.yml index 10fe5a5552a..e7e19d60245 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/inventory/group_vars/all.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/inventory/group_vars/all.yml @@ -1,5 +1,2 @@ --- root_dir: '{{ playbook_dir }}' - -avd_data_validation_mode: "error" -avd_data_conversion_mode: "error" diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/group_vars/all.yml b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/group_vars/all.yml index d95304e473f..c04bc5daac3 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/group_vars/all.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/group_vars/all.yml @@ -2,7 +2,4 @@ root_dir: '{{ playbook_dir }}' is_for_test: true -avd_data_validation_mode: "error" -avd_data_conversion_mode: "info" - fabric_name: EOS_DESIGNS_DEPRECATED_VARS diff --git a/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/group_vars/all.yml b/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/group_vars/all.yml index 10fe5a5552a..e7e19d60245 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/group_vars/all.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/group_vars/all.yml @@ -1,5 +1,2 @@ --- root_dir: '{{ playbook_dir }}' - -avd_data_validation_mode: "error" -avd_data_conversion_mode: "error" diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/all.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/all.yml index 10fe5a5552a..e7e19d60245 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/all.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/all.yml @@ -1,5 +1,2 @@ --- root_dir: '{{ playbook_dir }}' - -avd_data_validation_mode: "error" -avd_data_conversion_mode: "error" diff --git a/ansible_collections/arista/avd/molecule/eos_validate_state/converge.yml b/ansible_collections/arista/avd/molecule/eos_validate_state/converge.yml index fd499b6162d..23a8d1bad2d 100644 --- a/ansible_collections/arista/avd/molecule/eos_validate_state/converge.yml +++ b/ansible_collections/arista/avd/molecule/eos_validate_state/converge.yml @@ -8,9 +8,6 @@ - name: Generate AVD Structured Configurations and Fabric Documentation ansible.builtin.import_role: name: arista.avd.eos_designs - vars: - avd_data_validation_mode: error - avd_data_conversion_mode: error - name: Test eos_validate_state delegate_to: localhost ansible.builtin.import_role: diff --git a/ansible_collections/arista/avd/molecule/evpn_underlay_ebgp_overlay_ebgp/inventory/group_vars/all.yml b/ansible_collections/arista/avd/molecule/evpn_underlay_ebgp_overlay_ebgp/inventory/group_vars/all.yml index 1bca4ff7a2f..ed97d539c09 100644 --- a/ansible_collections/arista/avd/molecule/evpn_underlay_ebgp_overlay_ebgp/inventory/group_vars/all.yml +++ b/ansible_collections/arista/avd/molecule/evpn_underlay_ebgp_overlay_ebgp/inventory/group_vars/all.yml @@ -1,4 +1 @@ --- - -avd_data_validation_mode: "error" -avd_data_conversion_mode: "error" diff --git a/ansible_collections/arista/avd/molecule/evpn_underlay_isis_overlay_ibgp/inventory/group_vars/all.yml b/ansible_collections/arista/avd/molecule/evpn_underlay_isis_overlay_ibgp/inventory/group_vars/all.yml index 1bca4ff7a2f..ed97d539c09 100644 --- a/ansible_collections/arista/avd/molecule/evpn_underlay_isis_overlay_ibgp/inventory/group_vars/all.yml +++ b/ansible_collections/arista/avd/molecule/evpn_underlay_isis_overlay_ibgp/inventory/group_vars/all.yml @@ -1,4 +1 @@ --- - -avd_data_validation_mode: "error" -avd_data_conversion_mode: "error" diff --git a/ansible_collections/arista/avd/molecule/evpn_underlay_ospf_overlay_ebgp/inventory/group_vars/all.yml b/ansible_collections/arista/avd/molecule/evpn_underlay_ospf_overlay_ebgp/inventory/group_vars/all.yml index 1bca4ff7a2f..ed97d539c09 100644 --- a/ansible_collections/arista/avd/molecule/evpn_underlay_ospf_overlay_ebgp/inventory/group_vars/all.yml +++ b/ansible_collections/arista/avd/molecule/evpn_underlay_ospf_overlay_ebgp/inventory/group_vars/all.yml @@ -1,4 +1 @@ --- - -avd_data_validation_mode: "error" -avd_data_conversion_mode: "error" diff --git a/ansible_collections/arista/avd/molecule/evpn_underlay_rfc5549_overlay_ebgp/inventory/group_vars/all.yml b/ansible_collections/arista/avd/molecule/evpn_underlay_rfc5549_overlay_ebgp/inventory/group_vars/all.yml index 1bca4ff7a2f..ed97d539c09 100644 --- a/ansible_collections/arista/avd/molecule/evpn_underlay_rfc5549_overlay_ebgp/inventory/group_vars/all.yml +++ b/ansible_collections/arista/avd/molecule/evpn_underlay_rfc5549_overlay_ebgp/inventory/group_vars/all.yml @@ -1,4 +1 @@ --- - -avd_data_validation_mode: "error" -avd_data_conversion_mode: "error" diff --git a/ansible_collections/arista/avd/molecule/example-campus-fabric/molecule.yml b/ansible_collections/arista/avd/molecule/example-campus-fabric/molecule.yml index 8765801045a..296d5187f14 100644 --- a/ansible_collections/arista/avd/molecule/example-campus-fabric/molecule.yml +++ b/ansible_collections/arista/avd/molecule/example-campus-fabric/molecule.yml @@ -27,9 +27,5 @@ provisioner: ansible_args: - --inventory - ${MOLECULE_SCENARIO_DIRECTORY}/../../examples/campus-fabric/inventory.yml - - --extra-vars - - "avd_data_validation_mode=error" - - --extra-vars - - "avd_data_conversion_mode=error" verifier: name: ansible diff --git a/ansible_collections/arista/avd/molecule/example-dual-dc-l3ls/molecule.yml b/ansible_collections/arista/avd/molecule/example-dual-dc-l3ls/molecule.yml index e60291bcba0..69da6a18a2f 100644 --- a/ansible_collections/arista/avd/molecule/example-dual-dc-l3ls/molecule.yml +++ b/ansible_collections/arista/avd/molecule/example-dual-dc-l3ls/molecule.yml @@ -27,9 +27,5 @@ provisioner: ansible_args: - --inventory - ${MOLECULE_SCENARIO_DIRECTORY}/../../examples/dual-dc-l3ls/inventory.yml - - --extra-vars - - "avd_data_validation_mode=error" - - --extra-vars - - "avd_data_conversion_mode=error" verifier: name: ansible diff --git a/ansible_collections/arista/avd/molecule/example-isis-ldp-ipvpn/molecule.yml b/ansible_collections/arista/avd/molecule/example-isis-ldp-ipvpn/molecule.yml index 67c8b3b50f6..1547508ec5b 100644 --- a/ansible_collections/arista/avd/molecule/example-isis-ldp-ipvpn/molecule.yml +++ b/ansible_collections/arista/avd/molecule/example-isis-ldp-ipvpn/molecule.yml @@ -27,8 +27,6 @@ provisioner: ansible_args: - --inventory - ${MOLECULE_SCENARIO_DIRECTORY}/../../examples/isis-ldp-ipvpn/inventory.yml - - --extra-vars - - "avd_data_validation_mode=error" # Running with tags build to avoid deploy_eapi to run. - --tags - build diff --git a/ansible_collections/arista/avd/molecule/example-l2ls-fabric/molecule.yml b/ansible_collections/arista/avd/molecule/example-l2ls-fabric/molecule.yml index 895646a3a75..f1a2af771df 100644 --- a/ansible_collections/arista/avd/molecule/example-l2ls-fabric/molecule.yml +++ b/ansible_collections/arista/avd/molecule/example-l2ls-fabric/molecule.yml @@ -27,9 +27,5 @@ provisioner: ansible_args: - --inventory - ${MOLECULE_SCENARIO_DIRECTORY}/../../examples/l2ls-fabric/inventory.yml - - --extra-vars - - "avd_data_validation_mode=error" - - --extra-vars - - "avd_data_conversion_mode=error" verifier: name: ansible diff --git a/ansible_collections/arista/avd/molecule/example-single-dc-l3ls/molecule.yml b/ansible_collections/arista/avd/molecule/example-single-dc-l3ls/molecule.yml index cdb3d879c18..7388aff49a0 100644 --- a/ansible_collections/arista/avd/molecule/example-single-dc-l3ls/molecule.yml +++ b/ansible_collections/arista/avd/molecule/example-single-dc-l3ls/molecule.yml @@ -27,10 +27,6 @@ provisioner: ansible_args: - --inventory - ${MOLECULE_SCENARIO_DIRECTORY}/../../examples/single-dc-l3ls/inventory.yml - - --extra-vars - - "avd_data_validation_mode=error" - - --extra-vars - - "avd_data_conversion_mode=error" # Running with tags build to avoid deploy_eapi to run. - --tags - build diff --git a/ansible_collections/arista/avd/plugins/action/eos_cli_config_gen.py b/ansible_collections/arista/avd/plugins/action/eos_cli_config_gen.py index 71ec66bab4b..6b8824b10b4 100644 --- a/ansible_collections/arista/avd/plugins/action/eos_cli_config_gen.py +++ b/ansible_collections/arista/avd/plugins/action/eos_cli_config_gen.py @@ -37,8 +37,7 @@ "config_filename": {"type": "str"}, "documentation_filename": {"type": "str"}, "read_structured_config_from_file": {"type": "bool", "default": True}, - "conversion_mode": {"type": "str", "default": "debug"}, - "validation_mode": {"type": "str", "default": "warning"}, + "validation_mode": {"type": "str", "default": "error"}, "generate_device_config": {"type": "bool", "default": True}, "generate_device_doc": {"type": "bool", "default": True}, "device_doc_toc": {"type": "bool", "default": True}, @@ -88,7 +87,6 @@ def main(self, task_vars: dict, result: dict) -> dict: # result dict will be in-place updated. self.validate_task_vars( hostname=task_vars["inventory_hostname"], - conversion_mode=validated_args["conversion_mode"], validation_mode=validated_args["validation_mode"], task_vars=task_vars, result=result, @@ -99,7 +97,7 @@ def main(self, task_vars: dict, result: dict) -> dict: return result if result.get("failed"): - # Something failed in schema validation or conversion. + # Something failed in schema validation. return result has_custom_templates = bool(task_vars.get("custom_templates")) @@ -199,13 +197,12 @@ def prepare_task_vars(self, task_vars: dict, structured_config_filename: str, *, return task_vars - def validate_task_vars(self, hostname: str, conversion_mode: str, validation_mode: str, task_vars: dict, result: dict) -> None: + def validate_task_vars(self, hostname: str, validation_mode: str, task_vars: dict, result: dict) -> None: # Load schema tools for input schema input_schema_tools = AvdSchemaTools( hostname=hostname, ansible_display=display, schema_id="eos_cli_config_gen", - conversion_mode=conversion_mode, validation_mode=validation_mode, plugin_name="arista.avd.eos_cli_config_gen", ) diff --git a/ansible_collections/arista/avd/plugins/action/eos_designs_facts.py b/ansible_collections/arista/avd/plugins/action/eos_designs_facts.py index 9cf842713d9..1f0780f312d 100644 --- a/ansible_collections/arista/avd/plugins/action/eos_designs_facts.py +++ b/ansible_collections/arista/avd/plugins/action/eos_designs_facts.py @@ -43,7 +43,6 @@ def run(self, tmp: Any = None, task_vars: dict | None = None) -> None: profiler.enable() self.template_output = self._task.args.get("template_output", False) - self._conversion_mode = self._task.args.get("conversion_mode") self._validation_mode = self._task.args.get("validation_mode") groups = task_vars.get("groups", {}) @@ -135,13 +134,11 @@ def create_avd_switch_facts_instances(self, fabric_hosts: list, hostvars: object hostname="", ansible_display=display, schema_id="eos_designs", - conversion_mode=self._conversion_mode, validation_mode=self._validation_mode, plugin_name="arista.avd.eos_designs", ) avd_switch_facts = {} - data_conversions = 0 data_validation_errors = 0 for host in fabric_hosts: # Fetch all templated Ansible vars for this host @@ -160,11 +157,10 @@ def create_avd_switch_facts_instances(self, fabric_hosts: list, hostvars: object avdschematools.hostname = host host_result = avdschematools.convert_and_validate_data(host_hostvars, return_counters=True) - data_conversions += host_result["conversions"] data_validation_errors += host_result["validation_errors"] if host_result.get("failed"): - # Quickly continue if data conversion/validation failed + # Quickly continue if data validation failed result["failed"] = True continue @@ -180,7 +176,7 @@ def create_avd_switch_facts_instances(self, fabric_hosts: list, hostvars: object host_hostvars["switch"] = avd_switch_facts[host]["switch"] # Build result message - result["msg"] = avdschematools.build_result_message(conversions=data_conversions, validation_errors=data_validation_errors) + result["msg"] = avdschematools.build_result_message(validation_errors=data_validation_errors) return avd_switch_facts diff --git a/ansible_collections/arista/avd/plugins/action/eos_designs_structured_config.py b/ansible_collections/arista/avd/plugins/action/eos_designs_structured_config.py index a9caf16ee61..ccd79bd85c0 100644 --- a/ansible_collections/arista/avd/plugins/action/eos_designs_structured_config.py +++ b/ansible_collections/arista/avd/plugins/action/eos_designs_structured_config.py @@ -47,7 +47,6 @@ def run(self, tmp: Any = None, task_vars: dict | None = None) -> dict: eos_designs_custom_templates = self._task.args.get("eos_designs_custom_templates", []) self.dest = self._task.args.get("dest", False) template_output = self._task.args.get("template_output", False) - conversion_mode = self._task.args.get("conversion_mode") validation_mode = self._task.args.get("validation_mode") hostname = task_vars["inventory_hostname"] @@ -74,7 +73,6 @@ def run(self, tmp: Any = None, task_vars: dict | None = None) -> dict: hostname=hostname, ansible_display=display, schema_id="eos_designs", - conversion_mode=conversion_mode, validation_mode=validation_mode, plugin_name="arista.avd.eos_designs", ) @@ -84,7 +82,6 @@ def run(self, tmp: Any = None, task_vars: dict | None = None) -> dict: hostname=hostname, ansible_display=display, schema_id="eos_cli_config_gen", - conversion_mode=conversion_mode, validation_mode=validation_mode, plugin_name="arista.avd.eos_cli_config_gen", ) @@ -102,7 +99,7 @@ def run(self, tmp: Any = None, task_vars: dict | None = None) -> dict: raise AnsibleActionFail(message=str(error)) from error if result.get("failed"): - # Something failed in schema validation or conversion. + # Something failed in schema validation. return result # We use ChainMap to avoid copying large amounts of data around, mapping in diff --git a/ansible_collections/arista/avd/plugins/modules/eos_cli_config_gen.py b/ansible_collections/arista/avd/plugins/modules/eos_cli_config_gen.py index 22d88207980..72a96d5e8fb 100644 --- a/ansible_collections/arista/avd/plugins/modules/eos_cli_config_gen.py +++ b/ansible_collections/arista/avd/plugins/modules/eos_cli_config_gen.py @@ -40,36 +40,17 @@ description: Flag to generate the table of content for the device documentation. type: bool default: true - conversion_mode: - description: - - Run data conversion in either "error", "warning", "info", "debug", "quiet" or "disabled" mode. - - Conversion will perform type conversion of input variables as defined in the schema. - - Conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated. - - During conversion, messages will be generated with information about the host(s) and key(s) which required conversion. - - conversion_mode:disabled means that conversion will not run. - - conversion_mode:error will produce error messages and fail the task. - - conversion_mode:warning will produce warning messages. - - conversion_mode:info will produce regular log messages. - - conversion_mode:debug will produce hidden messages viewable with -v. - - conversion_mode:quiet will not produce any messages. - required: false - default: "debug" - type: str - choices: [ "error", "warning", "info", "debug", "quiet", "disabled" ] validation_mode: description: - - Run validation in either "error", "warning", "info", "debug" or "disabled" mode. + - Run validation in either "error" or "warning" mode. - Validation will validate the input variables according to the schema. - During validation, messages will be generated with information about the host(s) and key(s) which failed validation. - - validation_mode:disabled means that validation will not run. - validation_mode:error will produce error messages and fail the task. - validation_mode:warning will produce warning messages. - - validation_mode:info will produce regular log messages. - - validation_mode:debug will produce hidden messages viewable with -v. required: false - default: "warning" + default: "error" type: str - choices: [ "error", "warning", "info", "debug", "disabled" ] + choices: [ "error", "warning" ] cprofile_file: description: - Filename for storing cprofile data used to debug performance issues. diff --git a/ansible_collections/arista/avd/plugins/modules/eos_designs_facts.py b/ansible_collections/arista/avd/plugins/modules/eos_designs_facts.py index 4228d72b822..36b3391d2b2 100644 --- a/ansible_collections/arista/avd/plugins/modules/eos_designs_facts.py +++ b/ansible_collections/arista/avd/plugins/modules/eos_designs_facts.py @@ -30,36 +30,17 @@ This is to resolve any input values with inline jinja using variables/facts set by the input templates. required: false type: bool - conversion_mode: - description: - - Run data conversion in either "error", "warning", "info", "debug", "quiet" or "disabled" mode. - - Conversion will perform type conversion of input variables as defined in the schema. - - Conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated. - - During conversion, messages will be generated with information about the host(s) and key(s) which required conversion. - - conversion_mode:disabled means that conversion will not run. - - conversion_mode:error will produce error messages and fail the task. - - conversion_mode:warning will produce warning messages. - - conversion_mode:info will produce regular log messages. - - conversion_mode:debug will produce hidden messages viewable with -v. - - conversion_mode:quiet will not produce any messages. - required: false - default: "debug" - type: str - choices: [ "error", "warning", "info", "debug", "quiet", "disabled" ] validation_mode: description: - - Run validation in either "error", "warning", "info", "debug" or "disabled" mode. + - Run validation in either "error" or "warning" mode. - Validation will validate the input variables according to the schema. - During validation, messages will be generated with information about the host(s) and key(s) which failed validation. - - validation_mode:disabled means that validation will not run. - validation_mode:error will produce error messages and fail the task. - validation_mode:warning will produce warning messages. - - validation_mode:info will produce regular log messages. - - validation_mode:debug will produce hidden messages viewable with -v. required: false - default: "warning" + default: "error" type: str - choices: [ "error", "warning", "info", "debug", "disabled" ] + choices: [ "error", "warning" ] cprofile_file: description: - Filename for storing cprofile data used to debug performance issues. diff --git a/ansible_collections/arista/avd/plugins/modules/eos_designs_structured_config.py b/ansible_collections/arista/avd/plugins/modules/eos_designs_structured_config.py index f2784b3ae94..5d87feaa372 100644 --- a/ansible_collections/arista/avd/plugins/modules/eos_designs_structured_config.py +++ b/ansible_collections/arista/avd/plugins/modules/eos_designs_structured_config.py @@ -62,36 +62,17 @@ - This is to resolve any input values with inline jinja using variables/facts set by the input templates. required: false type: bool - conversion_mode: - description: - - Run data conversion in either "error", "warning", "info", "debug", "quiet" or "disabled" mode. - - Conversion will perform type conversion of input variables as defined in the schema. - - Conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated. - - During conversion, messages will be generated with information about the host(s) and key(s) which required conversion. - - conversion_mode:disabled means that conversion will not run. - - conversion_mode:error will produce error messages and fail the task. - - conversion_mode:warning will produce warning messages. - - conversion_mode:info will produce regular log messages. - - conversion_mode:debug will produce hidden messages viewable with -v. - - conversion_mode:quiet will not produce any messages. - required: false - default: "debug" - type: str - choices: [ "error", "warning", "info", "debug", "quiet", "disabled" ] validation_mode: description: - - Run validation in either "error", "warning", "info", "debug" or "disabled" mode. + - Run validation in either "error" or "warning" mode. - Validation will validate the input variables according to the schema. - During validation, messages will be generated with information about the host(s) and key(s) which failed validation. - - validation_mode:disabled means that validation will not run. - validation_mode:error will produce error messages and fail the task. - validation_mode:warning will produce warning messages. - - validation_mode:info will produce regular log messages. - - validation_mode:debug will produce hidden messages viewable with -v. required: false - default: "warning" + default: "error" type: str - choices: [ "error", "warning", "info", "debug", "disabled" ] + choices: [ "error", "warning" ] cprofile_file: description: - Filename for storing cprofile data used to debug performance issues. diff --git a/ansible_collections/arista/avd/plugins/plugin_utils/schema/avdschematools.py b/ansible_collections/arista/avd/plugins/plugin_utils/schema/avdschematools.py index 7ba13a8894e..eb2b98b69c7 100644 --- a/ansible_collections/arista/avd/plugins/plugin_utils/schema/avdschematools.py +++ b/ansible_collections/arista/avd/plugins/plugin_utils/schema/avdschematools.py @@ -22,10 +22,8 @@ AristaAvdError = AvdDeprecationWarning = ImportError -VALID_CONVERSION_MODES = ["disabled", "error", "warning", "info", "debug", "quiet"] -DEFAULT_CONVERSION_MODE = "debug" -VALID_VALIDATION_MODES = ["disabled", "error", "warning", "info", "debug"] -DEFAULT_VALIDATION_MODE = "warning" +VALID_VALIDATION_MODES = ["error", "warning"] +DEFAULT_VALIDATION_MODE = "error" class AvdSchemaTools: @@ -37,7 +35,6 @@ def __init__( ansible_display: Display, schema: dict | None = None, schema_id: str | None = None, - conversion_mode: str | None = None, validation_mode: str | None = None, plugin_name: str | None = None, ) -> None: @@ -45,7 +42,6 @@ def __init__( self.hostname = hostname self.ansible_display = ansible_display self.plugin_name = plugin_name - self._set_conversion_mode(conversion_mode) self._set_validation_mode(validation_mode) def _set_schema(self, schema: dict | None, schema_id: str | None) -> None: @@ -59,20 +55,6 @@ def _set_schema(self, schema: dict | None, schema_id: str | None) -> None: msg = "Invalid Schema!" raise AnsibleActionFail(msg) from e - def _set_conversion_mode(self, conversion_mode: str | None) -> None: - if conversion_mode is None: - conversion_mode = DEFAULT_CONVERSION_MODE - - if not isinstance(conversion_mode, str): - msg = "The argument 'conversion_mode' must be a string" - raise AnsibleActionFail(msg) - - if conversion_mode not in VALID_CONVERSION_MODES: - msg = f"Invalid value '{conversion_mode}' for the argument 'conversion_mode'. Must be one of {VALID_CONVERSION_MODES}" - raise AnsibleActionFail(msg) - - self.conversion_mode = conversion_mode - def _set_validation_mode(self, validation_mode: str | None) -> None: if validation_mode is None: validation_mode = DEFAULT_VALIDATION_MODE @@ -87,33 +69,21 @@ def _set_validation_mode(self, validation_mode: str | None) -> None: self.validation_mode = validation_mode - def convert_data(self, data: dict) -> int: + def convert_data(self, data: dict) -> None: """ Convert data according to the schema (convert_types). The data conversion is done in-place (updating the original "data" dict). + The conversion code will also emit deprecation warnings. + Returns: ------- - int : number of conversions done + None """ - if self.conversion_mode == "disabled": - return 0 - - # avd_schema.convert returns a generator, which we iterate through with list() to perform the actual conversions. - # TODO: AVD 5.0.0 Remove the conversion to list and deprecation warning - exceptions = list(self.avdschema.convert(data)) - if exceptions: - exceptions.insert( - 0, - AvdDeprecationWarning( - key=["dict-of-dicts to list-of-dicts automatic conversion"], - remove_in_version="5.0.0", - url="'https://avd.arista.com/stable/docs/porting-guides/4.x.x.html#data-model-changes-from-dict-of-dicts-to-list-of-dicts'", - ), - ) - # Forcing exceptions to be a generator - return self.handle_validation_exceptions((exception for exception in exceptions), self.conversion_mode) + # avd_schema.convert returns a generator, which we iterate through in handle_exceptions to perform the actual conversions. + exceptions = self.avdschema.convert(data) + self.handle_validation_exceptions(exceptions, None) def validate_data(self, data: dict) -> int: """ @@ -123,10 +93,7 @@ def validate_data(self, data: dict) -> int: ------- int : number of validation errors """ - if self.validation_mode == "disabled": - return 0 - - # avd_schema.validate returns a generator, which we iterate through in handle_exceptions to perform the actual conversions. + # avd_schema.validate returns a generator, which we iterate through in handle_exceptions to perform the actual validations. exceptions = self.avdschema.validate(data) return self.handle_validation_exceptions(exceptions, self.validation_mode) @@ -138,32 +105,28 @@ def convert_and_validate_data(self, data: dict, return_counters: bool = False) - Returns dict which can contain either or both of the following keys: - failed: - - msg: - - conversions: + - msg: - validation_errors: The return value should be applied on Ansible Action "result" dictionary """ result = {} # Perform data conversions - conversions = self.convert_data(data) - if conversions and self.conversion_mode == "error": - result["failed"] = True + self.convert_data(data) # Perform validation validation_errors = self.validate_data(data) if validation_errors and self.validation_mode == "error": result["failed"] = True - result["msg"] = self.build_result_message(conversions=conversions, validation_errors=validation_errors) + result["msg"] = self.build_result_message(validation_errors=validation_errors) if return_counters: - result["conversions"] = conversions result["validation_errors"] = validation_errors return result - def handle_validation_exceptions(self, exceptions: Generator, mode: str) -> int: + def handle_validation_exceptions(self, exceptions: Generator, mode: str | None) -> int: """ Iterate through the Generator of exceptions. @@ -180,8 +143,7 @@ def handle_validation_exceptions(self, exceptions: Generator, mode: str) -> int: continue if isinstance(exception, AvdDeprecationWarning): - # Deprecation warnings are not subject to "conversion_mode". - # Instead we display using Ansible's deprecation notices. + # Deprecation warnings are displayed using Ansible's deprecation notices. message = f"[{self.hostname}]: {exception}" if exception.removed: # Thank you! ansible-core>=2.16 broke support for removed=True and @@ -206,18 +168,12 @@ def handle_validation_exceptions(self, exceptions: Generator, mode: str) -> int: continue counter += 1 - if mode == "quiet": - continue message = f"[{self.hostname}]: {exception}" - if mode == "error": - self.ansible_display.error(message, wrap_text=False) - elif mode == "info": - self.ansible_display.display(message) - elif mode == "debug": - self.ansible_display.v(message) + if mode == "warning": + self.ansible_display.warning(message) else: - # when mode == "warning" - self.ansible_display.warning(message, formatted=False) + # when mode == "error" + self.ansible_display.error(message, wrap_text=False) return counter def validate_schema(self) -> int: @@ -226,19 +182,13 @@ def validate_schema(self) -> int: Returns int with number of validation errors """ - # avd_schema.validate_schema returns a generator, which we iterate through in handle_exceptions to perform the actual conversions. + # avd_schema.validate_schema returns a generator, which we iterate through in handle_exceptions to perform the actual validations. exceptions = self.avdschema.validate_schema(self.avdschema._schema) return self.handle_validation_exceptions(exceptions, "error") - def build_result_message(self, conversions: int = 0, validation_errors: int = 0, schema_validation_errors: int = 0) -> str | None: + def build_result_message(self, validation_errors: int = 0, schema_validation_errors: int = 0) -> str | None: result_messages = [] - if conversions: - if self.conversion_mode == "error": - result_messages.append(f"{conversions} errors raised during conversion of input vars.") - else: - result_messages.append(f"{conversions} data conversions done to conform to schema.") - if validation_errors: result_messages.append(f"{validation_errors} errors found during schema validation of input vars.") @@ -246,9 +196,6 @@ def build_result_message(self, conversions: int = 0, validation_errors: int = 0, result_messages.append(f"{schema_validation_errors} errors found during meta-schema validation of the generated schema.") if result_messages: - if self.conversion_mode == "debug" or self.validation_mode == "debug": - result_messages.append("Run with -v to see details") - return " ".join(result_messages) return None diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/defaults/main/main.yml b/ansible_collections/arista/avd/roles/eos_cli_config_gen/defaults/main/main.yml index 93d38eb2e5c..5ec01d5c778 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/defaults/main/main.yml +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/defaults/main/main.yml @@ -3,5 +3,4 @@ avd_structured_config_file_format: "yml" # Input Variable Validation -avd_data_conversion_mode: "debug" -avd_data_validation_mode: "warning" +avd_data_validation_mode: "error" diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/role-configuration.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/role-configuration.md index d46fe110777..8dc98f47fde 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/role-configuration.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/role-configuration.md @@ -27,6 +27,18 @@ roles/eos_cli_config_gen/defaults/main/output_directories.yml ## Input Variables Validation settings +Schema validation is built in to the central Action plugins used in AVD. Each plugin runs variable type conversion first and then +performs validation of the converted data. + +By default any data validation issues will trigger errors - blocking further processing. +This behavior can be adjusted by setting the variable described below. + +!!! danger + The input variable `avd_data_validation_mode` now has a default value of `error`, and while it can be set to `warning`, this is highly discouraged. + All AVD code relies on the validation to ensure valid data, so the code assumes that the data is valid. + + If the validation mode is set to `warning`, execution will continue with invalid data, which can lead to hard-to-read errors or incorrect behavior. + --8<-- roles/eos_cli_config_gen/docs/tables/role-input-validation.md --8<-- diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/role-input-validation.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/role-input-validation.md index 9cf132d557b..08c1383e21a 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/role-input-validation.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/role-input-validation.md @@ -7,31 +7,16 @@ | Variable | Type | Required | Default | Value Restrictions | Description | | -------- | ---- | -------- | ------- | ------------------ | ----------- | - | [avd_data_conversion_mode](## "avd_data_conversion_mode") | String | | `debug` | Valid Values:
- disabled
- error
- warning
- info
- debug
- quiet | Conversion Mode for AVD input data conversion.
Input data conversion will perform type conversion of input variables as defined in the schema.
The type conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated.
During conversion, messages will generated with information about the host(s) and key(s) which required conversion.
"disabled" means that conversion will not run - avoid this since conversion is also handling data deprecation and upgrade.
"error" will produce error messages and fail the task.
"warning" will produce warning messages.
"info" will produce regular log messages.
"debug" will produce hidden debug messages viewable with -v.
"quiet" will not produce any messages.
| - | [avd_data_validation_mode](## "avd_data_validation_mode") | String | | `warning` | Valid Values:
- disabled
- error
- warning
- info
- debug | Validation Mode for AVD input data validation.
Input data validation will validate the input variables according to the schema.
During validation, messages will generated with information about the host(s) and key(s) which failed validation.
"disabled" means that validation will not run.
"error" will produce error messages and fail the task.
"warning" will produce warning messages.
"info" will produce regular log messages.
"debug" will produce hidden debug messages viewable with -v.
| + | [avd_data_conversion_mode](## "avd_data_conversion_mode") removed | String | | | | Conversion Mode for AVD input data conversion.
This key was removed. Support was removed in AVD version 5.0.0. | + | [avd_data_validation_mode](## "avd_data_validation_mode") | String | | `error` | Valid Values:
- error
- warning | Validation Mode for AVD input data validation.
Input data validation will validate the input variables according to the schema.
During validation, messages will generated with information about the host(s) and key(s) which failed validation.
"error" will produce error messages and fail the task.
"warning" will produce warning messages.
| === "YAML" ```yaml - # Conversion Mode for AVD input data conversion. - # Input data conversion will perform type conversion of input variables as defined in the schema. - # The type conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated. - # During conversion, messages will generated with information about the host(s) and key(s) which required conversion. - # "disabled" means that conversion will not run - avoid this since conversion is also handling data deprecation and upgrade. - # "error" will produce error messages and fail the task. - # "warning" will produce warning messages. - # "info" will produce regular log messages. - # "debug" will produce hidden debug messages viewable with -v. - # "quiet" will not produce any messages. - avd_data_conversion_mode: - # Validation Mode for AVD input data validation. # Input data validation will validate the input variables according to the schema. # During validation, messages will generated with information about the host(s) and key(s) which failed validation. - # "disabled" means that validation will not run. # "error" will produce error messages and fail the task. # "warning" will produce warning messages. - # "info" will produce regular log messages. - # "debug" will produce hidden debug messages viewable with -v. - avd_data_validation_mode: + avd_data_validation_mode: ``` diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/tasks/main.yml b/ansible_collections/arista/avd/roles/eos_cli_config_gen/tasks/main.yml index 3dc0b707dd6..6c8f57093d5 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/tasks/main.yml +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/tasks/main.yml @@ -29,7 +29,6 @@ config_filename: "{{ eos_config_dir }}/{{ inventory_hostname }}.cfg" documentation_filename: "{{ devices_dir }}/{{ inventory_hostname }}.md" read_structured_config_from_file: "{{ structured_config is not arista.avd.defined }}" - conversion_mode: "{{ avd_data_conversion_mode }}" validation_mode: "{{ avd_data_validation_mode }}" # The logic to be on par with previous tags behavior is as follow: # either all tasks should be run OR the config should explicitly be generated because of a tag in [all, build, provision] diff --git a/ansible_collections/arista/avd/roles/eos_designs/defaults/main/main.yml b/ansible_collections/arista/avd/roles/eos_designs/defaults/main/main.yml index 93d38eb2e5c..5ec01d5c778 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/defaults/main/main.yml +++ b/ansible_collections/arista/avd/roles/eos_designs/defaults/main/main.yml @@ -3,5 +3,4 @@ avd_structured_config_file_format: "yml" # Input Variable Validation -avd_data_conversion_mode: "debug" -avd_data_validation_mode: "warning" +avd_data_validation_mode: "error" diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/role-configuration.md b/ansible_collections/arista/avd/roles/eos_designs/docs/role-configuration.md index 2adbda8140c..2b53a039a7e 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/role-configuration.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/role-configuration.md @@ -27,6 +27,18 @@ roles/eos_designs/defaults/main/output_directories.yml ## Input Variables Validation settings +Schema validation is built in to the central Action plugins used in AVD. Each plugin runs variable type conversion first and then +performs validation of the converted data. + +By default any data validation issues will trigger errors - blocking further processing. +This behavior can be adjusted by setting the variable described below. + +!!! danger + The input variable `avd_data_validation_mode` now has a default value of `error`, and while it can be set to `warning`, this is highly discouraged. + All AVD code relies on the validation to ensure valid data, so the code assumes that the data is valid. + + If the validation mode is set to `warning`, execution will continue with invalid data, which can lead to hard-to-read errors or incorrect behavior. + --8<-- roles/eos_designs/docs/tables/role-input-validation.md --8<-- diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/role-input-validation.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/role-input-validation.md index 9cf132d557b..08c1383e21a 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/role-input-validation.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/role-input-validation.md @@ -7,31 +7,16 @@ | Variable | Type | Required | Default | Value Restrictions | Description | | -------- | ---- | -------- | ------- | ------------------ | ----------- | - | [avd_data_conversion_mode](## "avd_data_conversion_mode") | String | | `debug` | Valid Values:
- disabled
- error
- warning
- info
- debug
- quiet | Conversion Mode for AVD input data conversion.
Input data conversion will perform type conversion of input variables as defined in the schema.
The type conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated.
During conversion, messages will generated with information about the host(s) and key(s) which required conversion.
"disabled" means that conversion will not run - avoid this since conversion is also handling data deprecation and upgrade.
"error" will produce error messages and fail the task.
"warning" will produce warning messages.
"info" will produce regular log messages.
"debug" will produce hidden debug messages viewable with -v.
"quiet" will not produce any messages.
| - | [avd_data_validation_mode](## "avd_data_validation_mode") | String | | `warning` | Valid Values:
- disabled
- error
- warning
- info
- debug | Validation Mode for AVD input data validation.
Input data validation will validate the input variables according to the schema.
During validation, messages will generated with information about the host(s) and key(s) which failed validation.
"disabled" means that validation will not run.
"error" will produce error messages and fail the task.
"warning" will produce warning messages.
"info" will produce regular log messages.
"debug" will produce hidden debug messages viewable with -v.
| + | [avd_data_conversion_mode](## "avd_data_conversion_mode") removed | String | | | | Conversion Mode for AVD input data conversion.
This key was removed. Support was removed in AVD version 5.0.0. | + | [avd_data_validation_mode](## "avd_data_validation_mode") | String | | `error` | Valid Values:
- error
- warning | Validation Mode for AVD input data validation.
Input data validation will validate the input variables according to the schema.
During validation, messages will generated with information about the host(s) and key(s) which failed validation.
"error" will produce error messages and fail the task.
"warning" will produce warning messages.
| === "YAML" ```yaml - # Conversion Mode for AVD input data conversion. - # Input data conversion will perform type conversion of input variables as defined in the schema. - # The type conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated. - # During conversion, messages will generated with information about the host(s) and key(s) which required conversion. - # "disabled" means that conversion will not run - avoid this since conversion is also handling data deprecation and upgrade. - # "error" will produce error messages and fail the task. - # "warning" will produce warning messages. - # "info" will produce regular log messages. - # "debug" will produce hidden debug messages viewable with -v. - # "quiet" will not produce any messages. - avd_data_conversion_mode: - # Validation Mode for AVD input data validation. # Input data validation will validate the input variables according to the schema. # During validation, messages will generated with information about the host(s) and key(s) which failed validation. - # "disabled" means that validation will not run. # "error" will produce error messages and fail the task. # "warning" will produce warning messages. - # "info" will produce regular log messages. - # "debug" will produce hidden debug messages viewable with -v. - avd_data_validation_mode: + avd_data_validation_mode: ``` diff --git a/ansible_collections/arista/avd/roles/eos_designs/tasks/main.yml b/ansible_collections/arista/avd/roles/eos_designs/tasks/main.yml index 09a9fbd7f4e..23c6a61e4b2 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/tasks/main.yml +++ b/ansible_collections/arista/avd/roles/eos_designs/tasks/main.yml @@ -32,7 +32,6 @@ avd_switch_facts: true # cprofile_file: "eos_designs_facts.prof" template_output: true - conversion_mode: "{{ avd_data_conversion_mode }}" validation_mode: "{{ avd_data_validation_mode }}" check_mode: false run_once: true @@ -53,7 +52,6 @@ dest: "{{ structured_dir }}/{{ inventory_hostname }}.{{ avd_structured_config_file_format }}" # cprofile_file: "structured-{{inventory_hostname}}.prof" template_output: true - conversion_mode: "{{ avd_data_conversion_mode }}" validation_mode: "{{ avd_data_validation_mode }}" delegate_to: localhost check_mode: false diff --git a/ansible_collections/arista/avd/tests/integration/targets/eos_designs_structured_config/defaults/main.yaml b/ansible_collections/arista/avd/tests/integration/targets/eos_designs_structured_config/defaults/main.yaml index e19fd863b84..128ba8ae269 100644 --- a/ansible_collections/arista/avd/tests/integration/targets/eos_designs_structured_config/defaults/main.yaml +++ b/ansible_collections/arista/avd/tests/integration/targets/eos_designs_structured_config/defaults/main.yaml @@ -4,8 +4,6 @@ collection_path: "{{ lookup('env', 'ANSIBLE_COLLECTIONS_PATH') }}/ansible_collec expected_output_dir: "{{ collection_path }}/inventory/eos_designs_structured_config/expected_output" actual_output_dir: "{{ collection_path }}/output" -avd_data_validation_mode: error -avd_data_conversion_mode: error fabric_name: integration_tests type: l2leaf l2leaf: diff --git a/ansible_collections/arista/avd/tests/integration/targets/eos_designs_structured_config/tests/test_with_invalid_inputs.yml b/ansible_collections/arista/avd/tests/integration/targets/eos_designs_structured_config/tests/test_with_invalid_inputs.yml index 07e87000374..11d1ae4b5a4 100644 --- a/ansible_collections/arista/avd/tests/integration/targets/eos_designs_structured_config/tests/test_with_invalid_inputs.yml +++ b/ansible_collections/arista/avd/tests/integration/targets/eos_designs_structured_config/tests/test_with_invalid_inputs.yml @@ -8,7 +8,7 @@ - vars: error_msg: >- - 1 errors found during schema validation of input vars. Run with -v to see details + 1 errors found during schema validation of input vars. assert: that: - result.failed == True diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index 150fa185f45..3223e7b606f 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -730,50 +730,21 @@ keys: documentation_options: table: role-input-validation type: str - valid_values: - - disabled - - error - - warning - - info - - debug - - quiet - default: debug + deprecation: + warning: true + removed: true + remove_in_version: 5.0.0 description: 'Conversion Mode for AVD input data conversion. - Input data conversion will perform type conversion of input variables as defined - in the schema. - - The type conversion is intended to help the user to identify minor issues with - the input data, while still allowing the data to be validated. - - During conversion, messages will generated with information about the host(s) - and key(s) which required conversion. - - "disabled" means that conversion will not run - avoid this since conversion - is also handling data deprecation and upgrade. - - "error" will produce error messages and fail the task. - - "warning" will produce warning messages. - - "info" will produce regular log messages. - - "debug" will produce hidden debug messages viewable with -v. - - "quiet" will not produce any messages. - ' avd_data_validation_mode: documentation_options: table: role-input-validation type: str valid_values: - - disabled - error - warning - - info - - debug - default: warning + default: error description: 'Validation Mode for AVD input data validation. Input data validation will validate the input variables according to the schema. @@ -781,16 +752,10 @@ keys: During validation, messages will generated with information about the host(s) and key(s) which failed validation. - "disabled" means that validation will not run. - "error" will produce error messages and fail the task. "warning" will produce warning messages. - "info" will produce regular log messages. - - "debug" will produce hidden debug messages viewable with -v. - ' banners: type: dict diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/avd_data_conversion_mode.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/avd_data_conversion_mode.schema.yml index e69507b0a0f..6472f4ec0a1 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/avd_data_conversion_mode.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/avd_data_conversion_mode.schema.yml @@ -10,16 +10,9 @@ keys: documentation_options: table: role-input-validation type: str - valid_values: ["disabled", "error", "warning", "info", "debug", "quiet"] - default: "debug" + deprecation: + warning: true + removed: true + remove_in_version: 5.0.0 description: | Conversion Mode for AVD input data conversion. - Input data conversion will perform type conversion of input variables as defined in the schema. - The type conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated. - During conversion, messages will generated with information about the host(s) and key(s) which required conversion. - "disabled" means that conversion will not run - avoid this since conversion is also handling data deprecation and upgrade. - "error" will produce error messages and fail the task. - "warning" will produce warning messages. - "info" will produce regular log messages. - "debug" will produce hidden debug messages viewable with -v. - "quiet" will not produce any messages. diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/avd_data_validation_mode.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/avd_data_validation_mode.schema.yml index a2ce34741ed..1e0052d92b2 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/avd_data_validation_mode.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/avd_data_validation_mode.schema.yml @@ -10,14 +10,11 @@ keys: documentation_options: table: role-input-validation type: str - valid_values: ["disabled", "error", "warning", "info", "debug"] - default: "warning" + valid_values: ["error", "warning"] + default: "error" description: | Validation Mode for AVD input data validation. Input data validation will validate the input variables according to the schema. During validation, messages will generated with information about the host(s) and key(s) which failed validation. - "disabled" means that validation will not run. "error" will produce error messages and fail the task. "warning" will produce warning messages. - "info" will produce regular log messages. - "debug" will produce hidden debug messages viewable with -v. diff --git a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml index cc4e22dea23..64763085213 100644 --- a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml @@ -16,50 +16,21 @@ keys: documentation_options: table: role-input-validation type: str - valid_values: - - disabled - - error - - warning - - info - - debug - - quiet - default: debug + deprecation: + warning: true + removed: true + remove_in_version: 5.0.0 description: 'Conversion Mode for AVD input data conversion. - Input data conversion will perform type conversion of input variables as defined - in the schema. - - The type conversion is intended to help the user to identify minor issues with - the input data, while still allowing the data to be validated. - - During conversion, messages will generated with information about the host(s) - and key(s) which required conversion. - - "disabled" means that conversion will not run - avoid this since conversion - is also handling data deprecation and upgrade. - - "error" will produce error messages and fail the task. - - "warning" will produce warning messages. - - "info" will produce regular log messages. - - "debug" will produce hidden debug messages viewable with -v. - - "quiet" will not produce any messages. - ' avd_data_validation_mode: documentation_options: table: role-input-validation type: str valid_values: - - disabled - error - warning - - info - - debug - default: warning + default: error description: 'Validation Mode for AVD input data validation. Input data validation will validate the input variables according to the schema. @@ -67,16 +38,10 @@ keys: During validation, messages will generated with information about the host(s) and key(s) which failed validation. - "disabled" means that validation will not run. - "error" will produce error messages and fail the task. "warning" will produce warning messages. - "info" will produce regular log messages. - - "debug" will produce hidden debug messages viewable with -v. - ' bfd_multihop: documentation_options: @@ -2213,8 +2178,6 @@ keys: ' default_overlay_address_families: type: list - convert_types: - - str items: type: str convert_to_lower_case: true @@ -8452,8 +8415,6 @@ $defs: documentation_options: table: node-type-mpls-configuration type: list - convert_types: - - str items: type: str valid_values: @@ -8467,8 +8428,6 @@ $defs: documentation_options: table: node-type-mpls-configuration type: list - convert_types: - - str description: List of inventory hostname acting as MPLS route-reflectors. items: type: str diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/avd_data_conversion_mode.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/avd_data_conversion_mode.schema.yml index e69507b0a0f..6472f4ec0a1 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/avd_data_conversion_mode.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/avd_data_conversion_mode.schema.yml @@ -10,16 +10,9 @@ keys: documentation_options: table: role-input-validation type: str - valid_values: ["disabled", "error", "warning", "info", "debug", "quiet"] - default: "debug" + deprecation: + warning: true + removed: true + remove_in_version: 5.0.0 description: | Conversion Mode for AVD input data conversion. - Input data conversion will perform type conversion of input variables as defined in the schema. - The type conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated. - During conversion, messages will generated with information about the host(s) and key(s) which required conversion. - "disabled" means that conversion will not run - avoid this since conversion is also handling data deprecation and upgrade. - "error" will produce error messages and fail the task. - "warning" will produce warning messages. - "info" will produce regular log messages. - "debug" will produce hidden debug messages viewable with -v. - "quiet" will not produce any messages. diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/avd_data_validation_mode.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/avd_data_validation_mode.schema.yml index a2ce34741ed..1e0052d92b2 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/avd_data_validation_mode.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/avd_data_validation_mode.schema.yml @@ -10,14 +10,11 @@ keys: documentation_options: table: role-input-validation type: str - valid_values: ["disabled", "error", "warning", "info", "debug"] - default: "warning" + valid_values: ["error", "warning"] + default: "error" description: | Validation Mode for AVD input data validation. Input data validation will validate the input variables according to the schema. During validation, messages will generated with information about the host(s) and key(s) which failed validation. - "disabled" means that validation will not run. "error" will produce error messages and fail the task. "warning" will produce warning messages. - "info" will produce regular log messages. - "debug" will produce hidden debug messages viewable with -v. diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type.schema.yml index f3b7c8e5fe7..01e5415a502 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type.schema.yml @@ -1034,8 +1034,6 @@ $defs: documentation_options: table: node-type-mpls-configuration type: list - convert_types: - - "str" items: type: str valid_values: @@ -1048,8 +1046,6 @@ $defs: documentation_options: table: node-type-mpls-configuration type: list - convert_types: - - "str" description: List of inventory hostname acting as MPLS route-reflectors. items: type: str diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/node_type_keys.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/node_type_keys.schema.yml index 3ac881cdb54..decd99c85ce 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/node_type_keys.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/node_type_keys.schema.yml @@ -93,8 +93,6 @@ keys: Acting role in overlay control plane. default_overlay_address_families: type: list - convert_types: - - "str" items: type: str convert_to_lower_case: true diff --git a/python-avd/tests/schema_tools/artifacts/eos_cli_config_gen.schema.yml b/python-avd/tests/schema_tools/artifacts/eos_cli_config_gen.schema.yml index dea298d1612..13f47f1f485 100644 --- a/python-avd/tests/schema_tools/artifacts/eos_cli_config_gen.schema.yml +++ b/python-avd/tests/schema_tools/artifacts/eos_cli_config_gen.schema.yml @@ -438,52 +438,14 @@ keys: - igp - incomplete default: any - avd_data_conversion_mode: - documentation_options: - table: role-input-validation - type: str - valid_values: - - disabled - - error - - warning - - info - - debug - - quiet - default: debug - description: 'Conversion Mode for AVD input data conversion. - - Input data conversion will perform type conversion of input variables as defined - in the schema. - - The type conversion is intended to help the user to identify minor issues with - the input data, while still allowing the data to be validated. - - During conversion, messages will generated with information about the host(s) - and key(s) which required conversion. - - "disabled" means that conversion will not run - avoid this since conversion - is also handling data deprecation and upgrade. - - "error" will produce error messages and fail the task. - - "warning" will produce warning messages. - - "info" will produce regular log messages. - - "debug" will produce hidden debug messages viewable with -v. - - "quiet" will not produce any messages' avd_data_validation_mode: documentation_options: table: role-input-validation type: str valid_values: - - disabled - error - warning - - info - - debug - default: warning + default: error description: 'Validation Mode for AVD input data validation. Input data validation will validate the input variables according to the schema. @@ -491,15 +453,9 @@ keys: During validation, messages will generated with information about the host(s) and key(s) which failed validation. - "disabled" means that validation will not run. - "error" will produce error messages and fail the task. - "warning" will produce warning messages. - - "info" will produce regular log messages. - - "debug" will produce hidden debug messages viewable with -v.' + "warning" will produce warning messages.' banners: type: dict keys: diff --git a/python-avd/tests/schema_tools/artifacts/eos_designs.schema.yml b/python-avd/tests/schema_tools/artifacts/eos_designs.schema.yml index 8bc8e8ada3e..e462b3cfa83 100644 --- a/python-avd/tests/schema_tools/artifacts/eos_designs.schema.yml +++ b/python-avd/tests/schema_tools/artifacts/eos_designs.schema.yml @@ -6,52 +6,14 @@ $id: eos_designs type: dict allow_other_keys: true keys: - avd_data_conversion_mode: - documentation_options: - table: role-input-validation - type: str - valid_values: - - disabled - - error - - warning - - info - - debug - - quiet - default: debug - description: 'Conversion Mode for AVD input data conversion. - - Input data conversion will perform type conversion of input variables as defined - in the schema. - - The type conversion is intended to help the user to identify minor issues with - the input data, while still allowing the data to be validated. - - During conversion, messages will generated with information about the host(s) - and key(s) which required conversion. - - "disabled" means that conversion will not run - avoid this since conversion - is also handling data deprecation and upgrade. - - "error" will produce error messages and fail the task. - - "warning" will produce warning messages. - - "info" will produce regular log messages. - - "debug" will produce hidden debug messages viewable with -v. - - "quiet" will not produce any messages' avd_data_validation_mode: documentation_options: table: role-input-validation type: str valid_values: - - disabled - error - warning - - info - - debug - default: warning + default: error description: 'Validation Mode for AVD input data validation. Input data validation will validate the input variables according to the schema. @@ -59,15 +21,9 @@ keys: During validation, messages will generated with information about the host(s) and key(s) which failed validation. - "disabled" means that validation will not run. - "error" will produce error messages and fail the task. - "warning" will produce warning messages. - - "info" will produce regular log messages. - - "debug" will produce hidden debug messages viewable with -v.' + "warning" will produce warning messages.' bfd_multihop: documentation_options: table: bfd-settings