tests, integ: fix unordered ports in _get_bridge_current_state()
When using _get_bridge_current_state() and comparing it using '==' then the comparison could fail due to unordered ports. In order to solve this, _get_bridge_current_state() is ordering the ports. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
This commit is contained in:
parent
f1ed2a7243
commit
282f987152
@ -154,7 +154,12 @@ def _modify_ports(ports_state):
|
||||
@nmclient_context
|
||||
def _get_bridge_current_state():
|
||||
nmdev = nm.device.get_device_by_name(BRIDGE0)
|
||||
return nm.bridge.get_info(nmdev) if nmdev else {}
|
||||
state = nm.bridge.get_info(nmdev) if nmdev else {}
|
||||
if state:
|
||||
slaves = state.get(LB.CONFIG_SUBTREE, {}).get(LB.PORT_SUBTREE, [])
|
||||
slaves.sort(key=lambda d: d[LB.Port.NAME])
|
||||
|
||||
return state
|
||||
|
||||
|
||||
@mainloop_run
|
||||
|
Loading…
x
Reference in New Issue
Block a user