From 45c264cd8d2d1155ef561850c84095504ea375b0 Mon Sep 17 00:00:00 2001 From: Sam Tannous Date: Thu, 7 Jul 2016 17:16:22 -0700 Subject: [PATCH] ifupdown2 defaults for link attributes are not applied Ticket: CM-11718 Reviewed By: CCR-4931 Testing Done: Tested complete regression suite on hardnode in 3.0. This patch fixes a problem in the ethtool addon module where a single iface stanza was configured for a link-speed (1G) other then the default (10G). The link-speed config is then removed or commented out but the link-speed is not restored to its default value (10G) because of incorrect logic. --- addons/ethtool.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/ethtool.py b/addons/ethtool.py index 948c91e..d8a95f0 100644 --- a/addons/ethtool.py +++ b/addons/ethtool.py @@ -93,11 +93,12 @@ class ethtool(moduleBase,utilsBase): (ifaceobj.name in self.ifaceobjs_modified_configs)): continue - # if we are not the oldest and we have no configs, do not change anything - # the only way a non-oldest sibling would change values is if it - # had configured settings - if (not ((ifaceobj.flags & iface.HAS_SIBLINGS) and - (ifaceobj.flags & iface.OLDEST_SIBLING)) and + # If we have siblings AND are not the oldest AND we have no configs, + # do not change anything. The only way a non-oldest sibling would + # change values is if it had configured settings. iface stanzas may + # not be squashed if addr_config_squash is not set so we still need this. + if ((ifaceobj.flags & iface.HAS_SIBLINGS) and + not (ifaceobj.flags & iface.OLDEST_SIBLING) and not config_val): continue