diff options
| author | Huanxuan Ao <huanxuan.ao@easystack.cn> | 2016-07-06 16:54:13 +0800 |
|---|---|---|
| committer | Huanxuan Ao <huanxuan.ao@easystack.cn> | 2016-07-06 20:46:31 +0800 |
| commit | 3222ffc157b6e686249fb2e3d4375c89384bfb97 (patch) | |
| tree | 60ebbd508ff6d2dd6457f6dc9e4ac68b3b7cee8e /openstackclient/volume | |
| parent | 4ce7dd53e8bbd70a97a667c7b39078d73495ec1f (diff) | |
| download | python-openstackclient-3222ffc157b6e686249fb2e3d4375c89384bfb97.tar.gz | |
Add "--property" option to "snapshot create" command in volumev2
Add "--property" option to "snapshot create" command
in volumev2 (v2 only) to support adding properties to
a new snapshot.
Change-Id: Ie0e90c9ccc2ac89b3b7b0ac89751fd864aada9a4
Closes-Bug: #1597192
Diffstat (limited to 'openstackclient/volume')
| -rw-r--r-- | openstackclient/volume/v2/snapshot.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/openstackclient/volume/v2/snapshot.py b/openstackclient/volume/v2/snapshot.py index 5aba04ae..5e6949d4 100644 --- a/openstackclient/volume/v2/snapshot.py +++ b/openstackclient/volume/v2/snapshot.py @@ -51,6 +51,13 @@ class CreateSnapshot(command.ShowOne): help=_("Create a snapshot attached to an instance. " "Default is False") ) + parser.add_argument( + "--property", + metavar="<key=value>", + action=parseractions.KeyValueAction, + help=_("Set a property to this snapshot " + "(repeat option to set multiple properties)"), + ) return parser def take_action(self, parsed_args): @@ -61,7 +68,8 @@ class CreateSnapshot(command.ShowOne): volume_id, force=parsed_args.force, name=parsed_args.name, - description=parsed_args.description + description=parsed_args.description, + metadata=parsed_args.property, ) snapshot._info.update( {'properties': utils.format_dict(snapshot._info.pop('metadata'))} |
