From f34a7bb0d8b8dd9df2e7138bd46002e1c432a439 Mon Sep 17 00:00:00 2001 From: shizhihui Date: Wed, 31 Aug 2016 18:49:10 +0800 Subject: [PATCH] Trivial:Standardize the output format of 'help' in some files In some files,it is possible that we import '_'from heat.commom.i18n. For more information: [1]http://docs.openstack.org/developer/oslo.i18n/usage.html Change-Id: I545b9e51111a9c9c542e3089bef1490a3ba3a40b --- bin/heat-keystone-setup-domain | 21 +++++++++++---------- heat/cmd/manage.py | 2 +- heat/engine/notification/__init__.py | 6 ++++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/bin/heat-keystone-setup-domain b/bin/heat-keystone-setup-domain index f8ce074548..d61393e108 100755 --- a/bin/heat-keystone-setup-domain +++ b/bin/heat-keystone-setup-domain @@ -20,6 +20,7 @@ from keystoneclient.v3 import client from oslo_config import cfg from oslo_log import log as logging +from heat.common.i18n import _ from heat import version logger = logging.getLogger(__name__) @@ -33,25 +34,25 @@ TENANT_NAME = os.environ.get('OS_TENANT_NAME') opts = [ cfg.StrOpt('stack-user-domain-name', default="heat", - help="Name of domain to create for stack users."), + help=_("Name of domain to create for stack users.")), cfg.StrOpt('stack-domain-admin', default="heat_stack_admin", - help="Keystone username with roles sufficient to manage users" - " and projects in the stack-user-domain"), + help=_("Keystone username with roles sufficient to manage users" + " and projects in the stack-user-domain")), cfg.StrOpt('stack-domain-admin-password', secret=True, - help="Password to set for stack-domain-admin"), + help=_("Password to set for stack-domain-admin")), cfg.BoolOpt('insecure', default=False, - help="If set, then the server's certificate will not " - "be verified."), + help=_("If set, then the server's certificate will not " + "be verified.")), cfg.StrOpt('os-cacert', - help='Optional CA cert file to use in SSL connections.'), + help=_('Optional CA cert file to use in SSL connections.')), cfg.StrOpt('os-cert', - help='Optional PEM-formatted certificate chain file.'), + help=_('Optional PEM-formatted certificate chain file.')), cfg.StrOpt('os-key', - help='Optional PEM-formatted file that contains the ' - 'private key.'), + help=_('Optional PEM-formatted file that contains the ' + 'private key.')), ] diff --git a/heat/cmd/manage.py b/heat/cmd/manage.py index e7669b5834..0bda99907e 100644 --- a/heat/cmd/manage.py +++ b/heat/cmd/manage.py @@ -212,7 +212,7 @@ def add_command_parsers(subparsers): command_opt = cfg.SubCommandOpt('command', title='Commands', - help='Show available commands.', + help=_('Show available commands.'), handler=add_command_parsers) diff --git a/heat/engine/notification/__init__.py b/heat/engine/notification/__init__.py index 08ec719a75..3cd53ea750 100644 --- a/heat/engine/notification/__init__.py +++ b/heat/engine/notification/__init__.py @@ -13,6 +13,7 @@ from oslo_config import cfg +from heat.common.i18n import _ from heat.common import messaging SERVICE = 'orchestration' @@ -22,9 +23,10 @@ ERROR = 'ERROR' notifier_opts = [ cfg.StrOpt('default_notification_level', default=INFO, - help='Default notification level for outgoing notifications.'), + help=_('Default notification level for outgoing' + 'notifications.')), cfg.StrOpt('default_publisher_id', - help='Default publisher_id for outgoing notifications.'), + help=_('Default publisher_id for outgoing notifications.')), ] CONF = cfg.CONF CONF.register_opts(notifier_opts)