From 33195c3c2938b75c6a1e29a9a2d11c15ebec437c Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 21 Jun 2021 17:11:48 -0400 Subject: [PATCH] Ensure VF list is sorted --- daemon-common/network.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daemon-common/network.py b/daemon-common/network.py index d810d1dd..d895408d 100644 --- a/daemon-common/network.py +++ b/daemon-common/network.py @@ -641,7 +641,8 @@ def getSRIOVPFInformation(zkhandler, node, pf): retcode, vf_list = get_list_sriov_vf(zkhandler, node, pf) if retcode: - vfs = [vf['phy'] for vf in vf_list if vf['pf'] == pf] + unsorted_vfs = [vf['phy'] for vf in vf_list if vf['pf'] == pf] + vfs = sorted(unsorted_vfs, key=lambda k: int(''.join(re.findall(r'[0-9]', k)))) else: vfs = []