From 9ee5ae4826c239c8674370239394ca84d5eb9a50 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 29 May 2020 13:43:44 -0400 Subject: [PATCH] Volume and Snapshot are not sorted by ID --- client-cli/cli_lib/ceph.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client-cli/cli_lib/ceph.py b/client-cli/cli_lib/ceph.py index 4bb8494c..f6e6088f 100644 --- a/client-cli/cli_lib/ceph.py +++ b/client-cli/cli_lib/ceph.py @@ -1043,7 +1043,7 @@ def format_list_volume(volume_list): ) ) - for volume_information in sorted(volume_list, key = lambda x: int(x['id'])): + for volume_information in volume_list: volume_list_output.append('{bold}\ {volume_name: <{volume_name_length}} \ {volume_pool: <{volume_pool_length}} \ @@ -1072,7 +1072,7 @@ def format_list_volume(volume_list): ) ) - return '\n'.join(volume_list_output) + return '\n'.join(sorted(volume_list_output)) # @@ -1228,7 +1228,7 @@ def format_list_snapshot(snapshot_list): ) ) - for snapshot_information in sorted(snapshot_list, key = lambda x: int(x['id'])): + for snapshot_information in snapshot_list: snapshot_name = snapshot_information['snapshot'] snapshot_volume = snapshot_information['volume'] snapshot_pool = snapshot_information['pool'] @@ -1248,4 +1248,4 @@ def format_list_snapshot(snapshot_list): ) ) - return '\n'.join(snapshot_list_output) + return '\n'.join(sorted(snapshot_list_output))