_ seems to have gone missing

Bug #1209406 reported by Joshua Harlow on 2013-08-07
This bug affects 1 person
Affects Status Importance Assigned to Milestone
John Griffith

Bug Description

It seems like builds are now failing due to the following.

>>> from cinder.volume import utils as volume_utils
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "cinder/volume/__init__.py", line 29, in <module>
    API = import_utils.import_class(CONF.volume_api_class)
  File "cinder/openstack/common/importutils.py", line 30, in import_class
  File "cinder/volume/api.py", line 28, in <module>
    from cinder import context
  File "cinder/context.py", line 28, in <module>
    from cinder import policy
  File "cinder/policy.py", line 23, in <module>
    from cinder import exception
  File "cinder/exception.py", line 84, in <module>
    class CinderException(Exception):
  File "cinder/exception.py", line 92, in CinderException
    message = _("An unknown exception occurred.")
NameError: name '_' is not defined

Has '_' been moved somewhere by a dependent project.

Scott DAngelo (scott-dangelo) wrote :

It could be caused by commit 7cfb0388fff7a1282141ed50b9b6d6cf65af55a1

Remove gettext.install() from cinder/__init__.py

John Griffith (john-griffith) wrote :

from openstack.common.gettextutils import _

Changed in cinder:
status: New → Invalid
John Griffith (john-griffith) wrote :

BTW, I marked as invalid as I haven't seen this or reproduced it and I *think* the patch set you were running into this on you found the issue and addressed it. If I'm wrong here feel free to re-open or ping me.

Wang Bo (chestack) wrote :

@ John Griffith
I am confused why there is no "from openstack.common.gettextutils import _" in cinder/exception.py ?

It will report this Error when I use sphinx to build cinder doc. This Error showed up in the following four files:
Missing "from openstack.common.gettextutils import _" in these files caused this Error. Is this not a bug or a defect?

wangchy (wangchy) on 2013-08-30
Changed in cinder:
status: Invalid → Incomplete
wangchy (wangchy) wrote :

gettext.install() was removed from cinder/__init__.py with this commit https://review.openstack.org/#/c/28543/2.
But this is needed for doc build with sphinx because the toplevel script is not any of the scripts under path "bin", but cinder/api/openstack/__init__.py. Without gettext.install() invoked in cinder/api/openstack/__init__.py, sphinx-build will fail and no docs on APIs can be generated. I thinks the cases are the same withe other components including nova, neutron, etc.

wangchy (wangchy) wrote :

I changed the status to new because this should be an issue for it introduces errors in doc build, although it does not affect runtime functions. It should not be changed in invalid .

Changed in cinder:
status: Incomplete → New
Changed in cinder:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → John Griffith (john-griffith)
milestone: none → icehouse-1

Fix proposed to branch: master
Review: https://review.openstack.org/51993

Changed in cinder:
status: Triaged → In Progress

Reviewed: https://review.openstack.org/51993
Committed: http://github.com/openstack/cinder/commit/d80657c2ef1658e7383a12537e55b7e1a64fafac
Submitter: Jenkins
Branch: master

commit d80657c2ef1658e7383a12537e55b7e1a64fafac
Author: John Griffith <email address hidden>
Date: Tue Oct 15 20:51:07 2013 -0600

    Provide gettext _ in missing locations

    A while back a change was merged that moved
    our shortcut for gettext out of __init__
    (change here: If4125d6bcbde63df95de129ac5c83b4a6d6f130a)

    This worked out fine for the most part but broke the sphinx doc
    builder for a number of files. This patch just adds the proper
    import to each of these files to get the builder working correctly

    Change-Id: Ifed20d309566be456c9519294714ccb45de76e00
    Closes-Bug: #1209406

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-12-04
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2014-04-17
Changed in cinder:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers