Skip to content

Commit 8539c58

Browse files
MaheshGSLABMahesh Kumargmuloc
authored
Fix(eos_cli_config_gen): Fix the errdisable documentation J2 expects recovery.interval to be always set (#4979)
Co-authored-by: Mahesh Kumar <[email protected]> Co-authored-by: Guillaume Mulocher <[email protected]>
1 parent dd8f901 commit 8539c58

File tree

5 files changed

+100
-94
lines changed

5 files changed

+100
-94
lines changed

Diff for: ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md

+22-29
Original file line numberDiff line numberDiff line change
@@ -11608,35 +11608,28 @@ ip nat synchronization
1160811608

1160911609
### Errdisable Summary
1161011610

11611-
| Detect Cause | Enabled |
11612-
| ------------- | ------- |
11613-
| acl | True |
11614-
| arp-inspection | True |
11615-
| dot1x | True |
11616-
| link-change | True |
11617-
| tapagg | True |
11618-
| xcvr-misconfigured | True |
11619-
| xcvr-overheat | True |
11620-
| xcvr-power-unsupported | True |
11621-
11622-
| Detect Cause | Enabled | Interval |
11623-
| ------------- | ------- | -------- |
11624-
| arp-inspection | True | 300 |
11625-
| bpduguard | True | 300 |
11626-
| dot1x | True | 300 |
11627-
| hitless-reload-down | True | 300 |
11628-
| lacp-rate-limit | True | 300 |
11629-
| link-flap | True | 300 |
11630-
| no-internal-vlan | True | 300 |
11631-
| portchannelguard | True | 300 |
11632-
| portsec | True | 300 |
11633-
| speed-misconfigured | True | 300 |
11634-
| tapagg | True | 300 |
11635-
| uplink-failure-detection | True | 300 |
11636-
| xcvr-misconfigured | True | 300 |
11637-
| xcvr-overheat | True | 300 |
11638-
| xcvr-power-unsupported | True | 300 |
11639-
| xcvr-unsupported | True | 300 |
11611+
Errdisable recovery timer interval: 300 seconds
11612+
11613+
| Cause | Detection Enabled | Recovery Enabled |
11614+
| ------ | ----------------- | ---------------- |
11615+
| acl | True | - |
11616+
| arp-inspection | True | True |
11617+
| bpduguard | - | True |
11618+
| dot1x | True | True |
11619+
| hitless-reload-down | - | True |
11620+
| lacp-rate-limit | - | True |
11621+
| link-change | True | - |
11622+
| link-flap | - | True |
11623+
| no-internal-vlan | - | True |
11624+
| portchannelguard | - | True |
11625+
| portsec | - | True |
11626+
| speed-misconfigured | - | True |
11627+
| tapagg | True | True |
11628+
| uplink-failure-detection | - | True |
11629+
| xcvr-misconfigured | True | True |
11630+
| xcvr-overheat | True | True |
11631+
| xcvr-power-unsupported | True | True |
11632+
| xcvr-unsupported | - | True |
1164011633

1164111634
```eos
1164211635
!

Diff for: ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host2.md

+33
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@
111111
- [IP DHCP Snooping Device Configuration](#ip-dhcp-snooping-device-configuration)
112112
- [IP NAT](#ip-nat)
113113
- [IP NAT Device Configuration](#ip-nat-device-configuration)
114+
- [Errdisable](#errdisable)
115+
- [Errdisable Summary](#errdisable-summary)
114116
- [MACsec](#macsec)
115117
- [MACsec Summary](#macsec-summary)
116118
- [MACsec Device Configuration](#macsec-device-configuration)
@@ -1498,6 +1500,37 @@ ip dhcp snooping
14981500
ip nat synchronization
14991501
```
15001502

1503+
## Errdisable
1504+
1505+
### Errdisable Summary
1506+
1507+
| Cause | Detection Enabled | Recovery Enabled |
1508+
| ------ | ----------------- | ---------------- |
1509+
| arp-inspection | - | True |
1510+
| bpduguard | - | True |
1511+
| hitless-reload-down | - | True |
1512+
| lacp-rate-limit | - | True |
1513+
| link-flap | - | True |
1514+
| no-internal-vlan | - | True |
1515+
| portchannelguard | - | True |
1516+
| portsec | - | True |
1517+
| tapagg | - | True |
1518+
| uplink-failure-detection | - | True |
1519+
1520+
```eos
1521+
!
1522+
errdisable recovery cause arp-inspection
1523+
errdisable recovery cause bpduguard
1524+
errdisable recovery cause hitless-reload-down
1525+
errdisable recovery cause lacp-rate-limit
1526+
errdisable recovery cause link-flap
1527+
errdisable recovery cause no-internal-vlan
1528+
errdisable recovery cause portchannelguard
1529+
errdisable recovery cause portsec
1530+
errdisable recovery cause tapagg
1531+
errdisable recovery cause uplink-failure-detection
1532+
```
1533+
15011534
## MACsec
15021535

15031536
### MACsec Summary

Diff for: ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host2.cfg

+11
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ ip dhcp snooping
2020
!
2121
switchport default mode routed
2222
!
23+
errdisable recovery cause arp-inspection
24+
errdisable recovery cause bpduguard
25+
errdisable recovery cause hitless-reload-down
26+
errdisable recovery cause lacp-rate-limit
27+
errdisable recovery cause link-flap
28+
errdisable recovery cause no-internal-vlan
29+
errdisable recovery cause portchannelguard
30+
errdisable recovery cause portsec
31+
errdisable recovery cause tapagg
32+
errdisable recovery cause uplink-failure-detection
33+
!
2334
flow tracking sampled
2435
sample 666
2536
hardware offload ipv4 ipv6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
errdisable:
3+
recovery:
4+
causes:
5+
- bpduguard
6+
- arp-inspection
7+
- portsec
8+
- hitless-reload-down
9+
- lacp-rate-limit
10+
- link-flap
11+
- no-internal-vlan
12+
- portchannelguard
13+
- tapagg
14+
- uplink-failure-detection

Diff for: python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/errdisable.j2

+20-65
Original file line numberDiff line numberDiff line change
@@ -9,73 +9,28 @@
99
## Errdisable
1010

1111
### Errdisable Summary
12+
{% if errdisable.recovery.interval is arista.avd.defined %}
1213

13-
{% if errdisable.recovery is defined %}
14-
{% if errdisable.detect.causes is defined %}
15-
| Detect Cause | Enabled |
16-
| ------------- | ------- |
17-
{% for cause in errdisable.detect.causes | arista.avd.natural_sort %}
18-
{% if cause == 'acl' %}
19-
| {{ cause }} | True |
20-
{% elif cause == 'arp-inspection' %}
21-
| {{ cause }} | True |
22-
{% elif cause == 'dot1x' %}
23-
| {{ cause }} | True |
24-
{% elif cause == 'link-change' %}
25-
| {{ cause }} | True |
26-
{% elif cause == 'tapagg' %}
27-
| {{ cause }} | True |
28-
{% elif cause == 'xcvr-misconfigured' %}
29-
| {{ cause }} | True |
30-
{% elif cause == 'xcvr-overheat' %}
31-
| {{ cause }} | True |
32-
{% elif cause == 'xcvr-power-unsupported' %}
33-
| {{ cause }} | True |
34-
{% endif %}
35-
{% endfor %}
36-
{% endif %}
14+
Errdisable recovery timer interval: {{ errdisable.recovery.interval }} seconds
15+
{% endif %}
16+
{% if errdisable.detect.causes is arista.avd.defined or errdisable.recovery.causes is arista.avd.defined %}
17+
{% set combined_causes = ( errdisable.detect.causes | arista.avd.default([]) + errdisable.recovery.causes | arista.avd.default([]) ) | unique %}
3718

38-
{% if errdisable.recovery.interval is arista.avd.defined %}
39-
{% endif %}
40-
{% if errdisable.recovery.causes is defined %}
41-
| Detect Cause | Enabled | Interval |
42-
| ------------- | ------- | -------- |
43-
{% for cause in errdisable.recovery.causes | arista.avd.natural_sort %}
44-
{% if cause == 'arp-inspection' %}
45-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
46-
{% elif cause == 'bpduguard' %}
47-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
48-
{% elif cause == 'dot1x' %}
49-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
50-
{% elif cause == 'hitless-reload-down' %}
51-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
52-
{% elif cause == 'lacp-rate-limit' %}
53-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
54-
{% elif cause == 'link-flap' %}
55-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
56-
{% elif cause == 'no-internal-vlan' %}
57-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
58-
{% elif cause == 'portchannelguard' %}
59-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
60-
{% elif cause == 'portsec' %}
61-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
62-
{% elif cause == 'speed-misconfigured' %}
63-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
64-
{% elif cause == 'tapagg' %}
65-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
66-
{% elif cause == 'uplink-failure-detection' %}
67-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
68-
{% elif cause == 'xcvr-misconfigured' %}
69-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
70-
{% elif cause == 'xcvr-overheat' %}
71-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
72-
{% elif cause == 'xcvr-power-unsupported' %}
73-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
74-
{% elif cause == 'xcvr-unsupported' %}
75-
| {{ cause }} | True | {{ errdisable.recovery.interval }} |
76-
{% endif %}
77-
{% endfor %}
78-
{% endif %}
19+
| Cause | Detection Enabled | Recovery Enabled |
20+
| ------ | ----------------- | ---------------- |
21+
{% for cause in combined_causes | arista.avd.natural_sort %}
22+
{% if cause in errdisable.detect.causes | arista.avd.default([]) %}
23+
{% set detect_status = True %}
24+
{% else %}
25+
{% set detect_status = "-" %}
26+
{% endif %}
27+
{% if cause in errdisable.recovery.causes | arista.avd.default([]) %}
28+
{% set recovery_status = True %}
29+
{% else %}
30+
{% set recovery_status = "-" %}
31+
{% endif %}
32+
| {{ cause }} | {{ detect_status }} | {{ recovery_status }} |
33+
{% endfor %}
7934
{% endif %}
8035

8136
```eos

0 commit comments

Comments
 (0)