Merge "Fix volume backup show by name"

This commit is contained in:
Zuul 2024-12-17 19:09:39 +00:00 committed by Gerrit Code Review
commit a631014551
5 changed files with 11 additions and 6 deletions

View File

@ -544,7 +544,7 @@ class TestBackupShow(volume_fakes.TestVolume):
def setUp(self):
super().setUp()
self.volume_sdk_client.get_backup.return_value = self.backup
self.volume_sdk_client.find_backup.return_value = self.backup
# Get the command object to test
self.cmd = volume_backup.ShowVolumeBackup(self.app, None)
@ -554,7 +554,7 @@ class TestBackupShow(volume_fakes.TestVolume):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
self.volume_sdk_client.get_backup.assert_called_with(self.backup.id)
self.volume_sdk_client.find_backup.assert_called_with(self.backup.id)
self.assertEqual(self.columns, columns)
self.assertEqual(self.data, data)

View File

@ -879,7 +879,7 @@ class TestBackupShow(volume_fakes.TestVolume):
def setUp(self):
super().setUp()
self.volume_sdk_client.get_backup.return_value = self.backup
self.volume_sdk_client.find_backup.return_value = self.backup
# Get the command object to test
self.cmd = volume_backup.ShowVolumeBackup(self.app, None)
@ -889,7 +889,7 @@ class TestBackupShow(volume_fakes.TestVolume):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
self.volume_sdk_client.get_backup.assert_called_with(self.backup.id)
self.volume_sdk_client.find_backup.assert_called_with(self.backup.id)
self.assertEqual(self.columns, columns)
self.assertEqual(self.data, data)

View File

@ -439,7 +439,7 @@ class ShowVolumeBackup(command.ShowOne):
def take_action(self, parsed_args):
volume_client = self.app.client_manager.sdk_connection.volume
backup = volume_client.get_backup(parsed_args.backup)
backup = volume_client.find_backup(parsed_args.backup)
columns = (
"availability_zone",
"container",

View File

@ -645,7 +645,7 @@ class ShowVolumeBackup(command.ShowOne):
def take_action(self, parsed_args):
volume_client = self.app.client_manager.sdk_connection.volume
backup = volume_client.get_backup(parsed_args.backup)
backup = volume_client.find_backup(parsed_args.backup)
columns = (
"availability_zone",
"container",

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixed the ``openstack volume backup show`` command
to show a backup by name.