]> git.proxmox.com Git - ifupdown2.git/blame - debian/patches/pve/0008-lacp-bond-remove-bond-min-links-0-warning.patch
fix patch 0008-lacp: replace else with if condition
[ifupdown2.git] / debian / patches / pve / 0008-lacp-bond-remove-bond-min-links-0-warning.patch
CommitLineData
911804b5 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f9fec016
AD
2From: Alexandre Derumier <aderumier@odiso.com>
3Date: Tue, 16 May 2023 00:33:36 +0200
4Subject: [PATCH] lacp bond: remove bond-min-links=0 warning
5
6This is only cumulus specific
7
8Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
911804b5
ML
9[ML: fixed condition of the remaining `else` branch]
10Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
f9fec016 11---
911804b5
ML
12 ifupdown2/addons/bond.py | 9 +--------
13 1 file changed, 1 insertion(+), 8 deletions(-)
f9fec016
AD
14
15diff --git a/ifupdown2/addons/bond.py b/ifupdown2/addons/bond.py
911804b5 16index 74d2cab..e18fcbc 100644
f9fec016
AD
17--- a/ifupdown2/addons/bond.py
18+++ b/ifupdown2/addons/bond.py
911804b5 19@@ -610,14 +610,7 @@ class bond(Addon, moduleBase):
f9fec016
AD
20 # if we need to reset the mode to system default
21 ifla_info_data[Link.IFLA_BOND_MODE] = ifla_bond_mode
22
23- if ifla_bond_mode == 4: # 802.3ad
24- min_links = ifla_info_data.get(Link.IFLA_BOND_MIN_LINKS)
25- if min_links is None:
26- min_links = self.cache.get_link_info_data_attribute(ifname, Link.IFLA_BOND_MIN_LINKS)
27- # get_min_links_nl may return None so we need to strictly check 0
28- if min_links == 0:
29- self.logger.warning('%s: attribute bond-min-links is set to \'0\'' % ifname)
911804b5
ML
30- else:
31+ if ifla_bond_mode != 4:
f9fec016
AD
32 # IFLA_BOND_AD_LACP_RATE and IFLA_BOND_AD_LACP_BYPASS only for 802.3ad mode (4)
33 for nl_attr, attr_name in self._bond_lacp_attrs:
911804b5 34 if nl_attr in ifla_info_data: