Optimize helpinfo in zun/conf
Remove function _() from zun/conf. Currently, some configs helpinfo has translation and the others do not, which is inconsistent. There are two options to resolve this. The first option is to remove all translation from config. The second option is to enforce translation for all configs. This commit suggested the first option because configs are not directly exposed to end-users so the value of translated configs helpinfo is not too much. Change-Id: Iadd8333b5156696477b4dced01077e77fa42afb2
This commit is contained in:
parent
5ad57fe12c
commit
9bb3f6ea4b
@ -12,7 +12,6 @@
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from zun.common.i18n import _
|
||||
|
||||
api_service_opts = [
|
||||
cfg.PortOpt('port',
|
||||
@ -23,15 +22,15 @@ api_service_opts = [
|
||||
help='The listen IP for the zun API server.'),
|
||||
cfg.BoolOpt('enable_ssl_api',
|
||||
default=False,
|
||||
help=_("Enable the integrated stand-alone API to service "
|
||||
"requests via HTTPS instead of HTTP. If there is a "
|
||||
"front-end service performing HTTPS offloading from "
|
||||
"the service, this option should be False; note, you "
|
||||
"will want to change public API endpoint to represent "
|
||||
"SSL termination URL with 'public_endpoint' option.")),
|
||||
help="Enable the integrated stand-alone API to service "
|
||||
"requests via HTTPS instead of HTTP. If there is a "
|
||||
"front-end service performing HTTPS offloading from "
|
||||
"the service, this option should be False; note, you "
|
||||
"will want to change public API endpoint to represent "
|
||||
"SSL termination URL with 'public_endpoint' option."),
|
||||
cfg.IntOpt('workers',
|
||||
help=_("Number of workers for zun-api service. "
|
||||
"The default will be the number of CPUs available.")),
|
||||
help="Number of workers for zun-api service. "
|
||||
"The default will be the number of CPUs available."),
|
||||
cfg.IntOpt('max_limit',
|
||||
default=1000,
|
||||
help='The maximum number of items returned in a single '
|
||||
|
@ -14,30 +14,29 @@
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from zun.common.i18n import _
|
||||
|
||||
db_opts = [
|
||||
# TODO(yuywz): Change to etcd after all etcd db driver code is landed
|
||||
cfg.StrOpt('db_type',
|
||||
default='sql',
|
||||
help=_('Defines which db type to use for storing container. '
|
||||
'Possible Values: sql, etcd'))
|
||||
help='Defines which db type to use for storing container. '
|
||||
'Possible Values: sql, etcd')
|
||||
]
|
||||
|
||||
sql_opts = [
|
||||
cfg.StrOpt('mysql_engine',
|
||||
default='InnoDB',
|
||||
help=_('MySQL engine to use.'))
|
||||
help='MySQL engine to use.')
|
||||
]
|
||||
|
||||
etcd_opts = [
|
||||
cfg.HostAddressOpt('etcd_host',
|
||||
default='127.0.0.1',
|
||||
help=_("Host IP address on which etcd service "
|
||||
"running.")),
|
||||
help="Host IP address on which etcd service "
|
||||
"running."),
|
||||
cfg.PortOpt('etcd_port',
|
||||
default=2379,
|
||||
help=_("Port on which etcd listen client request."))
|
||||
help="Port on which etcd listen client request.")
|
||||
]
|
||||
|
||||
etcd_group = cfg.OptGroup(name='etcd', title='Options for etcd connection')
|
||||
|
@ -16,37 +16,34 @@
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from zun.common.i18n import _
|
||||
|
||||
|
||||
glance_group = cfg.OptGroup(name='glance_client',
|
||||
title='Options for the Glance client')
|
||||
|
||||
common_security_opts = [
|
||||
cfg.StrOpt('ca_file',
|
||||
help=_('Optional CA cert file to use in SSL connections.')),
|
||||
help='Optional CA cert file to use in SSL connections.'),
|
||||
cfg.StrOpt('cert_file',
|
||||
help=_('Optional PEM-formatted certificate chain file.')),
|
||||
help='Optional PEM-formatted certificate chain file.'),
|
||||
cfg.StrOpt('key_file',
|
||||
help=_('Optional PEM-formatted file that contains the '
|
||||
'private key.')),
|
||||
help='Optional PEM-formatted file that contains the '
|
||||
'private key.'),
|
||||
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.")]
|
||||
|
||||
glance_client_opts = [
|
||||
cfg.StrOpt('region_name',
|
||||
help=_('Region in Identity service catalog to use for '
|
||||
'communication with the OpenStack service.')),
|
||||
help='Region in Identity service catalog to use for '
|
||||
'communication with the OpenStack service.'),
|
||||
cfg.StrOpt('endpoint_type',
|
||||
default='publicURL',
|
||||
help=_(
|
||||
'Type of endpoint in Identity service catalog to use '
|
||||
'for communication with the OpenStack service.')),
|
||||
help='Type of endpoint in Identity service catalog to use '
|
||||
'for communication with the OpenStack service.'),
|
||||
cfg.StrOpt('api_version',
|
||||
default='2',
|
||||
help=_('Version of Glance API to use in glanceclient.'))]
|
||||
help='Version of Glance API to use in glanceclient.')]
|
||||
|
||||
|
||||
ALL_OPTS = (glance_client_opts + common_security_opts)
|
||||
|
@ -12,31 +12,28 @@
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from zun.common.i18n import _
|
||||
|
||||
|
||||
neutron_group = cfg.OptGroup(name='neutron_client',
|
||||
title='Options for the Neutron client')
|
||||
|
||||
common_security_opts = [
|
||||
cfg.StrOpt('ca_file',
|
||||
help=_('Optional CA cert file to use in SSL connections.')),
|
||||
help='Optional CA cert file to use in SSL connections.'),
|
||||
cfg.StrOpt('cert_file',
|
||||
help=_('Optional PEM-formatted certificate chain file.')),
|
||||
help='Optional PEM-formatted certificate chain file.'),
|
||||
cfg.StrOpt('key_file',
|
||||
help=_('Optional PEM-formatted file that contains the '
|
||||
'private key.')),
|
||||
help='Optional PEM-formatted file that contains the '
|
||||
'private key.'),
|
||||
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.")]
|
||||
|
||||
neutron_client_opts = [
|
||||
cfg.StrOpt('endpoint_type',
|
||||
default='publicURL',
|
||||
help=_(
|
||||
'Type of endpoint in Identity service catalog to use '
|
||||
'for communication with the OpenStack service.'))]
|
||||
help='Type of endpoint in Identity service catalog to use '
|
||||
'for communication with the OpenStack service.')]
|
||||
|
||||
|
||||
ALL_OPTS = (neutron_client_opts + common_security_opts)
|
||||
|
@ -16,29 +16,27 @@
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from zun.common.i18n import _
|
||||
|
||||
|
||||
nova_group = cfg.OptGroup(name='nova_client',
|
||||
title='Options for the Nova client')
|
||||
|
||||
common_security_opts = [
|
||||
cfg.StrOpt('ca_file',
|
||||
help=_('Optional CA cert file to use in SSL connections.')),
|
||||
help='Optional CA cert file to use in SSL connections.'),
|
||||
cfg.StrOpt('cert_file',
|
||||
help=_('Optional PEM-formatted certificate chain file.')),
|
||||
help='Optional PEM-formatted certificate chain file.'),
|
||||
cfg.StrOpt('key_file',
|
||||
help=_('Optional PEM-formatted file that contains the '
|
||||
'private key.')),
|
||||
help='Optional PEM-formatted file that contains the '
|
||||
'private key.'),
|
||||
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.")]
|
||||
|
||||
nova_client_opts = [
|
||||
cfg.StrOpt('api_version',
|
||||
default='2.37',
|
||||
help=_('Version of Nova API to use in novaclient.'))]
|
||||
help='Version of Nova API to use in novaclient.')]
|
||||
|
||||
|
||||
ALL_OPTS = (nova_client_opts + common_security_opts)
|
||||
|
@ -18,18 +18,17 @@ import socket
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from zun.common.i18n import _
|
||||
|
||||
service_opts = [
|
||||
cfg.HostAddressOpt('host',
|
||||
default=socket.gethostname(),
|
||||
sample_default='localhost',
|
||||
help=_('Name of this node. This can be an '
|
||||
'opaque identifier. It is not necessarily '
|
||||
'a hostname, FQDN, or IP address. '
|
||||
'However, the node name must be valid '
|
||||
'within an AMQP key, and if using ZeroMQ, '
|
||||
'a valid hostname, FQDN, or IP address.')),
|
||||
help='Name of this node. This can be an '
|
||||
'opaque identifier. It is not necessarily '
|
||||
'a hostname, FQDN, or IP address. '
|
||||
'However, the node name must be valid '
|
||||
'within an AMQP key, and if using ZeroMQ, '
|
||||
'a valid hostname, FQDN, or IP address.'),
|
||||
]
|
||||
|
||||
periodic_opts = [
|
||||
|
@ -16,34 +16,32 @@
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from zun.common.i18n import _
|
||||
|
||||
zun_group = cfg.OptGroup(name='zun_client',
|
||||
title='Options for the Zun client')
|
||||
|
||||
zun_client_opts = [
|
||||
cfg.StrOpt('region_name',
|
||||
help=_('Region in Identity service catalog to use for '
|
||||
'communication with the OpenStack service.')),
|
||||
help='Region in Identity service catalog to use for '
|
||||
'communication with the OpenStack service.'),
|
||||
cfg.StrOpt('endpoint_type',
|
||||
default='publicURL',
|
||||
help=_(
|
||||
'Type of endpoint in Identity service catalog to use '
|
||||
'for communication with the OpenStack service.'))]
|
||||
help='Type of endpoint in Identity service catalog to use '
|
||||
'for communication with the OpenStack service.')]
|
||||
|
||||
|
||||
common_security_opts = [
|
||||
cfg.StrOpt('ca_file',
|
||||
help=_('Optional CA cert file to use in SSL connections.')),
|
||||
help='Optional CA cert file to use in SSL connections.'),
|
||||
cfg.StrOpt('cert_file',
|
||||
help=_('Optional PEM-formatted certificate chain file.')),
|
||||
help='Optional PEM-formatted certificate chain file.'),
|
||||
cfg.StrOpt('key_file',
|
||||
help=_('Optional PEM-formatted file that contains the '
|
||||
'private key.')),
|
||||
help='Optional PEM-formatted file that contains the '
|
||||
'private key.'),
|
||||
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.")]
|
||||
|
||||
ALL_OPTS = (zun_client_opts + common_security_opts)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user