summaryrefslogtreecommitdiff
path: root/openstackclient/volume/v2
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/v2
parent17bc850440045128871c381244540eeedaa569a7 (diff)
downloadpython-openstackclient-53e05e7c2d36ab2ff1ba05a8334286d41c5f40e4.tar.gz
i18n support for help and error messages in cinder
Change-Id: I98fbc959034fe0530966291643b381855801de20
Diffstat (limited to 'openstackclient/volume/v2')
-rw-r--r--openstackclient/volume/v2/backup.py20
-rw-r--r--openstackclient/volume/v2/qos_specs.py42
-rw-r--r--openstackclient/volume/v2/service.py9
-rw-r--r--openstackclient/volume/v2/snapshot.py45
-rw-r--r--openstackclient/volume/v2/volume.py81
-rw-r--r--openstackclient/volume/v2/volume_type.py64
6 files changed, 138 insertions, 123 deletions
diff --git a/openstackclient/volume/v2/backup.py b/openstackclient/volume/v2/backup.py
index 016a414c..e6fbe78d 100644
--- a/openstackclient/volume/v2/backup.py
+++ b/openstackclient/volume/v2/backup.py
@@ -20,6 +20,7 @@ import six
from openstackclient.common import command
from openstackclient.common import utils
+from openstackclient.i18n import _
class CreateBackup(command.ShowOne):
@@ -30,22 +31,22 @@ class CreateBackup(command.ShowOne):
parser.add_argument(
"volume",
metavar="<volume>",
- help="Volume to backup (name or ID)"
+ help=_("Volume to backup (name or ID)")
)
parser.add_argument(
"--name",
metavar="<name>",
- help="Name of the backup"
+ help=_("Name of the backup")
)
parser.add_argument(
"--description",
metavar="<description>",
- help="Description of the backup"
+ help=_("Description of the backup")
)
parser.add_argument(
"--container",
metavar="<container>",
- help="Optional backup container name"
+ help=_("Optional backup container name")
)
return parser
@@ -72,7 +73,7 @@ class DeleteBackup(command.Command):
"backups",
metavar="<backup>",
nargs="+",
- help="Backup(s) to delete (name or ID)"
+ help=_("Backup(s) to delete (name or ID)")
)
return parser
@@ -93,7 +94,7 @@ class ListBackup(command.Lister):
"--long",
action="store_true",
default=False,
- help="List additional fields in output"
+ help=_("List additional fields in output")
)
return parser
@@ -146,12 +147,12 @@ class RestoreBackup(command.ShowOne):
parser.add_argument(
"backup",
metavar="<backup>",
- help="Backup to restore (ID only)"
+ help=_("Backup to restore (ID only)")
)
parser.add_argument(
"volume",
metavar="<volume>",
- help="Volume to restore to (name or ID)"
+ help=_("Volume to restore to (name or ID)")
)
return parser
@@ -171,7 +172,8 @@ class ShowBackup(command.ShowOne):
parser.add_argument(
"backup",
metavar="<backup>",
- help="Backup to display (name or ID)")
+ help=_("Backup to display (name or ID)")
+ )
return parser
def take_action(self, parsed_args):
diff --git a/openstackclient/volume/v2/qos_specs.py b/openstackclient/volume/v2/qos_specs.py
index 961cc27e..aa2059d7 100644
--- a/openstackclient/volume/v2/qos_specs.py
+++ b/openstackclient/volume/v2/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"))
diff --git a/openstackclient/volume/v2/service.py b/openstackclient/volume/v2/service.py
index f26be13e..023dda98 100644
--- a/openstackclient/volume/v2/service.py
+++ b/openstackclient/volume/v2/service.py
@@ -16,6 +16,7 @@
from openstackclient.common import command
from openstackclient.common import utils
+from openstackclient.i18n import _
class ListService(command.Lister):
@@ -26,16 +27,18 @@ class ListService(command.Lister):
parser.add_argument(
"--host",
metavar="<host>",
- help="List services on specified host (name only)")
+ help=_("List services on specified host (name only)")
+ )
parser.add_argument(
"--service",
metavar="<service>",
- help="List only specified service (name only)")
+ help=_("List only specified service (name only)")
+ )
parser.add_argument(
"--long",
action="store_true",
default=False,
- help="List additional fields in output"
+ help=_("List additional fields in output")
)
return parser
diff --git a/openstackclient/volume/v2/snapshot.py b/openstackclient/volume/v2/snapshot.py
index 65cb9a75..db4ce6c3 100644
--- a/openstackclient/volume/v2/snapshot.py
+++ b/openstackclient/volume/v2/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
@@ -77,7 +79,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
@@ -98,13 +100,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
@@ -163,29 +165,32 @@ 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)'),
)
parser.add_argument(
'--state',
metavar='<state>',
choices=['available', 'error', 'creating', 'deleting',
'error-deleting'],
- help='New snapshot state. Valid values are available, '
- 'error, creating, deleting, and error-deleting.',
+ help=_('New snapshot state. Valid values are available, '
+ 'error, creating, deleting, and error-deleting.'),
)
return parser
@@ -202,7 +207,7 @@ class SetSnapshot(command.Command):
if (not kwargs and not parsed_args.property and not
parsed_args.state):
- self.app.log.error("No changes requested\n")
+ self.app.log.error(_("No changes requested\n"))
return
if parsed_args.property:
@@ -222,7 +227,7 @@ 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
@@ -244,15 +249,15 @@ 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)',
+ help=_('Property to remove from snapshot '
+ '(repeat option to remove multiple properties)'),
)
return parser
@@ -267,4 +272,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"))
diff --git a/openstackclient/volume/v2/volume.py b/openstackclient/volume/v2/volume.py
index 5a739f61..0e07aa78 100644
--- a/openstackclient/volume/v2/volume.py
+++ b/openstackclient/volume/v2/volume.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 _
from openstackclient.identity import common as identity_common
@@ -32,61 +33,61 @@ class CreateVolume(command.ShowOne):
parser.add_argument(
"name",
metavar="<name>",
- help="Volume name",
+ help=_("Volume name"),
)
parser.add_argument(
"--size",
metavar="<size>",
type=int,
required=True,
- help="Volume size in GB",
+ help=_("Volume size in GB"),
)
parser.add_argument(
"--type",
metavar="<volume-type>",
- help="Set the type of volume",
+ help=_("Set the type of volume"),
)
parser.add_argument(
"--image",
metavar="<image>",
- help="Use <image> as source of volume (name or ID)",
+ help=_("Use <image> as source of volume (name or ID)"),
)
parser.add_argument(
"--snapshot",
metavar="<snapshot>",
- help="Use <snapshot> as source of volume (name or ID)",
+ help=_("Use <snapshot> as source of volume (name or ID)"),
)
parser.add_argument(
"--source",
metavar="<volume>",
- help="Volume to clone (name or ID)",
+ help=_("Volume to clone (name or ID)"),
)
parser.add_argument(
"--description",
metavar="<description>",
- help="Volume description",
+ help=_("Volume description"),
)
parser.add_argument(
'--user',
metavar='<user>',
- help='Specify an alternate user (name or ID)',
+ help=_('Specify an alternate user (name or ID)'),
)
parser.add_argument(
'--project',
metavar='<project>',
- help='Specify an alternate project (name or ID)',
+ help=_('Specify an alternate project (name or ID)'),
)
parser.add_argument(
"--availability-zone",
metavar="<availability-zone>",
- help="Create volume in <availability-zone>",
+ help=_("Create volume in <availability-zone>"),
)
parser.add_argument(
"--property",
metavar="<key=value>",
action=parseractions.KeyValueAction,
- help="Set a property to this volume "
- "(repeat option to set multiple properties)",
+ help=_("Set a property to this volume "
+ "(repeat option to set multiple properties)"),
)
return parser
@@ -158,15 +159,15 @@ class DeleteVolume(command.Command):
"volumes",
metavar="<volume>",
nargs="+",
- help="Volume(s) to delete (name or ID)"
+ help=_("Volume(s) to delete (name or ID)")
)
parser.add_argument(
"--force",
dest="force",
action="store_true",
default=False,
- help="Attempt forced removal of volume(s), regardless of state "
- "(defaults to False)"
+ help=_("Attempt forced removal of volume(s), regardless of state "
+ "(defaults to False)")
)
return parser
@@ -189,36 +190,36 @@ class ListVolume(command.Lister):
parser.add_argument(
'--project',
metavar='<project>',
- help='Filter results by project (name or ID) (admin only)'
+ help=_('Filter results by project (name or ID) (admin only)')
)
identity_common.add_project_domain_option_to_parser(parser)
parser.add_argument(
'--user',
metavar='<user>',
- help='Filter results by user (name or ID) (admin only)'
+ help=_('Filter results by user (name or ID) (admin only)')
)
identity_common.add_user_domain_option_to_parser(parser)
parser.add_argument(
'--name',
metavar='<name>',
- help='Filter results by volume name',
+ help=_('Filter results by volume name'),
)
parser.add_argument(
'--status',
metavar='<status>',
- help='Filter results by status',
+ help=_('Filter results by status'),
)
parser.add_argument(
'--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
@@ -320,37 +321,37 @@ class SetVolume(command.Command):
parser.add_argument(
'volume',
metavar='<volume>',
- help='Volume to modify (name or ID)',
+ help=_('Volume to modify (name or ID)'),
)
parser.add_argument(
'--name',
metavar='<name>',
- help='New volume name',
+ help=_('New volume name'),
)
parser.add_argument(
'--size',
metavar='<size>',
type=int,
- help='Extend volume size in GB',
+ help=_('Extend volume size in GB'),
)
parser.add_argument(
'--description',
metavar='<description>',
- help='New volume description',
+ help=_('New volume description'),
)
parser.add_argument(
'--property',
metavar='<key=value>',
action=parseractions.KeyValueAction,
- help='Set a property on this volume '
- '(repeat option to set multiple properties)',
+ help=_('Set a property on this volume '
+ '(repeat option to set multiple properties)'),
)
parser.add_argument(
'--image-property',
metavar='<key=value>',
action=parseractions.KeyValueAction,
- help='Set an image property on this volume '
- '(repeat option to set multiple image properties)',
+ help=_('Set an image property on this volume '
+ '(repeat option to set multiple image properties)'),
)
return parser
@@ -360,12 +361,12 @@ class SetVolume(command.Command):
if parsed_args.size:
if volume.status != 'available':
- self.app.log.error("Volume is in %s state, it must be "
- "available before size can be extended" %
+ self.app.log.error(_("Volume is in %s state, it must be "
+ "available before size can be extended") %
volume.status)
return
if parsed_args.size <= volume.size:
- self.app.log.error("New size must be greater than %s GB" %
+ self.app.log.error(_("New size must be greater than %s GB") %
volume.size)
return
volume_client.volumes.extend(volume.id, parsed_args.size)
@@ -386,7 +387,7 @@ class SetVolume(command.Command):
if (not kwargs and not parsed_args.property
and not parsed_args.image_property and not parsed_args.size):
- self.app.log.error("No changes requested\n")
+ self.app.log.error(_("No changes requested\n"))
class ShowVolume(command.ShowOne):
@@ -397,7 +398,7 @@ class ShowVolume(command.ShowOne):
parser.add_argument(
'volume',
metavar="<volume-id>",
- help="Volume to display (name or ID)"
+ help=_("Volume to display (name or ID)")
)
return parser
@@ -428,21 +429,21 @@ class UnsetVolume(command.Command):
parser.add_argument(
'volume',
metavar='<volume>',
- help='Volume to modify (name or ID)',
+ help=_('Volume to modify (name or ID)'),
)
parser.add_argument(
'--property',
metavar='<key>',
action='append',
- help='Remove a property from volume '
- '(repeat option to remove multiple properties)',
+ help=_('Remove a property from volume '
+ '(repeat option to remove multiple properties)'),
)
parser.add_argument(
'--image-property',
metavar='<key>',
action='append',
- help='Remove an image property from volume '
- '(repeat option to remove multiple image properties)',
+ help=_('Remove an image property from volume '
+ '(repeat option to remove multiple image properties)'),
)
return parser
@@ -459,4 +460,4 @@ class UnsetVolume(command.Command):
volume.id, parsed_args.image_property)
if (not parsed_args.image_property and not parsed_args.property):
- self.app.log.error("No changes requested\n")
+ self.app.log.error(_("No changes requested\n"))
diff --git a/openstackclient/volume/v2/volume_type.py b/openstackclient/volume/v2/volume_type.py
index 30500518..adaccb0a 100644
--- a/openstackclient/volume/v2/volume_type.py
+++ b/openstackclient/volume/v2/volume_type.py
@@ -20,6 +20,7 @@ from openstackclient.common import command
from openstackclient.common import exceptions
from openstackclient.common import parseractions
from openstackclient.common import utils
+from openstackclient.i18n import _
from openstackclient.identity import common as identity_common
@@ -31,12 +32,12 @@ class CreateVolumeType(command.ShowOne):
parser.add_argument(
"name",
metavar="<name>",
- help="Volume type name",
+ help=_("Volume type name"),
)
parser.add_argument(
"--description",
metavar="<description>",
- help="Volume type description",
+ help=_("Volume type description"),
)
public_group = parser.add_mutually_exclusive_group()
public_group.add_argument(
@@ -44,21 +45,21 @@ class CreateVolumeType(command.ShowOne):
dest="public",
action="store_true",
default=False,
- help="Volume type is accessible to the public",
+ help=_("Volume type is accessible to the public"),
)
public_group.add_argument(
"--private",
dest="private",
action="store_true",
default=False,
- help="Volume type is not accessible to the public",
+ help=_("Volume type is not accessible to the public"),
)
parser.add_argument(
'--property',
metavar='<key=value>',
action=parseractions.KeyValueAction,
- help='Set a property on this volume type '
- '(repeat option to set multiple properties)',
+ help=_('Set a property on this volume type '
+ '(repeat option to set multiple properties)'),
)
return parser
@@ -93,7 +94,7 @@ class DeleteVolumeType(command.Command):
parser.add_argument(
"volume_type",
metavar="<volume-type>",
- help="Volume type to delete (name or ID)"
+ help=_("Volume type to delete (name or ID)")
)
return parser
@@ -113,7 +114,7 @@ class ListVolumeType(command.Lister):
'--long',
action='store_true',
default=False,
- help='List additional fields in output')
+ help=_('List additional fields in output'))
return parser
def take_action(self, parsed_args):
@@ -139,29 +140,30 @@ class SetVolumeType(command.Command):
parser.add_argument(
'volume_type',
metavar='<volume-type>',
- help='Volume type to modify (name or ID)',
+ help=_('Volume type to modify (name or ID)'),
)
parser.add_argument(
'--name',
metavar='<name>',
- help='Set volume type name',
+ help=_('Set volume type name'),
)
parser.add_argument(
'--description',
metavar='<name>',
- help='Set volume type description',
+ help=_('Set volume type description'),
)
parser.add_argument(
'--property',
metavar='<key=value>',
action=parseractions.KeyValueAction,
- help='Set a property on this volume type '
- '(repeat option to set multiple properties)',
+ help=_('Set a property on this volume type '
+ '(repeat option to set multiple properties)'),
)
parser.add_argument(
'--project',
metavar='<project>',
- help='Set volume type access to project (name or ID) (admin only)',
+ help=_('Set volume type access to project (name or ID) '
+ '(admin only)'),
)
identity_common.add_project_domain_option_to_parser(parser)
@@ -178,7 +180,7 @@ class SetVolumeType(command.Command):
and not parsed_args.description
and not parsed_args.property
and not parsed_args.project):
- self.app.log.error("No changes requested\n")
+ self.app.log.error(_("No changes requested\n"))
return
result = 0
@@ -195,15 +197,15 @@ class SetVolumeType(command.Command):
**kwargs
)
except Exception as e:
- self.app.log.error("Failed to update volume type name or"
- " description: " + str(e))
+ self.app.log.error(_("Failed to update volume type name or"
+ " description: %s") % str(e))
result += 1
if parsed_args.property:
try:
volume_type.set_keys(parsed_args.property)
except Exception as e:
- self.app.log.error("Failed to set volume type property: " +
+ self.app.log.error(_("Failed to set volume type property: ") +
str(e))
result += 1
@@ -218,8 +220,8 @@ class SetVolumeType(command.Command):
volume_client.volume_type_access.add_project_access(
volume_type.id, project_info.id)
except Exception as e:
- self.app.log.error("Failed to set volume type access to"
- " project: " + str(e))
+ self.app.log.error(_("Failed to set volume type access to"
+ " project: %s") % str(e))
result += 1
if result > 0:
@@ -235,7 +237,7 @@ class ShowVolumeType(command.ShowOne):
parser.add_argument(
"volume_type",
metavar="<volume-type>",
- help="Volume type to display (name or ID)"
+ help=_("Volume type to display (name or ID)")
)
return parser
@@ -256,19 +258,19 @@ class UnsetVolumeType(command.Command):
parser.add_argument(
'volume_type',
metavar='<volume-type>',
- help='Volume type to modify (name or ID)',
+ help=_('Volume type to modify (name or ID)'),
)
parser.add_argument(
'--property',
metavar='<key>',
- help='Remove a property from this volume type '
- '(repeat option to remove multiple properties)',
+ help=_('Remove a property from this volume type '
+ '(repeat option to remove multiple properties)'),
)
parser.add_argument(
'--project',
metavar='<project>',
- help='Removes volume type access to project (name or ID) '
- ' (admin only)',
+ help=_('Removes volume type access to project (name or ID) '
+ ' (admin only)'),
)
identity_common.add_project_domain_option_to_parser(parser)
@@ -285,7 +287,7 @@ class UnsetVolumeType(command.Command):
if (not parsed_args.property
and not parsed_args.project):
- self.app.log.error("No changes requested\n")
+ self.app.log.error(_("No changes requested\n"))
return
result = 0
@@ -293,8 +295,8 @@ class UnsetVolumeType(command.Command):
try:
volume_type.unset_keys(parsed_args.property)
except Exception as e:
- self.app.log.error("Failed to unset volume type property: " +
- str(e))
+ self.app.log.error(_("Failed to unset volume type property: %s"
+ ) % str(e))
result += 1
if parsed_args.project:
@@ -308,8 +310,8 @@ class UnsetVolumeType(command.Command):
volume_client.volume_type_access.remove_project_access(
volume_type.id, project_info.id)
except Exception as e:
- self.app.log.error("Failed to remove volume type access from"
- " project: " + str(e))
+ self.app.log.error(_("Failed to remove volume type access from"
+ " project: ") + str(e))
result += 1
if result > 0: