fabric: don’t set bond slaves if there are none

Not that that should happen except by mistake.
This commit is contained in:
Timotej Lazar 2024-03-05 12:46:26 +01:00
parent be0cc49b33
commit a97d133873

View file

@ -12,7 +12,9 @@ iface {{ iface.name }}
{% if iface.type.value == 'lag' %}
{#- Bond/MLAG stuff. #}
{% set members = interfaces | selectattr('lag') | selectattr('lag.name', '==', iface.name) %}
{% if members %}
bond-slaves {{ members | map(attribute='name') | join(' ') }}
{% endif %}
{% if iface.custom_fields.bond_mode %}
bond-mode {{ iface.custom_fields.bond_mode }}
{% endif %}