Merge "Mark identity v2 resources for translation"

This commit is contained in:
Jenkins 2014-10-12 18:50:27 +00:00 committed by Gerrit Code Review
commit 49c74229b4
7 changed files with 64 additions and 60 deletions

View File

@ -20,6 +20,7 @@ from cliff import lister
from cliff import show from cliff import show
from openstackclient.common import utils from openstackclient.common import utils
from openstackclient.i18n import _ # noqa
def _format_endpoints(eps=None): def _format_endpoints(eps=None):
@ -67,7 +68,7 @@ class ShowCatalog(show.ShowOne):
parser.add_argument( parser.add_argument(
'service', 'service',
metavar='<service>', metavar='<service>',
help='Service to display (type, name or ID)', help=_('Service to display (type, name or ID)'),
) )
return parser return parser

View File

@ -24,6 +24,7 @@ from cliff import lister
from cliff import show from cliff import show
from openstackclient.common import utils from openstackclient.common import utils
from openstackclient.i18n import _ # noqa
class CreateEC2Creds(show.ShowOne): class CreateEC2Creds(show.ShowOne):
@ -36,12 +37,12 @@ class CreateEC2Creds(show.ShowOne):
parser.add_argument( parser.add_argument(
'--project', '--project',
metavar='<project>', metavar='<project>',
help='Specify a project [admin only]', help=_('Specify a project [admin only]'),
) )
parser.add_argument( parser.add_argument(
'--user', '--user',
metavar='<user>', metavar='<user>',
help='Specify a user [admin only]', help=_('Specify a user [admin only]'),
) )
return parser return parser
@ -83,12 +84,12 @@ class DeleteEC2Creds(command.Command):
parser.add_argument( parser.add_argument(
'access_key', 'access_key',
metavar='<access-key>', metavar='<access-key>',
help='Credentials access key', help=_('Credentials access key'),
) )
parser.add_argument( parser.add_argument(
'--user', '--user',
metavar='<user>', metavar='<user>',
help='Specify a user [admin only]', help=_('Specify a user [admin only]'),
) )
return parser return parser
@ -118,7 +119,7 @@ class ListEC2Creds(lister.Lister):
parser.add_argument( parser.add_argument(
'--user', '--user',
metavar='<user>', metavar='<user>',
help='Specify a user [admin only]', help=_('Specify a user [admin only]'),
) )
return parser return parser
@ -156,12 +157,12 @@ class ShowEC2Creds(show.ShowOne):
parser.add_argument( parser.add_argument(
'access_key', 'access_key',
metavar='<access-key>', metavar='<access-key>',
help='Credentials access key', help=_('Credentials access key'),
) )
parser.add_argument( parser.add_argument(
'--user', '--user',
metavar='<user>', metavar='<user>',
help='Specify a user [admin only]', help=_('Specify a user [admin only]'),
) )
return parser return parser

View File

@ -23,6 +23,7 @@ from cliff import lister
from cliff import show from cliff import show
from openstackclient.common import utils from openstackclient.common import utils
from openstackclient.i18n import _ # noqa
from openstackclient.identity import common from openstackclient.identity import common
@ -36,24 +37,24 @@ class CreateEndpoint(show.ShowOne):
parser.add_argument( parser.add_argument(
'service', 'service',
metavar='<endpoint-service>', metavar='<endpoint-service>',
help='New endpoint service') help=_('New endpoint service'))
parser.add_argument( parser.add_argument(
'--region', '--region',
metavar='<region>', metavar='<region>',
help='New endpoint region') help=_('New endpoint region'))
parser.add_argument( parser.add_argument(
'--publicurl', '--publicurl',
metavar='<public-url>', metavar='<public-url>',
required=True, required=True,
help='New endpoint public URL') help=_('New endpoint public URL'))
parser.add_argument( parser.add_argument(
'--adminurl', '--adminurl',
metavar='<admin-url>', metavar='<admin-url>',
help='New endpoint admin URL') help=_('New endpoint admin URL'))
parser.add_argument( parser.add_argument(
'--internalurl', '--internalurl',
metavar='<internal-url>', metavar='<internal-url>',
help='New endpoint internal URL') help=_('New endpoint internal URL'))
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
@ -84,7 +85,7 @@ class DeleteEndpoint(command.Command):
parser.add_argument( parser.add_argument(
'endpoint', 'endpoint',
metavar='<endpoint-id>', metavar='<endpoint-id>',
help='ID of endpoint to delete') help=_('ID of endpoint to delete'))
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
@ -105,7 +106,7 @@ class ListEndpoint(lister.Lister):
'--long', '--long',
action='store_true', action='store_true',
default=False, default=False,
help='List additional fields in output') help=_('List additional fields in output'))
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
@ -139,7 +140,7 @@ class ShowEndpoint(show.ShowOne):
parser.add_argument( parser.add_argument(
'endpoint_or_service', 'endpoint_or_service',
metavar='<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 return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):

View File

@ -21,10 +21,11 @@ import six
from cliff import command from cliff import command
from cliff import lister from cliff import lister
from cliff import show from cliff import show
from keystoneclient.openstack.common.apiclient import exceptions as ksc_exc from keystoneclient.openstack.common.apiclient import exceptions as ksc_exc
from openstackclient.common import parseractions from openstackclient.common import parseractions
from openstackclient.common import utils from openstackclient.common import utils
from openstackclient.i18n import _ # noqa
class CreateProject(show.ShowOne): class CreateProject(show.ShowOne):
@ -37,30 +38,30 @@ class CreateProject(show.ShowOne):
parser.add_argument( parser.add_argument(
'name', 'name',
metavar='<project-name>', metavar='<project-name>',
help='New project name', help=_('New project name'),
) )
parser.add_argument( parser.add_argument(
'--description', '--description',
metavar='<project-description>', metavar='<project-description>',
help='New project description', help=_('New project description'),
) )
enable_group = parser.add_mutually_exclusive_group() enable_group = parser.add_mutually_exclusive_group()
enable_group.add_argument( enable_group.add_argument(
'--enable', '--enable',
action='store_true', action='store_true',
help='Enable project (default)', help=_('Enable project (default)'),
) )
enable_group.add_argument( enable_group.add_argument(
'--disable', '--disable',
action='store_true', action='store_true',
help='Disable project', help=_('Disable project'),
) )
parser.add_argument( parser.add_argument(
'--property', '--property',
metavar='<key=value>', metavar='<key=value>',
action=parseractions.KeyValueAction, action=parseractions.KeyValueAction,
help='Property to add for this project ' help=_('Property to add for this project '
'(repeat option to set multiple properties)', '(repeat option to set multiple properties)'),
) )
return parser return parser
@ -97,7 +98,7 @@ class DeleteProject(command.Command):
parser.add_argument( parser.add_argument(
'project', 'project',
metavar='<project>', metavar='<project>',
help='Project to delete (name or ID)', help=_('Project to delete (name or ID)'),
) )
return parser return parser
@ -125,7 +126,7 @@ class ListProject(lister.Lister):
'--long', '--long',
action='store_true', action='store_true',
default=False, default=False,
help='List additional fields in output', help=_('List additional fields in output'),
) )
return parser return parser
@ -153,35 +154,35 @@ class SetProject(command.Command):
parser.add_argument( parser.add_argument(
'project', 'project',
metavar='<project>', metavar='<project>',
help='Project to change (name or ID)', help=_('Project to change (name or ID)'),
) )
parser.add_argument( parser.add_argument(
'--name', '--name',
metavar='<new-project-name>', metavar='<new-project-name>',
help='New project name', help=_('New project name'),
) )
parser.add_argument( parser.add_argument(
'--description', '--description',
metavar='<project-description>', metavar='<project-description>',
help='New project description', help=_('New project description'),
) )
enable_group = parser.add_mutually_exclusive_group() enable_group = parser.add_mutually_exclusive_group()
enable_group.add_argument( enable_group.add_argument(
'--enable', '--enable',
action='store_true', action='store_true',
help='Enable project', help=_('Enable project'),
) )
enable_group.add_argument( enable_group.add_argument(
'--disable', '--disable',
action='store_true', action='store_true',
help='Disable project', help=_('Disable project'),
) )
parser.add_argument( parser.add_argument(
'--property', '--property',
metavar='<key=value>', metavar='<key=value>',
action=parseractions.KeyValueAction, action=parseractions.KeyValueAction,
help='Property to add for this project ' help=_('Property to add for this project '
'(repeat option to set multiple properties)', '(repeat option to set multiple properties)'),
) )
return parser return parser
@ -233,7 +234,7 @@ class ShowProject(show.ShowOne):
parser.add_argument( parser.add_argument(
'project', 'project',
metavar='<project>', metavar='<project>',
help='Project to display (name or ID)') help=_('Project to display (name or ID)'))
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):

View File

@ -24,6 +24,7 @@ from cliff import show
from openstackclient.common import exceptions from openstackclient.common import exceptions
from openstackclient.common import utils from openstackclient.common import utils
from openstackclient.i18n import _ # noqa
class AddRole(show.ShowOne): class AddRole(show.ShowOne):
@ -36,18 +37,17 @@ class AddRole(show.ShowOne):
parser.add_argument( parser.add_argument(
'role', 'role',
metavar='<role>', metavar='<role>',
help='Role name or ID to add to user') help=_('Role name or ID to add to user'))
parser.add_argument( parser.add_argument(
'--project', '--project',
metavar='<project>', metavar='<project>',
required=True, required=True,
help='Include project (name or ID)', help=_('Include project (name or ID)'))
)
parser.add_argument( parser.add_argument(
'--user', '--user',
metavar='<user>', metavar='<user>',
required=True, required=True,
help='Name or ID of user to include') help=_('Name or ID of user to include'))
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
@ -80,7 +80,7 @@ class CreateRole(show.ShowOne):
parser.add_argument( parser.add_argument(
'role_name', 'role_name',
metavar='<role-name>', metavar='<role-name>',
help='New role name') help=_('New role name'))
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
@ -103,8 +103,7 @@ class DeleteRole(command.Command):
parser.add_argument( parser.add_argument(
'role', 'role',
metavar='<role>', metavar='<role>',
help='Name or ID of role to delete', help=_('Name or ID of role to delete'))
)
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
@ -147,12 +146,11 @@ class ListUserRole(lister.Lister):
'user', 'user',
metavar='<user>', metavar='<user>',
nargs='?', nargs='?',
help='Name or ID of user to include') help=_('Name or ID of user to include'))
parser.add_argument( parser.add_argument(
'--project', '--project',
metavar='<project>', metavar='<project>',
help='Include project (name or ID)', help=_('Include project (name or ID)'))
)
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
@ -167,13 +165,13 @@ class ListUserRole(lister.Lister):
if self.app.client_manager.auth_ref: if self.app.client_manager.auth_ref:
parsed_args.project = auth_ref.project_id parsed_args.project = auth_ref.project_id
else: else:
msg = "Project must be specified" msg = _("Project must be specified")
raise exceptions.CommandError(msg) raise exceptions.CommandError(msg)
if not parsed_args.user: if not parsed_args.user:
if self.app.client_manager.auth_ref: if self.app.client_manager.auth_ref:
parsed_args.user = auth_ref.user_id parsed_args.user = auth_ref.user_id
else: else:
msg = "User must be specified" msg = _("User must be specified")
raise exceptions.CommandError(msg) raise exceptions.CommandError(msg)
project = utils.find_resource( project = utils.find_resource(
@ -213,18 +211,17 @@ class RemoveRole(command.Command):
parser.add_argument( parser.add_argument(
'role', 'role',
metavar='<role>', metavar='<role>',
help='Role name or ID to remove from user') help=_('Role name or ID to remove from user'))
parser.add_argument( parser.add_argument(
'--project', '--project',
metavar='<project>', metavar='<project>',
required=True, required=True,
help='Project to include (name or ID)', help=_('Project to include (name or ID)'))
)
parser.add_argument( parser.add_argument(
'--user', '--user',
metavar='<user>', metavar='<user>',
required=True, required=True,
help='Name or ID of user') help=_('Name or ID of user'))
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
@ -252,7 +249,7 @@ class ShowRole(show.ShowOne):
parser.add_argument( parser.add_argument(
'role', 'role',
metavar='<role>', metavar='<role>',
help='Name or ID of role to display') help=_('Name or ID of role to display'))
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):

View File

@ -24,6 +24,7 @@ from cliff import show
from openstackclient.common import exceptions from openstackclient.common import exceptions
from openstackclient.common import utils from openstackclient.common import utils
from openstackclient.i18n import _ # noqa
from openstackclient.identity import common from openstackclient.identity import common
@ -37,18 +38,18 @@ class CreateService(show.ShowOne):
parser.add_argument( parser.add_argument(
'name', 'name',
metavar='<service-name>', metavar='<service-name>',
help='New service name', help=_('New service name'),
) )
parser.add_argument( parser.add_argument(
'--type', '--type',
metavar='<service-type>', metavar='<service-type>',
required=True, required=True,
help='New service type (compute, image, identity, volume, etc)', help=_('New service type (compute, image, identity, volume, etc)'),
) )
parser.add_argument( parser.add_argument(
'--description', '--description',
metavar='<service-description>', metavar='<service-description>',
help='New service description', help=_('New service description'),
) )
return parser return parser
@ -76,7 +77,7 @@ class DeleteService(command.Command):
parser.add_argument( parser.add_argument(
'service', 'service',
metavar='<service>', metavar='<service>',
help='Service to delete (name or ID)', help=_('Service to delete (name or ID)'),
) )
return parser return parser
@ -99,7 +100,7 @@ class ListService(lister.Lister):
'--long', '--long',
action='store_true', action='store_true',
default=False, default=False,
help='List additional fields in output') help=_('List additional fields in output'))
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
@ -127,13 +128,13 @@ class ShowService(show.ShowOne):
parser.add_argument( parser.add_argument(
'service', 'service',
metavar='<service>', metavar='<service>',
help='Service to display (type, name or ID)', help=_('Service to display (type, name or ID)'),
) )
parser.add_argument( parser.add_argument(
'--catalog', '--catalog',
action='store_true', action='store_true',
default=False, default=False,
help='Show service catalog information', help=_('Show service catalog information'),
) )
return parser return parser
@ -150,8 +151,8 @@ class ShowService(show.ShowOne):
info.update(service_endpoints[0]) info.update(service_endpoints[0])
return zip(*sorted(six.iteritems(info))) return zip(*sorted(six.iteritems(info)))
msg = ("No service catalog with a type, name or ID of '%s' " msg = _("No service catalog with a type, name or ID of '%s' "
"exists." % (parsed_args.service)) "exists.") % (parsed_args.service)
raise exceptions.CommandError(msg) raise exceptions.CommandError(msg)
else: else:
service = common.find_service(identity_client, parsed_args.service) service = common.find_service(identity_client, parsed_args.service)

View File

@ -21,6 +21,8 @@ import six
from cliff import command from cliff import command
from cliff import show from cliff import show
from openstackclient.i18n import _ # noqa
class IssueToken(show.ShowOne): class IssueToken(show.ShowOne):
"""Issue new token""" """Issue new token"""
@ -49,7 +51,7 @@ class RevokeToken(command.Command):
parser.add_argument( parser.add_argument(
'token', 'token',
metavar='<token>', metavar='<token>',
help='Token to be deleted', help=_('Token to be deleted'),
) )
return parser return parser