Can't login with master django_openstack_auth: 'module' object has no attribute 'Login'

Bug #1332149 reported by Julie Pichon
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Critical
Julie Pichon
Havana
Fix Released
Undecided
Unassigned
Icehouse
Fix Released
Critical
David Lyle

Bug Description

One of the recent django_openstack_auth cleanup patches (2ead8838e72ff02ced36133866046c4c1a7c0931) removed a relative import that Horizon was incorrectly relying on.

Traceback:
File "/opt/stack/horizon/.venv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  112. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/stack/horizon/.venv/lib/python2.7/site-packages/django/views/decorators/vary.py" in inner_func
  36. response = func(*args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/views.py" in splash
  43. form = views.Login(request)

Exception Type: AttributeError at /
Exception Value: 'module' object has no attribute 'Login'

The "Login" form should be imported directly from forms.py, not indirectly from views.py.

We need to fix this very shortly or we will get bitten by it once critical bug 1331406 is merged and a new django_openstack_auth version is released.

Revision history for this message
Julie Pichon (jpichon) wrote :

Also seeing an issue with logging out:

2014-06-19 16:27:19,468 5547 INFO openstack_auth.views Logging out user "demo".
2014-06-19 16:27:19,480 5547 INFO openstack_auth.views Could not delete token
2014-06-19 16:27:19,481 5547 ERROR django.request Internal Server Error: /auth/logout/
Traceback (most recent call last):
  File "/opt/stack/horizon/.venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 137, in get_response
    response = response.render()
  File "/opt/stack/horizon/.venv/lib/python2.7/site-packages/django/template/response.py", line 105, in render
    self.content = self.rendered_content
  File "/opt/stack/horizon/.venv/lib/python2.7/site-packages/django/template/response.py", line 80, in rendered_content
    template = self.resolve_template(self.template_name)
  File "/opt/stack/horizon/.venv/lib/python2.7/site-packages/django/template/response.py", line 58, in resolve_template
    return loader.get_template(template)
  File "/opt/stack/horizon/.venv/lib/python2.7/site-packages/django/template/loader.py", line 138, in get_template
    template, origin = find_template(template_name)
  File "/opt/stack/horizon/.venv/lib/python2.7/site-packages/django/template/loader.py", line 131, in find_template
    raise TemplateDoesNotExist(name)
TemplateDoesNotExist: registration/logged_out.html
[19/Jun/2014 16:27:19] "GET /auth/logout/ HTTP/1.1" 500 96460

Revision history for this message
Julie Pichon (jpichon) wrote :

The logout issue is due to the same refactoring but requires a fix in django_openstack_auth instead, I filed bug 1332167 to track it.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

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

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/101246
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=345ccc9d503e6e55fe46d7813958c0081cc1cffe
Submitter: Jenkins
Branch: master

commit 345ccc9d503e6e55fe46d7813958c0081cc1cffe
Author: Julie Pichon <email address hidden>
Date: Thu Jun 19 17:13:29 2014 +0100

    Fix issues with importing the Login form

    The Login form lives in openstack_auth.forms and should be directly
    imported from that file.

    Change-Id: I42808530024bebb01604adbf4828769812856bf3
    Closes-Bug: #1332149

Changed in horizon:
status: In Progress → Fix Committed
Revision history for this message
fumihiko kakuma (kakuma) wrote :

Should this patch be backported to icehouse to fix bug 1332855 ?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/101827

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/102114

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/icehouse)

Reviewed: https://review.openstack.org/101827
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=765e6d3c81925c5ed6f6a944eb15e25c6751819f
Submitter: Jenkins
Branch: stable/icehouse

commit 765e6d3c81925c5ed6f6a944eb15e25c6751819f
Author: Julie Pichon <email address hidden>
Date: Thu Jun 19 17:13:29 2014 +0100

    Fix issues with importing the Login form

    The Login form lives in openstack_auth.forms and should be directly
    imported from that file.

    Change-Id: I42808530024bebb01604adbf4828769812856bf3
    Closes-Bug: #1332149
    (cherry picked from commit 345ccc9d503e6e55fe46d7813958c0081cc1cffe)

Revision history for this message
Attila Fazekas (afazekas) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/havana)

Reviewed: https://review.openstack.org/102114
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=19634d62f5a9b2c1aa9f867c247f46ed7f19ac07
Submitter: Jenkins
Branch: stable/havana

commit 19634d62f5a9b2c1aa9f867c247f46ed7f19ac07
Author: Julie Pichon <email address hidden>
Date: Thu Jun 19 17:13:29 2014 +0100

    Fix issues with importing the Login form

    The Login form lives in openstack_auth.forms and should be directly
    imported from that file.

    Change-Id: I42808530024bebb01604adbf4828769812856bf3
    Closes-Bug: #1332149
    (cherry picked from commit 345ccc9d503e6e55fe46d7813958c0081cc1cffe)

tags: added: in-stable-havana
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: juno-2 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.