Use of _ without importing it - "NameError: name '_' is not defined"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Triaged
|
Low
|
Unassigned |
Bug Description
To reproduce start main function in glance/
There is exception in devstack:
File "/opt/stack/
from glance.common import utils
File "/opt/stack/
from glance.common import exception
File "/opt/stack/
class GlanceException
File "/opt/stack/
message = _("An unknown exception occurred")
NameError: name '_' is not defined
Process finished with exit code 1
Seems to be similar to bug #885529
I think one of the possible solution (which works for me) is to put in glance/
from glance.
gettextutils.
Check with glance:2015.1
Changed in glance: | |
assignee: | nobody → Roman Vasilets (rvasilets) |
tags: | added: low-hanging-fruit |
Keystone had ongoing issues similar to this, and ultimately moved away from importing gettextutils via entry points (as you're suggesting is the fix here, and will probably work in this one case) to instead do explicit imports into every module where gettextutils is used, which has been much more reliable.