Doc page about Exceptions is blank

Bug #1276243 reported by Julie Pichon on 2014-02-04
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Kirill Izotov

Bug Description

The "Exceptions" page in the Horizon developer documentations is currently showing blank:

It shouldn't be, there are a lot of docstrings in the exceptions file that should automatically be in there.

Julie Pichon (jpichon) on 2014-02-04
description: updated
Floren (florenllanos) on 2014-02-05
Changed in horizon:
status: New → Confirmed
Kirill Izotov (enykeev) wrote :

It seems like we are having some kind of a circular dependency with django.contrib.auth.

Traceback (most recent call last):ptions
  File "/Users/enykeev/Developer/Work/Openstack/horizon/.venv/lib/python2.7/site-packages/sphinx/ext/", line 321, in import_object
  File "/Users/enykeev/Developer/Work/Openstack/horizon/horizon/", line 25, in <module>
    from django.contrib.auth import logout # noqa
  File "/Users/enykeev/Developer/Work/Openstack/horizon/.venv/lib/python2.7/site-packages/django/contrib/auth/", line 5, in <module>
    from django.middleware.csrf import rotate_token
  File "/Users/enykeev/Developer/Work/Openstack/horizon/.venv/lib/python2.7/site-packages/django/middleware/", line 16, in <module>
    from django.utils.cache import patch_vary_headers
  File "/Users/enykeev/Developer/Work/Openstack/horizon/.venv/lib/python2.7/site-packages/django/utils/", line 26, in <module>
    from django.core.cache import get_cache
  File "/Users/enykeev/Developer/Work/Openstack/horizon/.venv/lib/python2.7/site-packages/django/core/cache/", line 70, in <module>
    if DEFAULT_CACHE_ALIAS not in settings.CACHES:
  File "/Users/enykeev/Developer/Work/Openstack/horizon/.venv/lib/python2.7/site-packages/django/conf/", line 53, in __getattr__
  File "/Users/enykeev/Developer/Work/Openstack/horizon/.venv/lib/python2.7/site-packages/django/conf/", line 48, in _setup
    self._wrapped = Settings(settings_module)
  File "/Users/enykeev/Developer/Work/Openstack/horizon/.venv/lib/python2.7/site-packages/django/conf/", line 132, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)

-- I've hacked it a bit by disabling "try except" in django/conf/ to see the full trace --

  File "/Users/enykeev/Developer/Work/Openstack/horizon/.venv/lib/python2.7/site-packages/django/utils/", line 35, in import_module
  File "/Users/enykeev/Developer/Work/Openstack/horizon/openstack_dashboard/", line 246, in <module>
    from openstack_dashboard import policy
  File "/Users/enykeev/Developer/Work/Openstack/horizon/openstack_dashboard/", line 27, in <module>
    from openstack_auth import utils as auth_utils
  File "/Users/enykeev/Developer/Work/Openstack/horizon/.venv/lib/python2.7/site-packages/openstack_auth/", line 17, in <module>
    from django.contrib import auth
ImportError: cannot import name auth

So, the question here is where should we fix that? My modest experience with Django tells me that we really shouldn't import something from django from inside the openstack_horizon.settings, so the closest point of failure is an import statement within, which should be moved inside 'check' function.

Fix proposed to branch: master

Changed in horizon:
assignee: nobody → Kirill Izotov (enykeev)
status: Confirmed → In Progress
Kirill Izotov (enykeev) wrote :

Also, by fixing this bug, i have uncovered another one related to Sphinx not being able to autodocument functions with @cached_property decorator.

Traceback (most recent call last):de/openstack_dashboard/openstack_dashboard.api.nova
  File "/Users/enykeev/Developer/Work/Openstack/horizon/.venv/lib/python2.7/site-packages/sphinx/ext/", line 326, in import_object
    obj = self.get_attr(obj, part)
  File "/Users/enykeev/Developer/Work/Openstack/horizon/.venv/lib/python2.7/site-packages/sphinx/ext/", line 232, in get_attr
    return safe_getattr(obj, name, *defargs)
  File "/Users/enykeev/Developer/Work/Openstack/horizon/.venv/lib/python2.7/site-packages/sphinx/util/", line 70, in safe_getattr
    raise AttributeError(name)
AttributeError: rules

It looks like something between Sphinx and Django, but i haven't found any records of that neither in google nor in sphinx tracker, so i've decided to brought that up here in case you might already know something about it.

Ana Krivokapić (akrivoka) wrote :

FWIW, I have reported that bug months ago: I'm not sure what the cause is either.

Thierry Carrez (ttx) on 2014-03-05
Changed in horizon:
milestone: icehouse-3 → icehouse-rc1

Submitter: Jenkins
Branch: master

commit 8a237ea34d02100e0e75e14370b4b6b9b5a10083
Author: Kirill Izotov <email address hidden>
Date: Fri Feb 7 17:01:53 2014 +0700

    Fix Exceptions doc page generation

    The problem caused by circular import of django.contrib.auth
    by both horizon.exceptions and openstack_auth.utils
    (through openstack_dashboard.settings)

    Change-Id: I7ad178f5dd7f43bf95a3b2091113725c3415533f
    Closes-Bug: #1276243

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

Other bug subscribers