Sort all Ceph lists by numeric ID

This commit is contained in:
Joshua Boniface 2020-05-29 13:31:18 -04:00
parent 2d507f8b42
commit 0fab7072ac
1 changed files with 4 additions and 4 deletions

View File

@ -336,7 +336,7 @@ def get_list_osd(zk_conn, limit, is_fuzzy=True):
else:
osd_list.append(getOSDInformation(zk_conn, osd))
return True, osd_list
return True, sorted(osd_list, key = lambda x: int(x['id']))
def format_list_osd(osd_list):
osd_list_output = []
@ -666,7 +666,7 @@ def get_list_pool(zk_conn, limit, is_fuzzy=True):
else:
pool_list.append(getPoolInformation(zk_conn, pool))
return True, pool_list
return True, sorted(pool_list, key = lambda x: int(x['id']))
def format_list_pool(pool_list):
pool_list_output = []
@ -1061,7 +1061,7 @@ def get_list_volume(zk_conn, pool, limit, is_fuzzy=True):
else:
volume_list.append(getVolumeInformation(zk_conn, pool_name, volume_name))
return True, volume_list
return True, sorted(volume_list, key = lambda x: int(x['id']))
def format_list_volume(volume_list):
volume_list_output = []
@ -1272,7 +1272,7 @@ def get_list_snapshot(zk_conn, pool, volume, limit, is_fuzzy=True):
else:
snapshot_list.append({'pool': pool_name, 'volume': volume_name, 'snapshot': snapshot_name})
return True, snapshot_list
return True, sorted(snapshot_list, key = lambda x: int(x['id']))
def format_list_snapshot(snapshot_list):
snapshot_list_output = []