mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
Merge branch 'dev' into release/cl-stable
This commit is contained in:
@@ -263,19 +263,20 @@ class address(moduleBase):
|
|||||||
mtu = ifaceobj.get_attr_value_first('mtu')
|
mtu = ifaceobj.get_attr_value_first('mtu')
|
||||||
if mtu:
|
if mtu:
|
||||||
self.ipcmd.link_set(ifaceobj.name, 'mtu', mtu)
|
self.ipcmd.link_set(ifaceobj.name, 'mtu', mtu)
|
||||||
|
elif (not ifaceobj.link_kind and
|
||||||
# logical devices like bridges and vlan devices rely on mtu
|
not (ifaceobj.link_privflags & ifaceLinkPrivFlags.BOND_SLAVE) and
|
||||||
# from their lower devices. ie mtu travels from
|
self.default_mtu):
|
||||||
# lower devices to upper devices. For bonds mtu travels from
|
# logical devices like bridges and vlan devices rely on mtu
|
||||||
# upper to lower devices. running mtu depends on upper and
|
# from their lower devices. ie mtu travels from
|
||||||
# lower device mtu. With all this implicit mtu
|
# lower devices to upper devices. For bonds mtu travels from
|
||||||
# config by the kernel in play, it becomes almost impossible
|
# upper to lower devices. running mtu depends on upper and
|
||||||
# to decide if the running mtu is valid. It will require
|
# lower device mtu. With all this implicit mtu
|
||||||
# some more thinking. Commenting this for now.
|
# config by the kernel in play, we try to be cautious here
|
||||||
#elif self.default_mtu:
|
# on which devices we want to reset mtu to default.
|
||||||
# running_mtu = self.ipcmd.link_get_mtu(ifaceobj.name)
|
# essentially only physical interfaces which are not bond slaves
|
||||||
# if running_mtu != self.default_mtu:
|
running_mtu = self.ipcmd.link_get_mtu(ifaceobj.name)
|
||||||
# self.ipcmd.link_set(ifaceobj.name, 'mtu', self.default_mtu)
|
if running_mtu != self.default_mtu:
|
||||||
|
self.ipcmd.link_set(ifaceobj.name, 'mtu', self.default_mtu)
|
||||||
|
|
||||||
alias = ifaceobj.get_attr_value_first('alias')
|
alias = ifaceobj.get_attr_value_first('alias')
|
||||||
if alias:
|
if alias:
|
||||||
@@ -334,7 +335,8 @@ class address(moduleBase):
|
|||||||
else:
|
else:
|
||||||
self.ipcmd.del_addr_all(ifaceobj.name)
|
self.ipcmd.del_addr_all(ifaceobj.name)
|
||||||
mtu = ifaceobj.get_attr_value_first('mtu')
|
mtu = ifaceobj.get_attr_value_first('mtu')
|
||||||
if (mtu and self.default_mtu and (mtu != self.default_mtu)):
|
if (not ifaceobj.link_kind and mtu and
|
||||||
|
self.default_mtu and (mtu != self.default_mtu)):
|
||||||
self.ipcmd.link_set(ifaceobj.name, 'mtu', self.default_mtu)
|
self.ipcmd.link_set(ifaceobj.name, 'mtu', self.default_mtu)
|
||||||
alias = ifaceobj.get_attr_value_first('alias')
|
alias = ifaceobj.get_attr_value_first('alias')
|
||||||
if alias:
|
if alias:
|
||||||
|
|||||||
@@ -459,10 +459,10 @@ class mstpctl(moduleBase):
|
|||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
self.ipcmd.batch_commit()
|
self.ipcmd.batch_commit()
|
||||||
running_ports = self.brctlcmd.get_bridge_ports(ifaceobj.name)
|
running_ports = self.brctlcmd.get_bridge_ports(ifaceobj.name)
|
||||||
if running_ports:
|
if running_ports:
|
||||||
# disable ipv6 for ports that were added to bridge
|
# disable ipv6 for ports that were added to bridge
|
||||||
self._ports_enable_disable_ipv6(running_ports, '1')
|
self._ports_enable_disable_ipv6(running_ports, '1')
|
||||||
|
|
||||||
stp = ifaceobj.get_attr_value_first('mstpctl-stp')
|
stp = ifaceobj.get_attr_value_first('mstpctl-stp')
|
||||||
if stp:
|
if stp:
|
||||||
|
|||||||
@@ -687,17 +687,24 @@ class vrf(moduleBase):
|
|||||||
if vrf_table == 'auto':
|
if vrf_table == 'auto':
|
||||||
vrf_table = self._get_iproute2_vrf_table(ifaceobj.name)
|
vrf_table = self._get_iproute2_vrf_table(ifaceobj.name)
|
||||||
|
|
||||||
try:
|
running_slaves = self.ipcmd.link_get_lowers(ifaceobj.name)
|
||||||
running_slaves = self.ipcmd.link_get_lowers(ifaceobj.name)
|
if running_slaves:
|
||||||
if running_slaves:
|
for s in running_slaves:
|
||||||
for s in running_slaves:
|
if ifaceobj_getfunc:
|
||||||
if ifaceobj_getfunc:
|
sobj = ifaceobj_getfunc(s)
|
||||||
sobj = ifaceobj_getfunc(s)
|
try:
|
||||||
self._handle_existing_connections(sobj[0] if sobj else None,
|
self._handle_existing_connections(sobj[0]
|
||||||
|
if sobj else None,
|
||||||
ifaceobj.name)
|
ifaceobj.name)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
self.logger.info('%s: %s' %(ifaceobj.name, str(e)))
|
self.logger.info('%s: %s' %(ifaceobj.name, str(e)))
|
||||||
pass
|
pass
|
||||||
|
try:
|
||||||
|
self.ipcmd.addr_flush(s)
|
||||||
|
rtnetlink_api.rtnl_api.link_set(s, "down")
|
||||||
|
except Exception, e:
|
||||||
|
self.logger.info('%s: %s' %(ifaceobj.name, str(e)))
|
||||||
|
pass
|
||||||
|
|
||||||
self._down_vrf_helper(ifaceobj, vrf_table)
|
self._down_vrf_helper(ifaceobj, vrf_table)
|
||||||
|
|
||||||
|
|||||||
@@ -386,8 +386,9 @@ class ifupdownMain(ifupdownBase):
|
|||||||
The following are currently considered builtin ifaces:
|
The following are currently considered builtin ifaces:
|
||||||
- vlan interfaces in the format <ifacename>.<vlanid>
|
- vlan interfaces in the format <ifacename>.<vlanid>
|
||||||
"""
|
"""
|
||||||
|
if (ifaceobj.priv_flags and ifaceobj.priv_flags.BUILTIN):
|
||||||
return (ifaceobj.priv_flags and ifaceobj.priv_flags.BUILTIN)
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def is_ifaceobj_noconfig(self, ifaceobj):
|
def is_ifaceobj_noconfig(self, ifaceobj):
|
||||||
""" Returns true if iface object did not have a user defined config.
|
""" Returns true if iface object did not have a user defined config.
|
||||||
@@ -730,9 +731,9 @@ class ifupdownMain(ifupdownBase):
|
|||||||
if a.get('deprecated'):
|
if a.get('deprecated'):
|
||||||
newa = a.get('new-attribute')
|
newa = a.get('new-attribute')
|
||||||
if newa:
|
if newa:
|
||||||
self.logger.warn('attribute %s is deprecated. Use %s instead' %(attrname, newa))
|
self.logger.warn('attribute %s is deprecated. use %s instead.' %(attrname, newa))
|
||||||
else:
|
else:
|
||||||
self.logger.warn('attribute %s is deprecated'
|
self.logger.warn('attribute %s is deprecated.'
|
||||||
%attrname)
|
%attrname)
|
||||||
return True
|
return True
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
@@ -1498,9 +1499,9 @@ class ifupdownMain(ifupdownBase):
|
|||||||
# and just print a warning
|
# and just print a warning
|
||||||
if (self.is_ifaceobj_noconfig(newifaceobjlist[0]) and
|
if (self.is_ifaceobj_noconfig(newifaceobjlist[0]) and
|
||||||
not self.is_ifaceobj_builtin(newifaceobjlist[0]) and
|
not self.is_ifaceobj_builtin(newifaceobjlist[0]) and
|
||||||
lastifaceobjlist[0].is_config_present()):
|
lastifaceobjlist[0].is_config_present() and
|
||||||
self.logger.warn('%s: misconfig ? removed but still exists as a dependency of %s' %(newifaceobjlist[objidx].name,
|
lastifaceobjlist[0].link_kind):
|
||||||
str(newifaceobjlist[objidx].upperifaces)))
|
self.logger.warn('%s: misconfig ? removed but still exists as a dependency of %s' %(newifaceobjlist[objidx].name, str(newifaceobjlist[objidx].upperifaces)))
|
||||||
if not down_changed:
|
if not down_changed:
|
||||||
continue
|
continue
|
||||||
if len(newifaceobjlist) != len(lastifaceobjlist):
|
if len(newifaceobjlist) != len(lastifaceobjlist):
|
||||||
|
|||||||
Reference in New Issue
Block a user