Sort all Ceph lists by numeric ID
This commit is contained in:
parent
2d507f8b42
commit
0fab7072ac
|
@ -336,7 +336,7 @@ def get_list_osd(zk_conn, limit, is_fuzzy=True):
|
||||||
else:
|
else:
|
||||||
osd_list.append(getOSDInformation(zk_conn, osd))
|
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):
|
def format_list_osd(osd_list):
|
||||||
osd_list_output = []
|
osd_list_output = []
|
||||||
|
@ -666,7 +666,7 @@ def get_list_pool(zk_conn, limit, is_fuzzy=True):
|
||||||
else:
|
else:
|
||||||
pool_list.append(getPoolInformation(zk_conn, pool))
|
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):
|
def format_list_pool(pool_list):
|
||||||
pool_list_output = []
|
pool_list_output = []
|
||||||
|
@ -1061,7 +1061,7 @@ def get_list_volume(zk_conn, pool, limit, is_fuzzy=True):
|
||||||
else:
|
else:
|
||||||
volume_list.append(getVolumeInformation(zk_conn, pool_name, volume_name))
|
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):
|
def format_list_volume(volume_list):
|
||||||
volume_list_output = []
|
volume_list_output = []
|
||||||
|
@ -1272,7 +1272,7 @@ def get_list_snapshot(zk_conn, pool, volume, limit, is_fuzzy=True):
|
||||||
else:
|
else:
|
||||||
snapshot_list.append({'pool': pool_name, 'volume': volume_name, 'snapshot': snapshot_name})
|
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):
|
def format_list_snapshot(snapshot_list):
|
||||||
snapshot_list_output = []
|
snapshot_list_output = []
|
||||||
|
|
Loading…
Reference in New Issue