Ensure VF list is sorted

This commit is contained in:
Joshua Boniface 2021-06-21 17:11:48 -04:00
parent a697c2db2e
commit 33195c3c29
1 changed files with 2 additions and 1 deletions

View File

@ -641,7 +641,8 @@ def getSRIOVPFInformation(zkhandler, node, pf):
retcode, vf_list = get_list_sriov_vf(zkhandler, node, pf) retcode, vf_list = get_list_sriov_vf(zkhandler, node, pf)
if retcode: 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: else:
vfs = [] vfs = []