summaryrefslogtreecommitdiff
path: root/openstackclient/volume/v1/qos_specs.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/qos_specs.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/qos_specs.py')
-rw-r--r--openstackclient/volume/v1/qos_specs.py42
1 files changed, 22 insertions, 20 deletions
diff --git a/openstackclient/volume/v1/qos_specs.py b/openstackclient/volume/v1/qos_specs.py
index 826e5c49..b9eb8752 100644
--- a/openstackclient/volume/v1/qos_specs.py
+++ b/openstackclient/volume/v1/qos_specs.py
@@ -20,6 +20,7 @@ import six
from openstackclient.common import command
from openstackclient.common import parseractions
from openstackclient.common import utils
+from openstackclient.i18n import _
class AssociateQos(command.Command):
@@ -30,12 +31,12 @@ class AssociateQos(command.Command):
parser.add_argument(
'qos_spec',
metavar='<qos-spec>',
- help='QoS specification to modify (name or ID)',
+ help=_('QoS specification to modify (name or ID)'),
)
parser.add_argument(
'volume_type',
metavar='<volume-type>',
- help='Volume type to associate the QoS (name or ID)',
+ help=_('Volume type to associate the QoS (name or ID)'),
)
return parser
@@ -57,7 +58,7 @@ class CreateQos(command.ShowOne):
parser.add_argument(
'name',
metavar='<name>',
- help='New QoS specification name',
+ help=_('New QoS specification name'),
)
consumer_choices = ['front-end', 'back-end', 'both']
parser.add_argument(
@@ -65,15 +66,16 @@ class CreateQos(command.ShowOne):
metavar='<consumer>',
choices=consumer_choices,
default='both',
- help='Consumer of the QoS. Valid consumers: %s '
- "(defaults to 'both')" % utils.format_list(consumer_choices)
+ help=(_('Consumer of the QoS. Valid consumers: %s '
+ "(defaults to 'both')") %
+ utils.format_list(consumer_choices))
)
parser.add_argument(
'--property',
metavar='<key=value>',
action=parseractions.KeyValueAction,
- help='Set a QoS specification property '
- '(repeat option to set multiple properties)',
+ help=_('Set a QoS specification property '
+ '(repeat option to set multiple properties)'),
)
return parser
@@ -99,7 +101,7 @@ class DeleteQos(command.Command):
'qos_specs',
metavar='<qos-spec>',
nargs="+",
- help='QoS specification(s) to delete (name or ID)',
+ help=_('QoS specification(s) to delete (name or ID)'),
)
return parser
@@ -118,19 +120,19 @@ class DisassociateQos(command.Command):
parser.add_argument(
'qos_spec',
metavar='<qos-spec>',
- help='QoS specification to modify (name or ID)',
+ help=_('QoS specification to modify (name or ID)'),
)
volume_type_group = parser.add_mutually_exclusive_group()
volume_type_group.add_argument(
'--volume-type',
metavar='<volume-type>',
- help='Volume type to disassociate the QoS from (name or ID)',
+ help=_('Volume type to disassociate the QoS from (name or ID)'),
)
volume_type_group.add_argument(
'--all',
action='store_true',
default=False,
- help='Disassociate the QoS from every volume type',
+ help=_('Disassociate the QoS from every volume type'),
)
return parser
@@ -181,14 +183,14 @@ class SetQos(command.Command):
parser.add_argument(
'qos_spec',
metavar='<qos-spec>',
- help='QoS specification to modify (name or ID)',
+ help=_('QoS specification to modify (name or ID)'),
)
parser.add_argument(
'--property',
metavar='<key=value>',
action=parseractions.KeyValueAction,
- help='Property to add or modify for this QoS specification '
- '(repeat option to set multiple properties)',
+ help=_('Property to add or modify for this QoS specification '
+ '(repeat option to set multiple properties)'),
)
return parser
@@ -201,7 +203,7 @@ class SetQos(command.Command):
volume_client.qos_specs.set_keys(qos_spec.id,
parsed_args.property)
else:
- self.app.log.error("No changes requested\n")
+ self.app.log.error(_("No changes requested\n"))
class ShowQos(command.ShowOne):
@@ -212,7 +214,7 @@ class ShowQos(command.ShowOne):
parser.add_argument(
'qos_spec',
metavar='<qos-spec>',
- help='QoS specification to display (name or ID)',
+ help=_('QoS specification to display (name or ID)'),
)
return parser
@@ -241,15 +243,15 @@ class UnsetQos(command.Command):
parser.add_argument(
'qos_spec',
metavar='<qos-spec>',
- help='QoS specification to modify (name or ID)',
+ help=_('QoS specification to modify (name or ID)'),
)
parser.add_argument(
'--property',
metavar='<key>',
action='append',
default=[],
- help='Property to remove from the QoS specification. '
- '(repeat option to unset multiple properties)',
+ help=_('Property to remove from the QoS specification. '
+ '(repeat option to unset multiple properties)'),
)
return parser
@@ -262,4 +264,4 @@ class UnsetQos(command.Command):
volume_client.qos_specs.unset_keys(qos_spec.id,
parsed_args.property)
else:
- self.app.log.error("No changes requested\n")
+ self.app.log.error(_("No changes requested\n"))