summaryrefslogtreecommitdiff
path: root/openstackclient/volume
diff options
context:
space:
mode:
authorHuanxuan Ao <huanxuan.ao@easystack.cn>2016-06-27 16:59:51 +0800
committerHuanxuan Ao <huanxuan.ao@easystack.cn>2016-06-27 16:59:51 +0800
commitfc719f998ce5f826d42f49aecf4f437e6d07857a (patch)
tree6885cc6194dba61685847c49fa9526469bb621d8 /openstackclient/volume
parent21ac9230e80202b9a736960ace369f0a20af837f (diff)
downloadpython-openstackclient-fc719f998ce5f826d42f49aecf4f437e6d07857a.tar.gz
Add "--force" option to "backup create" command in volumev2
Cinder V2 API supports creating volume backup with "--force" option. However, OSC doesn't support this argument. So this patch add the "--force" option to allow users to back up a in-use volume. Change-Id: I326f8d6172b2830da4cf1317348af50142cc5490 Closes-Bug: #1596443
Diffstat (limited to 'openstackclient/volume')
-rw-r--r--openstackclient/volume/v2/backup.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/openstackclient/volume/v2/backup.py b/openstackclient/volume/v2/backup.py
index 6a44e30c..e83fb136 100644
--- a/openstackclient/volume/v2/backup.py
+++ b/openstackclient/volume/v2/backup.py
@@ -48,6 +48,12 @@ class CreateBackup(command.ShowOne):
metavar="<container>",
help=_("Optional backup container name")
)
+ parser.add_argument(
+ '--force',
+ action='store_true',
+ default=False,
+ help=_("Allow to back up an in-use volume")
+ )
return parser
def take_action(self, parsed_args):
@@ -58,7 +64,8 @@ class CreateBackup(command.ShowOne):
volume_id,
container=parsed_args.container,
name=parsed_args.name,
- description=parsed_args.description
+ description=parsed_args.description,
+ force=parsed_args.force,
)
backup._info.pop("links", None)
return zip(*sorted(six.iteritems(backup._info)))