1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

addons: ifquery: re-ordering bridge-ports and bond-slaves interfaces

Ticket: CM-11953
Reviewed By: Roopa, Nikhil G
Testing Done: ifupdown2-tests and ifupdown2 smokes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin
2016-11-22 11:36:04 +01:00
parent abd9194b6e
commit 18700e2676
2 changed files with 12 additions and 0 deletions

View File

@@ -366,6 +366,12 @@ class bond(moduleBase):
# globs, for now, we won't try to change it.
if 'regex' in slaves or 'glob' in slaves:
slaves = runningslaves
else:
ordered = []
for i in range(0, len(slaves)):
if slaves[i] in runningslaves:
ordered.append(slaves[i])
slaves = ordered
ifaceobjcurr.update_config_with_status('bond-slaves',
' '.join(slaves)
if slaves else 'None', retslave)

View File

@@ -1642,6 +1642,12 @@ class bridge(moduleBase):
# globs, for now, we won't try to change it.
if 'regex' in port_list or 'glob' in port_list:
port_list = running_port_list
else:
ordered = []
for i in range(0, len(port_list)):
if port_list[i] in running_port_list:
ordered.append(port_list[i])
port_list = ordered
except:
port_list = running_port_list
ifaceobjcurr.update_config_with_status('bridge-ports',