From 05bfbb9a86e22f5842e7994ef8a3b9761a9100c3 Mon Sep 17 00:00:00 2001 From: Julien Fortin Date: Fri, 18 Nov 2016 17:14:13 +0100 Subject: [PATCH] ifupdown: iface: if auto %ifacename is not part of the first stanza we squash it Ticket: CM-12713 Reviewed By: Roopa, Nikhil G Testing Done: Test from the bug % for i in range(1,49): iface swp${i} mtu 9216 link-speed 10000 link-duplex full link-autoneg off % endfor auto swp1 iface swp1 % ifup -a -v # should only up swp1 Signed-off-by: Julien Fortin --- ifupdown/iface.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ifupdown/iface.py b/ifupdown/iface.py index ca78561..34a989e 100644 --- a/ifupdown/iface.py +++ b/ifupdown/iface.py @@ -585,6 +585,10 @@ class iface(): self.config.update([(attrname, attrlist)]) # we now support inet and inet6 together self.addr_family.extend(newifaceobj.addr_family) + # if auto %ifacename is not part of the first stanza + # we need to squash it + if not self.auto and newifaceobj.auto: + self.auto = True def __getstate__(self): odict = self.__dict__.copy()