diff options
| author | Eric Harney <eharney@redhat.com> | 2016-01-07 16:20:57 -0500 |
|---|---|---|
| committer | Eric Harney <eharney@redhat.com> | 2016-02-24 16:31:32 +0000 |
| commit | ccacc338a5af0d960b0db282b13a596eb44f5c2d (patch) | |
| tree | 8156441e080373fd3b7c25bd4bce3306919afa07 /cinderclient/v2/shell.py | |
| parent | 8d1d4097002c4555f591faab7a6fb9eddaced205 (diff) | |
| download | python-cinderclient-ccacc338a5af0d960b0db282b13a596eb44f5c2d.tar.gz | |
Add --cascade to volume delete
This adds the --cascade parameter to the volume
delete command. Using this will call the volume delete
with an additional parameter that deletes snapshots as
part of the same operation.
The name "cascade" is chosen to be somewhat generic,
so that we can extend this if desired in the future.
(And to hint at the terminology from SQL.)
Depends-On: I33d15b76d4bd0de14c635d404b2c97096c977a58
Change-Id: I05ce61e647c43f9a1e6d74444356a76e5d284673
Blueprint: del-vols-with-snaps
Diffstat (limited to 'cinderclient/v2/shell.py')
| -rw-r--r-- | cinderclient/v2/shell.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cinderclient/v2/shell.py b/cinderclient/v2/shell.py index 143d199..c9a54f2 100644 --- a/cinderclient/v2/shell.py +++ b/cinderclient/v2/shell.py @@ -445,6 +445,12 @@ def do_create(cs, args): utils.print_dict(info) +@utils.arg('--cascade', + metavar='<cascade>', + default=False, + const=True, + nargs='?', + help='Remove any snapshots along with volume. Default=False.') @utils.arg('volume', metavar='<volume>', nargs='+', help='Name or ID of volume or volumes to delete.') @@ -454,7 +460,7 @@ def do_delete(cs, args): failure_count = 0 for volume in args.volume: try: - utils.find_volume(cs, volume).delete() + utils.find_volume(cs, volume).delete(cascade=args.cascade) print("Request to delete volume %s has been accepted." % (volume)) except Exception as e: failure_count += 1 |
