Skip to content

Commit 2e82f34

Browse files
daniloegeaslyon
authored andcommitted
state_diff/get_diff(): return the interfaces sorted by their indices
1 parent 5f74208 commit 2e82f34

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

netplan_cli/cli/state_diff.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ def get_diff(self, interface: str = '') -> dict:
102102

103103
report['interfaces'].update(iface)
104104

105+
# Sort the list of interfaces according to their indices.
106+
report['interfaces'] = dict(sorted(report['interfaces'].items(), key=lambda iface: iface[1].get('index')))
105107
return report
106108

107109
def _create_new_report(self) -> dict:

0 commit comments

Comments
 (0)