Mark identity v2 resources for translation
mark v2 catalog, ec2, endpoint, project, role, service and token Change-Id: I14a5852bfee4ca9e25130d001fdadd7778ad0996
This commit is contained in:
parent
0cb204e59b
commit
bb71df9ced
@ -20,6 +20,7 @@ from cliff import lister
|
||||
from cliff import show
|
||||
|
||||
from openstackclient.common import utils
|
||||
from openstackclient.i18n import _ # noqa
|
||||
|
||||
|
||||
def _format_endpoints(eps=None):
|
||||
@ -67,7 +68,7 @@ class ShowCatalog(show.ShowOne):
|
||||
parser.add_argument(
|
||||
'service',
|
||||
metavar='<service>',
|
||||
help='Service to display (type, name or ID)',
|
||||
help=_('Service to display (type, name or ID)'),
|
||||
)
|
||||
return parser
|
||||
|
||||
|
@ -24,6 +24,7 @@ from cliff import lister
|
||||
from cliff import show
|
||||
|
||||
from openstackclient.common import utils
|
||||
from openstackclient.i18n import _ # noqa
|
||||
|
||||
|
||||
class CreateEC2Creds(show.ShowOne):
|
||||
@ -36,12 +37,12 @@ class CreateEC2Creds(show.ShowOne):
|
||||
parser.add_argument(
|
||||
'--project',
|
||||
metavar='<project>',
|
||||
help='Specify a project [admin only]',
|
||||
help=_('Specify a project [admin only]'),
|
||||
)
|
||||
parser.add_argument(
|
||||
'--user',
|
||||
metavar='<user>',
|
||||
help='Specify a user [admin only]',
|
||||
help=_('Specify a user [admin only]'),
|
||||
)
|
||||
return parser
|
||||
|
||||
@ -83,12 +84,12 @@ class DeleteEC2Creds(command.Command):
|
||||
parser.add_argument(
|
||||
'access_key',
|
||||
metavar='<access-key>',
|
||||
help='Credentials access key',
|
||||
help=_('Credentials access key'),
|
||||
)
|
||||
parser.add_argument(
|
||||
'--user',
|
||||
metavar='<user>',
|
||||
help='Specify a user [admin only]',
|
||||
help=_('Specify a user [admin only]'),
|
||||
)
|
||||
return parser
|
||||
|
||||
@ -118,7 +119,7 @@ class ListEC2Creds(lister.Lister):
|
||||
parser.add_argument(
|
||||
'--user',
|
||||
metavar='<user>',
|
||||
help='Specify a user [admin only]',
|
||||
help=_('Specify a user [admin only]'),
|
||||
)
|
||||
return parser
|
||||
|
||||
@ -156,12 +157,12 @@ class ShowEC2Creds(show.ShowOne):
|
||||
parser.add_argument(
|
||||
'access_key',
|
||||
metavar='<access-key>',
|
||||
help='Credentials access key',
|
||||
help=_('Credentials access key'),
|
||||
)
|
||||
parser.add_argument(
|
||||
'--user',
|
||||
metavar='<user>',
|
||||
help='Specify a user [admin only]',
|
||||
help=_('Specify a user [admin only]'),
|
||||
)
|
||||
return parser
|
||||
|
||||
|
@ -23,6 +23,7 @@ from cliff import lister
|
||||
from cliff import show
|
||||
|
||||
from openstackclient.common import utils
|
||||
from openstackclient.i18n import _ # noqa
|
||||
from openstackclient.identity import common
|
||||
|
||||
|
||||
@ -36,24 +37,24 @@ class CreateEndpoint(show.ShowOne):
|
||||
parser.add_argument(
|
||||
'service',
|
||||
metavar='<endpoint-service>',
|
||||
help='New endpoint service')
|
||||
help=_('New endpoint service'))
|
||||
parser.add_argument(
|
||||
'--region',
|
||||
metavar='<region>',
|
||||
help='New endpoint region')
|
||||
help=_('New endpoint region'))
|
||||
parser.add_argument(
|
||||
'--publicurl',
|
||||
metavar='<public-url>',
|
||||
required=True,
|
||||
help='New endpoint public URL')
|
||||
help=_('New endpoint public URL'))
|
||||
parser.add_argument(
|
||||
'--adminurl',
|
||||
metavar='<admin-url>',
|
||||
help='New endpoint admin URL')
|
||||
help=_('New endpoint admin URL'))
|
||||
parser.add_argument(
|
||||
'--internalurl',
|
||||
metavar='<internal-url>',
|
||||
help='New endpoint internal URL')
|
||||
help=_('New endpoint internal URL'))
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
@ -84,7 +85,7 @@ class DeleteEndpoint(command.Command):
|
||||
parser.add_argument(
|
||||
'endpoint',
|
||||
metavar='<endpoint-id>',
|
||||
help='ID of endpoint to delete')
|
||||
help=_('ID of endpoint to delete'))
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
@ -105,7 +106,7 @@ class ListEndpoint(lister.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,7 +140,7 @@ class ShowEndpoint(show.ShowOne):
|
||||
parser.add_argument(
|
||||
'endpoint_or_service',
|
||||
metavar='<endpoint_or_service>',
|
||||
help='Endpoint ID or name, type or ID of service to display')
|
||||
help=_('Endpoint ID or name, type or ID of service to display'))
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
|
@ -21,10 +21,11 @@ import six
|
||||
from cliff import command
|
||||
from cliff import lister
|
||||
from cliff import show
|
||||
|
||||
from keystoneclient.openstack.common.apiclient import exceptions as ksc_exc
|
||||
|
||||
from openstackclient.common import parseractions
|
||||
from openstackclient.common import utils
|
||||
from openstackclient.i18n import _ # noqa
|
||||
|
||||
|
||||
class CreateProject(show.ShowOne):
|
||||
@ -37,30 +38,30 @@ class CreateProject(show.ShowOne):
|
||||
parser.add_argument(
|
||||
'name',
|
||||
metavar='<project-name>',
|
||||
help='New project name',
|
||||
help=_('New project name'),
|
||||
)
|
||||
parser.add_argument(
|
||||
'--description',
|
||||
metavar='<project-description>',
|
||||
help='New project description',
|
||||
help=_('New project description'),
|
||||
)
|
||||
enable_group = parser.add_mutually_exclusive_group()
|
||||
enable_group.add_argument(
|
||||
'--enable',
|
||||
action='store_true',
|
||||
help='Enable project (default)',
|
||||
help=_('Enable project (default)'),
|
||||
)
|
||||
enable_group.add_argument(
|
||||
'--disable',
|
||||
action='store_true',
|
||||
help='Disable project',
|
||||
help=_('Disable project'),
|
||||
)
|
||||
parser.add_argument(
|
||||
'--property',
|
||||
metavar='<key=value>',
|
||||
action=parseractions.KeyValueAction,
|
||||
help='Property to add for this project '
|
||||
'(repeat option to set multiple properties)',
|
||||
help=_('Property to add for this project '
|
||||
'(repeat option to set multiple properties)'),
|
||||
)
|
||||
return parser
|
||||
|
||||
@ -97,7 +98,7 @@ class DeleteProject(command.Command):
|
||||
parser.add_argument(
|
||||
'project',
|
||||
metavar='<project>',
|
||||
help='Project to delete (name or ID)',
|
||||
help=_('Project to delete (name or ID)'),
|
||||
)
|
||||
return parser
|
||||
|
||||
@ -125,7 +126,7 @@ class ListProject(lister.Lister):
|
||||
'--long',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='List additional fields in output',
|
||||
help=_('List additional fields in output'),
|
||||
)
|
||||
return parser
|
||||
|
||||
@ -153,35 +154,35 @@ class SetProject(command.Command):
|
||||
parser.add_argument(
|
||||
'project',
|
||||
metavar='<project>',
|
||||
help='Project to change (name or ID)',
|
||||
help=_('Project to change (name or ID)'),
|
||||
)
|
||||
parser.add_argument(
|
||||
'--name',
|
||||
metavar='<new-project-name>',
|
||||
help='New project name',
|
||||
help=_('New project name'),
|
||||
)
|
||||
parser.add_argument(
|
||||
'--description',
|
||||
metavar='<project-description>',
|
||||
help='New project description',
|
||||
help=_('New project description'),
|
||||
)
|
||||
enable_group = parser.add_mutually_exclusive_group()
|
||||
enable_group.add_argument(
|
||||
'--enable',
|
||||
action='store_true',
|
||||
help='Enable project',
|
||||
help=_('Enable project'),
|
||||
)
|
||||
enable_group.add_argument(
|
||||
'--disable',
|
||||
action='store_true',
|
||||
help='Disable project',
|
||||
help=_('Disable project'),
|
||||
)
|
||||
parser.add_argument(
|
||||
'--property',
|
||||
metavar='<key=value>',
|
||||
action=parseractions.KeyValueAction,
|
||||
help='Property to add for this project '
|
||||
'(repeat option to set multiple properties)',
|
||||
help=_('Property to add for this project '
|
||||
'(repeat option to set multiple properties)'),
|
||||
)
|
||||
return parser
|
||||
|
||||
@ -233,7 +234,7 @@ class ShowProject(show.ShowOne):
|
||||
parser.add_argument(
|
||||
'project',
|
||||
metavar='<project>',
|
||||
help='Project to display (name or ID)')
|
||||
help=_('Project to display (name or ID)'))
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
|
@ -24,6 +24,7 @@ from cliff import show
|
||||
|
||||
from openstackclient.common import exceptions
|
||||
from openstackclient.common import utils
|
||||
from openstackclient.i18n import _ # noqa
|
||||
|
||||
|
||||
class AddRole(show.ShowOne):
|
||||
@ -36,18 +37,17 @@ class AddRole(show.ShowOne):
|
||||
parser.add_argument(
|
||||
'role',
|
||||
metavar='<role>',
|
||||
help='Role name or ID to add to user')
|
||||
help=_('Role name or ID to add to user'))
|
||||
parser.add_argument(
|
||||
'--project',
|
||||
metavar='<project>',
|
||||
required=True,
|
||||
help='Include project (name or ID)',
|
||||
)
|
||||
help=_('Include project (name or ID)'))
|
||||
parser.add_argument(
|
||||
'--user',
|
||||
metavar='<user>',
|
||||
required=True,
|
||||
help='Name or ID of user to include')
|
||||
help=_('Name or ID of user to include'))
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
@ -80,7 +80,7 @@ class CreateRole(show.ShowOne):
|
||||
parser.add_argument(
|
||||
'role_name',
|
||||
metavar='<role-name>',
|
||||
help='New role name')
|
||||
help=_('New role name'))
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
@ -103,8 +103,7 @@ class DeleteRole(command.Command):
|
||||
parser.add_argument(
|
||||
'role',
|
||||
metavar='<role>',
|
||||
help='Name or ID of role to delete',
|
||||
)
|
||||
help=_('Name or ID of role to delete'))
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
@ -147,12 +146,11 @@ class ListUserRole(lister.Lister):
|
||||
'user',
|
||||
metavar='<user>',
|
||||
nargs='?',
|
||||
help='Name or ID of user to include')
|
||||
help=_('Name or ID of user to include'))
|
||||
parser.add_argument(
|
||||
'--project',
|
||||
metavar='<project>',
|
||||
help='Include project (name or ID)',
|
||||
)
|
||||
help=_('Include project (name or ID)'))
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
@ -167,13 +165,13 @@ class ListUserRole(lister.Lister):
|
||||
if self.app.client_manager.auth_ref:
|
||||
parsed_args.project = auth_ref.project_id
|
||||
else:
|
||||
msg = "Project must be specified"
|
||||
msg = _("Project must be specified")
|
||||
raise exceptions.CommandError(msg)
|
||||
if not parsed_args.user:
|
||||
if self.app.client_manager.auth_ref:
|
||||
parsed_args.user = auth_ref.user_id
|
||||
else:
|
||||
msg = "User must be specified"
|
||||
msg = _("User must be specified")
|
||||
raise exceptions.CommandError(msg)
|
||||
|
||||
project = utils.find_resource(
|
||||
@ -213,18 +211,17 @@ class RemoveRole(command.Command):
|
||||
parser.add_argument(
|
||||
'role',
|
||||
metavar='<role>',
|
||||
help='Role name or ID to remove from user')
|
||||
help=_('Role name or ID to remove from user'))
|
||||
parser.add_argument(
|
||||
'--project',
|
||||
metavar='<project>',
|
||||
required=True,
|
||||
help='Project to include (name or ID)',
|
||||
)
|
||||
help=_('Project to include (name or ID)'))
|
||||
parser.add_argument(
|
||||
'--user',
|
||||
metavar='<user>',
|
||||
required=True,
|
||||
help='Name or ID of user')
|
||||
help=_('Name or ID of user'))
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
@ -252,7 +249,7 @@ class ShowRole(show.ShowOne):
|
||||
parser.add_argument(
|
||||
'role',
|
||||
metavar='<role>',
|
||||
help='Name or ID of role to display')
|
||||
help=_('Name or ID of role to display'))
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
|
@ -24,6 +24,7 @@ from cliff import show
|
||||
|
||||
from openstackclient.common import exceptions
|
||||
from openstackclient.common import utils
|
||||
from openstackclient.i18n import _ # noqa
|
||||
from openstackclient.identity import common
|
||||
|
||||
|
||||
@ -37,18 +38,18 @@ class CreateService(show.ShowOne):
|
||||
parser.add_argument(
|
||||
'name',
|
||||
metavar='<service-name>',
|
||||
help='New service name',
|
||||
help=_('New service name'),
|
||||
)
|
||||
parser.add_argument(
|
||||
'--type',
|
||||
metavar='<service-type>',
|
||||
required=True,
|
||||
help='New service type (compute, image, identity, volume, etc)',
|
||||
help=_('New service type (compute, image, identity, volume, etc)'),
|
||||
)
|
||||
parser.add_argument(
|
||||
'--description',
|
||||
metavar='<service-description>',
|
||||
help='New service description',
|
||||
help=_('New service description'),
|
||||
)
|
||||
return parser
|
||||
|
||||
@ -76,7 +77,7 @@ class DeleteService(command.Command):
|
||||
parser.add_argument(
|
||||
'service',
|
||||
metavar='<service>',
|
||||
help='Service to delete (name or ID)',
|
||||
help=_('Service to delete (name or ID)'),
|
||||
)
|
||||
return parser
|
||||
|
||||
@ -99,7 +100,7 @@ class ListService(lister.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):
|
||||
@ -127,13 +128,13 @@ class ShowService(show.ShowOne):
|
||||
parser.add_argument(
|
||||
'service',
|
||||
metavar='<service>',
|
||||
help='Service to display (type, name or ID)',
|
||||
help=_('Service to display (type, name or ID)'),
|
||||
)
|
||||
parser.add_argument(
|
||||
'--catalog',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='Show service catalog information',
|
||||
help=_('Show service catalog information'),
|
||||
)
|
||||
return parser
|
||||
|
||||
@ -150,8 +151,8 @@ class ShowService(show.ShowOne):
|
||||
info.update(service_endpoints[0])
|
||||
return zip(*sorted(six.iteritems(info)))
|
||||
|
||||
msg = ("No service catalog with a type, name or ID of '%s' "
|
||||
"exists." % (parsed_args.service))
|
||||
msg = _("No service catalog with a type, name or ID of '%s' "
|
||||
"exists.") % (parsed_args.service)
|
||||
raise exceptions.CommandError(msg)
|
||||
else:
|
||||
service = common.find_service(identity_client, parsed_args.service)
|
||||
|
@ -21,6 +21,8 @@ import six
|
||||
from cliff import command
|
||||
from cliff import show
|
||||
|
||||
from openstackclient.i18n import _ # noqa
|
||||
|
||||
|
||||
class IssueToken(show.ShowOne):
|
||||
"""Issue new token"""
|
||||
@ -49,7 +51,7 @@ class RevokeToken(command.Command):
|
||||
parser.add_argument(
|
||||
'token',
|
||||
metavar='<token>',
|
||||
help='Token to be deleted',
|
||||
help=_('Token to be deleted'),
|
||||
)
|
||||
return parser
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user