Skip to content

Commit dabaec5

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "volume: fix backup list of deleted volume"
2 parents 8f07476 + 8acead3 commit dabaec5

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

openstackclient/volume/v2/volume_backup.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,17 @@ def take_action(self, parsed_args):
310310

311311
filter_volume_id = None
312312
if parsed_args.volume:
313-
filter_volume_id = utils.find_resource(
314-
volume_client.volumes, parsed_args.volume,
315-
).id
313+
try:
314+
filter_volume_id = utils.find_resource(
315+
volume_client.volumes, parsed_args.volume,
316+
).id
317+
except exceptions.CommandError:
318+
# Volume with that ID does not exist, but search for backups
319+
# for that volume nevertheless
320+
LOG.debug("No volume with ID %s existing, continuing to "
321+
"search for backups for that volume ID",
322+
parsed_args.volume)
323+
filter_volume_id = parsed_args.volume
316324

317325
marker_backup_id = None
318326
if parsed_args.marker:

0 commit comments

Comments
 (0)