summaryrefslogtreecommitdiff
path: root/openstackclient/volume/v1/snapshot.py
diff options
context:
space:
mode:
authorSheel Rana <ranasheel2000@gmail.com>2016-05-23 22:26:24 +0530
committerSheel Rana <ranasheel2000@gmail.com>2016-05-23 18:04:36 +0000
commit53e05e7c2d36ab2ff1ba05a8334286d41c5f40e4 (patch)
tree658edbf0d29fc44f2939041ac7256802be92e184 /openstackclient/volume/v1/snapshot.py
parent17bc850440045128871c381244540eeedaa569a7 (diff)
downloadpython-openstackclient-53e05e7c2d36ab2ff1ba05a8334286d41c5f40e4.tar.gz
i18n support for help and error messages in cinder
Change-Id: I98fbc959034fe0530966291643b381855801de20
Diffstat (limited to 'openstackclient/volume/v1/snapshot.py')
-rw-r--r--openstackclient/volume/v1/snapshot.py42
1 files changed, 24 insertions, 18 deletions
diff --git a/openstackclient/volume/v1/snapshot.py b/openstackclient/volume/v1/snapshot.py
index 6c6131ea..bf5bf264 100644
--- a/openstackclient/volume/v1/snapshot.py
+++ b/openstackclient/volume/v1/snapshot.py
@@ -21,6 +21,7 @@ import six
from openstackclient.common import command
from openstackclient.common import parseractions
from openstackclient.common import utils
+from openstackclient.i18n import _
class CreateSnapshot(command.ShowOne):
@@ -31,24 +32,25 @@ class CreateSnapshot(command.ShowOne):
parser.add_argument(
'volume',
metavar='<volume>',
- help='Volume to snapshot (name or ID)',
+ help=_('Volume to snapshot (name or ID)'),
)
parser.add_argument(
'--name',
metavar='<name>',
- help='Name of the snapshot',
+ help=_('Name of the snapshot'),
)
parser.add_argument(
'--description',
metavar='<description>',
- help='Description of the snapshot',
+ help=_('Description of the snapshot'),
)
parser.add_argument(
'--force',
dest='force',
action='store_true',
default=False,
- help='Create a snapshot attached to an instance. Default is False',
+ help=_('Create a snapshot attached to an instance. '
+ 'Default is False'),
)
return parser
@@ -79,7 +81,7 @@ class DeleteSnapshot(command.Command):
'snapshots',
metavar='<snapshot>',
nargs="+",
- help='Snapshot(s) to delete (name or ID)',
+ help=_('Snapshot(s) to delete (name or ID)'),
)
return parser
@@ -100,13 +102,13 @@ class ListSnapshot(command.Lister):
'--all-projects',
action='store_true',
default=False,
- help='Include all projects (admin only)',
+ help=_('Include all projects (admin only)'),
)
parser.add_argument(
'--long',
action='store_true',
default=False,
- help='List additional fields in output',
+ help=_('List additional fields in output'),
)
return parser
@@ -170,21 +172,24 @@ class SetSnapshot(command.Command):
parser.add_argument(
'snapshot',
metavar='<snapshot>',
- help='Snapshot to modify (name or ID)')
+ help=_('Snapshot to modify (name or ID)')
+ )
parser.add_argument(
'--name',
metavar='<name>',
- help='New snapshot name')
+ help=_('New snapshot name')
+ )
parser.add_argument(
'--description',
metavar='<description>',
- help='New snapshot description')
+ help=_('New snapshot description')
+ )
parser.add_argument(
'--property',
metavar='<key=value>',
action=parseractions.KeyValueAction,
- help='Property to add/change for this snapshot '
- '(repeat option to set multiple properties)',
+ help=_('Property to add/change for this snapshot '
+ '(repeat option to set multiple properties)'),
)
return parser
@@ -204,7 +209,7 @@ class SetSnapshot(command.Command):
kwargs['display_description'] = parsed_args.description
if not kwargs and not parsed_args.property:
- self.app.log.error("No changes requested\n")
+ self.app.log.error(_("No changes requested\n"))
return
snapshot.update(**kwargs)
@@ -218,7 +223,8 @@ class ShowSnapshot(command.ShowOne):
parser.add_argument(
'snapshot',
metavar='<snapshot>',
- help='Snapshot to display (name or ID)')
+ help=_('Snapshot to display (name or ID)')
+ )
return parser
def take_action(self, parsed_args):
@@ -241,16 +247,16 @@ class UnsetSnapshot(command.Command):
parser.add_argument(
'snapshot',
metavar='<snapshot>',
- help='Snapshot to modify (name or ID)',
+ help=_('Snapshot to modify (name or ID)'),
)
parser.add_argument(
'--property',
metavar='<key>',
action='append',
default=[],
- help='Property to remove from snapshot '
- '(repeat option to remove multiple properties)',
required=True,
+ help=_('Property to remove from snapshot '
+ '(repeat option to remove multiple properties)'),
)
return parser
@@ -265,4 +271,4 @@ class UnsetSnapshot(command.Command):
parsed_args.property,
)
else:
- self.app.log.error("No changes requested\n")
+ self.app.log.error(_("No changes requested\n"))