diff options
| author | Zuul <zuul@review.opendev.org> | 2022-04-11 09:43:13 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2022-04-11 09:43:13 +0000 |
| commit | dabaec5a7b1b9786a8f91eebef738bf755faf059 (patch) | |
| tree | 4ffb2942e9ceb3e8c11226a9819dfb51deca663d /openstackclient/volume | |
| parent | 8f07476e53c8dd9ddeb4bd13f8e186c920eba1ee (diff) | |
| parent | 8acead32ee0a22b6e3339ae62cdb0a501e4134fd (diff) | |
| download | python-openstackclient-dabaec5a7b1b9786a8f91eebef738bf755faf059.tar.gz | |
Merge "volume: fix backup list of deleted volume"
Diffstat (limited to 'openstackclient/volume')
| -rw-r--r-- | openstackclient/volume/v2/volume_backup.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/openstackclient/volume/v2/volume_backup.py b/openstackclient/volume/v2/volume_backup.py index 96b22a68..f2d89dc7 100644 --- a/openstackclient/volume/v2/volume_backup.py +++ b/openstackclient/volume/v2/volume_backup.py @@ -310,9 +310,17 @@ class ListVolumeBackup(command.Lister): filter_volume_id = None if parsed_args.volume: - filter_volume_id = utils.find_resource( - volume_client.volumes, parsed_args.volume, - ).id + try: + filter_volume_id = utils.find_resource( + volume_client.volumes, parsed_args.volume, + ).id + except exceptions.CommandError: + # Volume with that ID does not exist, but search for backups + # for that volume nevertheless + LOG.debug("No volume with ID %s existing, continuing to " + "search for backups for that volume ID", + parsed_args.volume) + filter_volume_id = parsed_args.volume marker_backup_id = None if parsed_args.marker: |
