From 5d6c476824f47766d772edcbc3c98a9be07ebb72 Mon Sep 17 00:00:00 2001 From: Vibhu-gslab Date: Thu, 10 Oct 2024 12:15:22 +0530 Subject: [PATCH] Fix(eos_cli_config_gen): Fixing poe link down power-off action command in j2 template --- .../documentation/devices/ethernet-interfaces.md | 2 +- .../intended/configs/ethernet-interfaces.cfg | 2 +- .../j2templates/eos/ethernet-interfaces.j2 | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/ethernet-interfaces.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/ethernet-interfaces.md index dcd9ea3764e..001d0487ce8 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/ethernet-interfaces.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/ethernet-interfaces.md @@ -942,7 +942,7 @@ interface Ethernet56 switchport poe priority low poe reboot action power-off - poe link down action power-off 10 + poe link down action power-off 10 seconds poe shutdown action maintain poe limit 30.00 watts poe negotiation lldp disabled diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/ethernet-interfaces.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/ethernet-interfaces.cfg index 696229fa059..fb54bc7fa1b 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/ethernet-interfaces.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/ethernet-interfaces.cfg @@ -558,7 +558,7 @@ interface Ethernet56 switchport poe priority low poe reboot action power-off - poe link down action power-off 10 + poe link down action power-off 10 seconds poe shutdown action maintain poe limit 30.00 watts poe negotiation lldp disabled diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/ethernet-interfaces.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/ethernet-interfaces.j2 index 7f9ea7d510f..9a7e49e3324 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/ethernet-interfaces.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/ethernet-interfaces.j2 @@ -805,8 +805,8 @@ interface {{ ethernet_interface.name }} {% endif %} {% if ethernet_interface.poe.link_down.action is arista.avd.defined %} {% set poe_link_down_action_cli = 'poe link down action ' ~ ethernet_interface.poe.link_down.action %} -{% if ethernet_interface.poe.link_down.power_off_delay is arista.avd.defined %} -{% set poe_link_down_action_cli = poe_link_down_action_cli ~ ' ' ~ ethernet_interface.poe.link_down.power_off_delay %} +{% if ethernet_interface.poe.link_down.power_off_delay is arista.avd.defined and ethernet_interface.poe.link_down.action == 'power-off' %} +{% set poe_link_down_action_cli = poe_link_down_action_cli ~ ' ' ~ ethernet_interface.poe.link_down.power_off_delay ~ ' seconds' %} {% endif %} {{ poe_link_down_action_cli }} {% endif %}