From bb86ad68257e7e2babceaead0b2b9ac693a06c40 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:43:43 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/advanced_usages/as-python-lib.md | 2 +- docs/advanced_usages/custom-tests.md | 16 ++++++++-------- docs/cli/exec.md | 2 +- docs/cli/inv-from-ansible.md | 7 ++++--- docs/cli/tag-management.md | 2 +- docs/contribution.md | 2 +- docs/usage-inventory-catalog.md | 2 +- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/advanced_usages/as-python-lib.md b/docs/advanced_usages/as-python-lib.md index 12f2c557e..fce5e7eea 100644 --- a/docs/advanced_usages/as-python-lib.md +++ b/docs/advanced_usages/as-python-lib.md @@ -48,7 +48,7 @@ The [AntaInventory](../api/inventory.md#anta.inventory.AntaInventory) class is a ``` > [!NOTE] -> __How to create your inventory file__ +> **How to create your inventory file** > > Please visit this [dedicated section](../usage-inventory-catalog.md) for how to use inventory and catalog files. diff --git a/docs/advanced_usages/custom-tests.md b/docs/advanced_usages/custom-tests.md index ffd81a9b9..d4b20c3a4 100644 --- a/docs/advanced_usages/custom-tests.md +++ b/docs/advanced_usages/custom-tests.md @@ -83,12 +83,12 @@ Full AntaTest API documentation is available in the [API documentation section]( heading_level: 10 > [!NOTE] -> __Logger object__ +> **Logger object** > > ANTA already provides comprehensive logging at every steps of a test execution. The [AntaTest](../api/models.md#anta.models.AntaTest) class also provides a `logger` attribute that is a Python logger specific to the test instance. See [Python documentation](https://docs.python.org/3/library/logging.html) for more information. > [!NOTE] -> __AntaDevice object__ +> **AntaDevice object** > > Even if `device` is not a private attribute, you should not need to access this object in your code. @@ -198,13 +198,13 @@ class (AntaTest): ``` > [!TIP] -> __Command revision and version__ +> **Command revision and version** > -> * Most of EOS commands return a JSON structure according to a model (some commands may not be modeled hence the necessity to use `text` outformat sometimes. -> * The model can change across time (adding feature, ... ) and when the model is changed in a non backward-compatible way, the **revision** number is bumped. The initial model starts with **revision** 1. -> * A **revision** applies to a particular CLI command whereas a **version** is global to an eAPI call. The **version** is internally translated to a specific **revision** for each CLI command in the RPC call. The currently supported **version** values are `1` and `latest`. -> * A **revision takes precedence over a version** (e.g. if a command is run with version="latest" and revision=1, the first revision of the model is returned) -> * By default, eAPI returns the first revision of each model to ensure that when upgrading, integrations with existing tools are not broken. This is done by using by default `version=1` in eAPI calls. +> - Most of EOS commands return a JSON structure according to a model (some commands may not be modeled hence the necessity to use `text` outformat sometimes. +> - The model can change across time (adding feature, ... ) and when the model is changed in a non backward-compatible way, the **revision** number is bumped. The initial model starts with **revision** 1. +> - A **revision** applies to a particular CLI command whereas a **version** is global to an eAPI call. The **version** is internally translated to a specific **revision** for each CLI command in the RPC call. The currently supported **version** values are `1` and `latest`. +> - A **revision takes precedence over a version** (e.g. if a command is run with version="latest" and revision=1, the first revision of the model is returned) +> - By default, eAPI returns the first revision of each model to ensure that when upgrading, integrations with existing tools are not broken. This is done by using by default `version=1` in eAPI calls. > > By default, ANTA uses `version="latest"` in AntaCommand, but when developing tests, the revision MUST be provided when the outformat of the command is `json`. As explained earlier, this is to ensure that the eAPI always returns the same output model and that the test remains always valid from the day it was created. For some commands, you may also want to run them with a different revision or version. > diff --git a/docs/cli/exec.md b/docs/cli/exec.md index 78f928d85..a7a0fe330 100644 --- a/docs/cli/exec.md +++ b/docs/cli/exec.md @@ -253,7 +253,7 @@ ANTA uses SCP to download files from devices and will not trust unknown SSH host The configuration `aaa authorization exec default` must be present on devices to be able to use SCP. > [!CAUTION] -> __Deprecation__ +> **Deprecation** > > ANTA can automatically configure `aaa authorization exec default local` using the `anta exec collect-tech-support --configure` option but this option is deprecated and will be removed in ANTA 2.0.0. diff --git a/docs/cli/inv-from-ansible.md b/docs/cli/inv-from-ansible.md index 44e5202f7..2206341de 100644 --- a/docs/cli/inv-from-ansible.md +++ b/docs/cli/inv-from-ansible.md @@ -32,11 +32,12 @@ Options: ``` > [!WARNING]warning -> * `anta get from-ansible` does not support inline vaulted variables, comment them out to generate your inventory. > -> * If the vaulted variable is necessary to build the inventory (e.g. `ansible_host`), it needs to be unvaulted for `from-ansible` command to work." +> - `anta get from-ansible` does not support inline vaulted variables, comment them out to generate your inventory. > -> * The current implementation only considers devices directly attached to a specific Ansible group and does not support inheritance when using the `--ansible-group` option. +> - If the vaulted variable is necessary to build the inventory (e.g. `ansible_host`), it needs to be unvaulted for `from-ansible` command to work." +> +> - The current implementation only considers devices directly attached to a specific Ansible group and does not support inheritance when using the `--ansible-group` option. By default, if user does not provide `--output` file, anta will save output to configured anta inventory (`anta --inventory`). If the output file has content, anta will ask user to overwrite when running in interactive console. This mechanism can be controlled by triggers in case of CI usage: `--overwrite` to force anta to overwrite file. If not set, anta will exit diff --git a/docs/cli/tag-management.md b/docs/cli/tag-management.md index ea59f1038..ee45e4b88 100644 --- a/docs/cli/tag-management.md +++ b/docs/cli/tag-management.md @@ -95,7 +95,7 @@ anta.tests.interfaces: > A tag used to filter a test can also be a device name > [!TIP] -> __Use different input values for a specific test__ +> **Use different input values for a specific test** > > Leverage tags to define different input values for a specific test. See the `VerifyUptime` example above. diff --git a/docs/contribution.md b/docs/contribution.md index d9c41efd8..03923f695 100644 --- a/docs/contribution.md +++ b/docs/contribution.md @@ -88,7 +88,7 @@ Success: no issues found in 82 source files ## Unit tests with Pytest -To keep high quality code, we require to provide a __Pytest__ for every tests implemented in ANTA. +To keep high quality code, we require to provide a **Pytest** for every tests implemented in ANTA. All submodule should have its own pytest section under `tests/units/anta_tests/.py`. diff --git a/docs/usage-inventory-catalog.md b/docs/usage-inventory-catalog.md index 914f0e0e3..7baebfbee 100644 --- a/docs/usage-inventory-catalog.md +++ b/docs/usage-inventory-catalog.md @@ -278,7 +278,7 @@ custom.tests.system: ``` > [!TIP] -> __How to create custom tests__ +> **How to create custom tests** > > To create your custom tests, you should refer to this [documentation](advanced_usages/custom-tests.md)