Lazy translation of messages is not used in OpenStack. This
causes problems for commands which use translatable messages.
The lazy translation effort was abandoned several years ago.
Change-Id: Iab3d772d7ad9958b54f095b45387a6eb463ce5e6
Related-Bug: #1801761
Since eventlet 0.17, ipv6 is support for dns and getaddrinfo.
Glance depends on 0.18.2, so the workaround is no more needed.
a6ce444265
Related-bug: #1655727
Change-Id: Ic2bdc9a780ee98df87a7cdd5413a9db42e5e7131
Import i18n functions from module directly and do not use
global module variables like _ = i18n._. It makes code shorter
and cleaner. It also to detect cases when these functions are not
used in module.
Change-Id: Iaa593ac1f2dd15cbcad049bef6ba68f1cfa610da
If dnspython is present in the environment then eventlet
monkeypatches socket.getaddrinfo() with an implementation
which doesn't work for IPv6.
This patch has also been applied to other Openstack
projects such as nova (f2e49ad3) and keystone (3afd9791)
in order to work around the same problem and is
intended to be used in the same way.
Co-authored-by: Hui Xiang <hui.xiang@canonical.com>
Closes-Bug: 1331885
Change-Id: I795e004eac3f032217ff9cb0047f1976306fbb71
The builtin _ should not longer be used. Instead _
should be explicitly assigned from glance.i18n.
This patch does the following:
(1) adds these explict assignments to any
glance file that was missing them,
(2) removes the defintion of _ as a builtin from
tox.ini so that a pep8 failure will occur
if _ is not defined,
(3) removes calls to install().
This removes the last direct use of gettextutils by glance.
The indirect uses, via openstack/common, will be removed
in the next sync with oslo.
Change-Id: Ie54e8a67e747e022cc01022dfad35d89686bdfc4
oslo.i18n has recently been released. This patch switches glance over
oslo.i18n. As per oslo.i18n's instructions, a new i18n module has been
added under glance. This module defines the translation globals and
imports the necessary functions from oslo.i18n.
The patch doesn't change the way Glance does translation, this means
that a `_` function is still being injected to the builtins.
Note that the gettextutils module is still a required module from
oslo-inc because there are oslo-inc modules that depend on the old
gettextutils module.
Change-Id: Ieb83681e35f72a5a4ecd849bb76af7f78d9fdcb0
Add support for doing language resolution for a request,
based on the Accept-Language HTTP header. For example,
an HTTP client can receive API messages in Chinese even
if the locale language of the server is English.
The underscore (_) method is initialized so that it returns
openstack.common.gettextutils.Message objects. The locale
of these Message objects is set when exceptions with which
they are associated are raised in the context of an HTTP
request.
docImpact
Partially implements bp i18n-messages
Signed-off-by: Fei Long Wang <flwang@cn.ibm.com>
Signed-off-by: John Warren <jswarren@us.ibm.com>
Change-Id: I352cda57fe119022c59c6c813b5c8053765b2d3c
Part of fixing bug #995287
Syncs these two commits from oslo-incubator:
Support overriding oslo localedir too
Add a gettextutils.install() helper function
to get a new gettextutils.install() function which allows the default
localedir to be overwritten via an environment variable.
Note that gettextutils.install() must be called before any other glance
modules are imported since some modules attempt to translate strings
at import time (e.g. the help strings for config options in config.py).
This is broken and inefficient, but fixing it involves adding something
like spinx's l_() function and would be very invaisve.
Also, note that calling gettextutils.install() in glance.cmd.__init__
means that no program which uses a different translation domain should
ever import any of the modules under glance.cmd.
Change-Id: I86562b3a65d371673bb21f7179eecc7602bc0775
The executable programs used by Glance have historically been scripts
in the ./bin directory. This patch converts all of the scripts to
entry_points. This change makes these programs python modules. Thus
they can be imported and methods in them can be called just like any
other module. This will allow the tests to call into these programs
directly instead of having to fork out a process.
The conf.py file in the doc tree was causing a name collision with
the python module cmd. The glance/glance directory was being added
to sys.path which made glance.cmd import with the name cmd. This
patch also fixes that problem.
blueprint: refactoring-better-faster-stronger-functional-tests
Change-Id: I67ae14b7403af31a5944befcd2ec27a690e81f15