netinfo.show() : Sort interface state.
The `tests/integration/vlan_test.py` will randomly fail regarding the ordering of interface state. It's caused by unsorted interface state list before comparing in `assertlib.assert_state()`. The fix would be sort interface state in `netinfo.show()`. Signed-off-by: Gris Ge <fge@redhat.com>
This commit is contained in:
parent
1055409c91
commit
f90e21ed73
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2018 Red Hat, Inc.
|
||||
# Copyright 2018-2019 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -15,6 +15,7 @@
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
from __future__ import absolute_import
|
||||
from operator import itemgetter
|
||||
|
||||
from libnmstate import nm
|
||||
from libnmstate import validator
|
||||
@ -78,6 +79,8 @@ def interfaces():
|
||||
|
||||
info.append(iface_info)
|
||||
|
||||
info.sort(key=itemgetter('name'))
|
||||
|
||||
return info
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user