diff --git a/upstream/openstack/python-openstackclient/debian/patches/0003-Fix-output-for-openstack-volume-backup-restore.patch b/upstream/openstack/python-openstackclient/debian/patches/0003-Fix-output-for-openstack-volume-backup-restore.patch new file mode 100644 index 00000000..07dfbeec --- /dev/null +++ b/upstream/openstack/python-openstackclient/debian/patches/0003-Fix-output-for-openstack-volume-backup-restore.patch @@ -0,0 +1,51 @@ +From a3591cdd38b46cc360bbd579c02a0a82224d91f1 Mon Sep 17 00:00:00 2001 +From: Lucas de Ataides +Date: Wed, 29 Nov 2023 17:12:09 -0300 +Subject: [PATCH] Fix output for "openstack volume backup restore" + +Previously, on Openstack Pike, an issue [1] was reported that the +`openstack volume backup restore` command was not able to parse the +output correctly, even though the restore operation succeeds. This was +fixed by [2], for the Stein release (and cherry-picked to both Rocky and +Queens). The issue was that cliff expects a list with two tuples to +display the results, whereas the restore function was returning a +VolumeBackupsRestore object. The solution was to use the `_info` field +from the VolumeBackupsRetore object, instead of the whole object. + +This was done not only for the VolumeBackupsRetore object, but also for +the VolumeBackup one, as can be seen on [3] and [4]. However, the commit +[5] removed this essential parsing, and caused the previously fixed +issue to reappear. + +[1] https://bugs.launchpad.net/python-openstackclient/+bug/1733315 +[2] https://review.opendev.org/c/openstack/python-openstackclient/+/624860 +[3] https://opendev.org/openstack/python-openstackclient/src/branch/stable/2023.1/openstackclient/volume/v2/volume_backup.py#L174 +[4] https://opendev.org/openstack/python-openstackclient/src/branch/stable/2023.1/openstackclient/volume/v2/volume_backup.py#L619 +[5] https://review.opendev.org/c/openstack/python-openstackclient/+/353931 + +Signed-off-by: Lucas de Ataides +--- + openstackclient/volume/v2/volume_backup.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/openstackclient/volume/v2/volume_backup.py b/openstackclient/volume/v2/volume_backup.py +index eac6167d..c1bb0b2c 100644 +--- a/openstackclient/volume/v2/volume_backup.py ++++ b/openstackclient/volume/v2/volume_backup.py +@@ -410,9 +410,12 @@ class RestoreVolumeBackup(command.ShowOne): + ) % parsed_args.volume + raise exceptions.CommandError(msg) + +- return volume_client.restores.restore( ++ backup_restore = volume_client.restores.restore( + backup.id, volume_id, volume_name, + ) ++ return zip(*sorted(backup_restore._info.items())) ++ ++ + + + class SetVolumeBackup(command.Command): +-- +2.25.1 + diff --git a/upstream/openstack/python-openstackclient/debian/patches/series b/upstream/openstack/python-openstackclient/debian/patches/series index 49726339..da074ce4 100644 --- a/upstream/openstack/python-openstackclient/debian/patches/series +++ b/upstream/openstack/python-openstackclient/debian/patches/series @@ -1,2 +1,3 @@ 0001-Add-plugin-entry-point-sorting-mechanism.patch 0002-Add-location-parameter-for-volume-backup-creation.patch +0003-Fix-output-for-openstack-volume-backup-restore.patch