OPENSTACK_KEYSTONE_URL missing when horizon_available_regions is defined.

Bug #1660344 reported by Ingemar Fällman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Undecided
Kevin Carter

Bug Description

if horizon_available_regions is defined then the variable OPENSTACK_KEYSTONE_URL is not set and the horizon dashboard will fail with the error

AttributeError: 'Settings' object has no attribute 'OPENSTACK_KEYSTONE_URL'
Internal Server Error: /auth/login/

To correct this the OPENSTACK_KEYSTONE_URL on line 167 should be moved outside the if statement.

https://github.com/openstack/openstack-ansible-os_horizon/blob/master/templates/horizon_local_settings.py.j2#L167

--- /etc/ansible/roles/os_horizon/templates/horizon_local_settings.py.j2.orig 2017-01-30 15:02:38.352975375 +0100
+++ /etc/ansible/roles/os_horizon/templates/horizon_local_settings.py.j2 2017-01-30 15:02:52.848285696 +0100
@@ -164,8 +164,8 @@
 {% else %}
 # Set Horizon to use a specific Keystone endpoint
 OPENSTACK_HOST = "{{ horizon_keystone_host }}"
-OPENSTACK_KEYSTONE_URL = "{{ horizon_keystone_endpoint }}"
 {% endif %}
+OPENSTACK_KEYSTONE_URL = "{{ horizon_keystone_endpoint }}"

 # The default role assigned to users
 OPENSTACK_KEYSTONE_DEFAULT_ROLE = "{{ horizon_default_role_name }}"

Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :
Revision history for this message
Ingemar Fällman (mrsmurf) wrote :
Download full text (4.7 KiB)

Full log trace:

 [Mon Jan 30 13:50:09.497389 2017] [wsgi:error] [pid 11554:tid 140090457696000] Internal Server Error: /auth/login/
 [Mon Jan 30 13:50:09.497440 2017] [wsgi:error] [pid 11554:tid 140090457696000] Traceback (most recent call last):
 [Mon Jan 30 13:50:09.497447 2017] [wsgi:error] [pid 11554:tid 140090457696000] File "/openstack/venvs/horizon-master/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
 [Mon Jan 30 13:50:09.497452 2017] [wsgi:error] [pid 11554:tid 140090457696000] response = wrapped_callback(request, *callback_args, **callback_kwargs)
 [Mon Jan 30 13:50:09.497471 2017] [wsgi:error] [pid 11554:tid 140090457696000] File "/openstack/venvs/horizon-master/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
 [Mon Jan 30 13:50:09.497476 2017] [wsgi:error] [pid 11554:tid 140090457696000] return view(request, *args, **kwargs)
 [Mon Jan 30 13:50:09.497481 2017] [wsgi:error] [pid 11554:tid 140090457696000] File "/openstack/venvs/horizon-master/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
 [Mon Jan 30 13:50:09.497486 2017] [wsgi:error] [pid 11554:tid 140090457696000] response = view_func(request, *args, **kwargs)
 [Mon Jan 30 13:50:09.497490 2017] [wsgi:error] [pid 11554:tid 140090457696000] File "/openstack/venvs/horizon-master/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
 [Mon Jan 30 13:50:09.497495 2017] [wsgi:error] [pid 11554:tid 140090457696000] response = view_func(request, *args, **kwargs)
 [Mon Jan 30 13:50:09.497500 2017] [wsgi:error] [pid 11554:tid 140090457696000] File "/openstack/venvs/horizon-master/lib/python2.7/site-packages/openstack_auth/views.py", line 102, in login
 [Mon Jan 30 13:50:09.497504 2017] [wsgi:error] [pid 11554:tid 140090457696000] **kwargs)
 [Mon Jan 30 13:50:09.497508 2017] [wsgi:error] [pid 11554:tid 140090457696000] File "/openstack/venvs/horizon-master/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
 [Mon Jan 30 13:50:09.497513 2017] [wsgi:error] [pid 11554:tid 140090457696000] return view(request, *args, **kwargs)
 [Mon Jan 30 13:50:09.497517 2017] [wsgi:error] [pid 11554:tid 140090457696000] File "/openstack/venvs/horizon-master/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
 [Mon Jan 30 13:50:09.497522 2017] [wsgi:error] [pid 11554:tid 140090457696000] response = view_func(request, *args, **kwargs)
 [Mon Jan 30 13:50:09.497526 2017] [wsgi:error] [pid 11554:tid 140090457696000] File "/openstack/venvs/horizon-master/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
 [Mon Jan 30 13:50:09.497531 2017] [wsgi:error] [pid 11554:tid 140090457696000] response = view_func(request, *args, **kwargs)
 [Mon Jan 30 13:50:09.497535 2017] [wsgi:error] [pid 11554:tid 140090457696000] File "/openstack/venvs/horizon-master/lib/python2.7/site-packages/django/contrib/auth/views.py", line 55, in login
 [Mon Jan 30 13:50:09.497540 2017] [wsgi:erro...

Read more...

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

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

Changed in openstack-ansible:
assignee: nobody → Kevin Carter (kevin-carter)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_horizon (master)

Reviewed: https://review.openstack.org/428772
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-os_horizon/commit/?id=fbd1492f1ff298565f823c1f8ea7ad71bdcb8e6c
Submitter: Jenkins
Branch: master

commit fbd1492f1ff298565f823c1f8ea7ad71bdcb8e6c
Author: Kevin Carter <email address hidden>
Date: Fri Feb 3 09:04:02 2017 -0600

    ensure OPENSTACK_KEYSTONE_URL is always configured

    This is being moved in the template file such that it will ensure the
    variable is always rendered. This change is needed for multi-region
    clouds.

    Change-Id: Ib3fa401e6ecf4053ef0a4a5bb9d18ae18ae7f07a
    Closes-Bug: #1660344
    Signed-off-by: Kevin Carter <email address hidden>

Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_horizon (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/437983

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_horizon (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/437985

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_horizon (stable/ocata)

Reviewed: https://review.openstack.org/437983
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-os_horizon/commit/?id=dcb6e3e6b228cf9996a72cca3b43f409a5d520a5
Submitter: Jenkins
Branch: stable/ocata

commit dcb6e3e6b228cf9996a72cca3b43f409a5d520a5
Author: Kevin Carter <email address hidden>
Date: Fri Feb 3 09:04:02 2017 -0600

    ensure OPENSTACK_KEYSTONE_URL is always configured

    This is being moved in the template file such that it will ensure the
    variable is always rendered. This change is needed for multi-region
    clouds.

    Change-Id: Ib3fa401e6ecf4053ef0a4a5bb9d18ae18ae7f07a
    Closes-Bug: #1660344
    Signed-off-by: Kevin Carter <email address hidden>
    (cherry picked from commit fbd1492f1ff298565f823c1f8ea7ad71bdcb8e6c)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_horizon (stable/newton)

Reviewed: https://review.openstack.org/437985
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-os_horizon/commit/?id=5ff83ba7582cd5302b3e4b4214f1912d0d4bdfe8
Submitter: Jenkins
Branch: stable/newton

commit 5ff83ba7582cd5302b3e4b4214f1912d0d4bdfe8
Author: Kevin Carter <email address hidden>
Date: Fri Feb 3 09:04:02 2017 -0600

    ensure OPENSTACK_KEYSTONE_URL is always configured

    This is being moved in the template file such that it will ensure the
    variable is always rendered. This change is needed for multi-region
    clouds.

    Change-Id: Ib3fa401e6ecf4053ef0a4a5bb9d18ae18ae7f07a
    Closes-Bug: #1660344
    Signed-off-by: Kevin Carter <email address hidden>
    (cherry picked from commit fbd1492f1ff298565f823c1f8ea7ad71bdcb8e6c)

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_horizon 15.0.0.0rc2

This issue was fixed in the openstack/openstack-ansible-os_horizon 15.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_horizon 14.2.0

This issue was fixed in the openstack/openstack-ansible-os_horizon 14.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_horizon 16.0.0.0b1

This issue was fixed in the openstack/openstack-ansible-os_horizon 16.0.0.0b1 development milestone.

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.