From 7eccd403c711026b8cd596326baa8337114b6c9c Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 19 May 2024 22:17:06 +0200 Subject: [PATCH] Show Created At column for volume backups The ``volume backup list`` command does not show the created_at column for backups which doesn't really help the end-user since a critical part of a backup is knowing when it was taken, and fast if there is a rush doing recovery by restoring a volume from a backup. Change-Id: I8d8a7f36c468c9faa2c2c47bfa9ba9e1ca5b9858 --- .../notes/volume-backup-created-at-list-b49ec893ae1f6b0d.yaml | 4 ++++ openstackclient/tests/unit/volume/v2/test_volume_backup.py | 3 +++ openstackclient/volume/v2/volume_backup.py | 2 ++ 3 files changed, 9 insertions(+) create mode 100644 openstackclient/releasenotes/notes/volume-backup-created-at-list-b49ec893ae1f6b0d.yaml diff --git a/openstackclient/releasenotes/notes/volume-backup-created-at-list-b49ec893ae1f6b0d.yaml b/openstackclient/releasenotes/notes/volume-backup-created-at-list-b49ec893ae1f6b0d.yaml new file mode 100644 index 0000000000..974d88ed9c --- /dev/null +++ b/openstackclient/releasenotes/notes/volume-backup-created-at-list-b49ec893ae1f6b0d.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Listing volume backups now shows the created_at column. diff --git a/openstackclient/tests/unit/volume/v2/test_volume_backup.py b/openstackclient/tests/unit/volume/v2/test_volume_backup.py index aa0c050cdc..94f07a8612 100644 --- a/openstackclient/tests/unit/volume/v2/test_volume_backup.py +++ b/openstackclient/tests/unit/volume/v2/test_volume_backup.py @@ -359,6 +359,7 @@ class TestBackupList(TestBackup): 'Status', 'Size', 'Incremental', + 'Created At', ) columns_long = columns + ( 'Availability Zone', @@ -376,6 +377,7 @@ class TestBackupList(TestBackup): b.status, b.size, b.is_incremental, + b.created_at, ) ) data_long = [] @@ -388,6 +390,7 @@ class TestBackupList(TestBackup): b.status, b.size, b.is_incremental, + b.created_at, b.availability_zone, volume_backup.VolumeIdColumn(b.volume_id), b.container, diff --git a/openstackclient/volume/v2/volume_backup.py b/openstackclient/volume/v2/volume_backup.py index 7eed05a1db..4e58e54b23 100644 --- a/openstackclient/volume/v2/volume_backup.py +++ b/openstackclient/volume/v2/volume_backup.py @@ -305,6 +305,7 @@ class ListVolumeBackup(command.Lister): 'status', 'size', 'is_incremental', + 'created_at', ) column_headers = ( 'ID', @@ -313,6 +314,7 @@ class ListVolumeBackup(command.Lister): 'Status', 'Size', 'Incremental', + 'Created At', ) if parsed_args.long: columns += ('availability_zone', 'volume_id', 'container')