From 2722bb1972fa18443f35d5f83ce4cdd4329e3796 Mon Sep 17 00:00:00 2001 From: Sam Tannous Date: Tue, 17 Nov 2015 22:52:07 -0500 Subject: [PATCH] Revert "ifupdown not restoring mstpctl attributes (e.g. bpdufilter, bpduguard) in mstpctl" This reverts commit bbd11771f5571c67c8f110c2b464817ce31155b9. This introduced an error where if the config has old bridge driver and configures port attributes on the bridge, the attributes are reset to defaults after they are configured by the bridge settings. (cherry picked from commit 651d1980de02fb108975900ed007087d9a79934c) --- addons/mstpctl.py | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/addons/mstpctl.py b/addons/mstpctl.py index 52fcba1..aacfc96 100644 --- a/addons/mstpctl.py +++ b/addons/mstpctl.py @@ -257,16 +257,8 @@ class mstpctl(moduleBase): for attrname, dstattrname in self._attrs_map.items(): try: v = ifaceobj.get_attr_value_first(attrname) - if (not v and - self.get_mod_subattr(attrname,'default') and - (self.mstpctlcmd.get_bridge_attr(ifaceobj.name, dstattrname) != - self.get_mod_subattr(attrname,'default'))): - # this happens when customers remove an attribute - # and expect the default to be restored with ifreload. - v = get_mod_subattr(attrname,'default') - elif not v: - continue - + if not v: + continue if attrname == 'mstpctl-treeprio': self.mstpctlcmd.set_bridge_treeprio(ifaceobj.name, v, check) @@ -313,16 +305,8 @@ class mstpctl(moduleBase): # set bridge port attributes for attrname, dstattrname in self._port_attrs_map.items(): attrval = ifaceobj.get_attr_value_first(attrname) - if (not attrval and - self.get_mod_subattr(attrname,'default') and - (self.mstpctlcmd.get_bridgeport_attr(bridgename, ifaceobj.name,dstattrname) != - self.get_mod_subattr(attrname,'default'))): - # this happens when customers remove an attribute - # and expect the default to be restored with ifreload. - attrval = self.get_mod_subattr(attrname,'default') - elif not attrval: - continue - + if not attrval: + continue if not stp_running_on: # stp may get turned on at a later point self.logger.info('%s: ignoring %s config'