diff --git a/src/rougail/output_doc/utils.py b/src/rougail/output_doc/utils.py index b9f5be19f..615fb9116 100644 --- a/src/rougail/output_doc/utils.py +++ b/src/rougail/output_doc/utils.py @@ -64,6 +64,11 @@ DocTypes = { "allow_reserved": _("reserved IP are allowed"), }, }, + "network": { + "params": { + "cidr": _("network must be in CIDR format"), + }, + }, "hostname": { "params": { "allow_ip": _("the host name can be an IP"), diff --git a/tests/results/test/00_6network.adoc b/tests/results/test/00_6network.adoc index 097b236b4..4374ab318 100644 --- a/tests/results/test/00_6network.adoc +++ b/tests/results/test/00_6network.adoc @@ -12,6 +12,7 @@ An network. + **var2** + `https://rougail.readthedocs.io/en/latest/variable.html#variables-types[network]` `standard` `mandatory` | An network in CIDR format. + +**Validator**: network must be in CIDR format + **Default**: 1.1.1.0/24 | diff --git a/tests/results/test/00_6network.json b/tests/results/test/00_6network.json index 350c92c1d..b9184ca7b 100644 --- a/tests/results/test/00_6network.json +++ b/tests/results/test/00_6network.json @@ -49,6 +49,10 @@ "name": "mandatory" } ], + "validators": { + "name": "Validator", + "values": "network must be in CIDR format" + }, "paths": [ "var2" ], diff --git a/tests/results/test/00_6network.md b/tests/results/test/00_6network.md index bb0e0db10..4bdc69332 100644 --- a/tests/results/test/00_6network.md +++ b/tests/results/test/00_6network.md @@ -1,6 +1,6 @@ | Variable                                                                                                         | Description                                                                                                      | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **var1**
[`network`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | An network.
**Default**: 1.1.1.0 | -| **var2**
[`network`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | An network in CIDR format.
**Default**: 1.1.1.0/24 | +| **var2**
[`network`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | An network in CIDR format.
**Validator**: network must be in CIDR format
**Default**: 1.1.1.0/24 | | **var3**
[`network_cidr`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | An network in CIDR format with obsolete CIDR type.
**Default**: 1.1.1.0/24 | diff --git a/tests/results/test/00_6network.sh b/tests/results/test/00_6network.sh index b668dee2c..b34dd79f9 100644 --- a/tests/results/test/00_6network.sh +++ b/tests/results/test/00_6network.sh @@ -5,7 +5,9 @@ │  network   standard   mandatory  │ Default: 1.1.1.0 │ ├───────────────────────────────────────┼──────────────────────────────────────┤ │ var2 │ An network in CIDR format. │ -│  network   standard   mandatory  │ Default: 1.1.1.0/24 │ +│  network   standard   mandatory  │ Validator: network must be in CIDR │ +│ │ format │ +│ │ Default: 1.1.1.0/24 │ ├───────────────────────────────────────┼──────────────────────────────────────┤ │ var3 │ An network in CIDR format with │ │  network_cidr   standard   mandatory  │ obsolete CIDR type. │ diff --git a/tests/results/test_namespace/00_6network.adoc b/tests/results/test_namespace/00_6network.adoc index 490e3f19b..8e9dadee0 100644 --- a/tests/results/test_namespace/00_6network.adoc +++ b/tests/results/test_namespace/00_6network.adoc @@ -14,6 +14,7 @@ An network. + **rougail.var2** + `https://rougail.readthedocs.io/en/latest/variable.html#variables-types[network]` `standard` `mandatory` | An network in CIDR format. + +**Validator**: network must be in CIDR format + **Default**: 1.1.1.0/24 | diff --git a/tests/results/test_namespace/00_6network.json b/tests/results/test_namespace/00_6network.json index 06ae78415..05f3748d2 100644 --- a/tests/results/test_namespace/00_6network.json +++ b/tests/results/test_namespace/00_6network.json @@ -67,6 +67,10 @@ "name": "mandatory" } ], + "validators": { + "name": "Validator", + "values": "network must be in CIDR format" + }, "paths": [ "rougail.var2" ], diff --git a/tests/results/test_namespace/00_6network.md b/tests/results/test_namespace/00_6network.md index 37c6dd54f..41449aa7d 100644 --- a/tests/results/test_namespace/00_6network.md +++ b/tests/results/test_namespace/00_6network.md @@ -3,6 +3,6 @@ | Variable                                                                                                         | Description                                                                                                      | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **rougail.var1**
[`network`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | An network.
**Default**: 1.1.1.0 | -| **rougail.var2**
[`network`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | An network in CIDR format.
**Default**: 1.1.1.0/24 | +| **rougail.var2**
[`network`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | An network in CIDR format.
**Validator**: network must be in CIDR format
**Default**: 1.1.1.0/24 | | **rougail.var3**
[`network_cidr`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | An network in CIDR format with obsolete CIDR type.
**Default**: 1.1.1.0/24 | diff --git a/tests/results/test_namespace/00_6network.sh b/tests/results/test_namespace/00_6network.sh index fd461e57d..7532a1748 100644 --- a/tests/results/test_namespace/00_6network.sh +++ b/tests/results/test_namespace/00_6network.sh @@ -10,7 +10,9 @@ │  network   standard   mandatory  │ Default: 1.1.1.0 │ ├───────────────────────────────────────┼──────────────────────────────────────┤ │ rougail.var2 │ An network in CIDR format. │ -│  network   standard   mandatory  │ Default: 1.1.1.0/24 │ +│  network   standard   mandatory  │ Validator: network must be in CIDR │ +│ │ format │ +│ │ Default: 1.1.1.0/24 │ ├───────────────────────────────────────┼──────────────────────────────────────┤ │ rougail.var3 │ An network in CIDR format with │ │  network_cidr   standard   mandatory  │ obsolete CIDR type. │