LOCAL_PATH config var ignored

Bug #1254694 reported by Guillaume Subiron
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Matt Fischer

Bug Description

In settings.py, line 220, LOCAL_PATH is computed from os.path.dirname. This causes the next line to try writing in /usr/share/openstack-dashboard/openstack_dashboard/local, which is read only in Debian (writing runtime in /usr is forbidden).

So the dashboard fails and returns error 500.

I have set LOCAL_PATH to "/var/lock/apache2" in "/etc/openstack-dashboard/local_settings.py", but this doesn't change anything. I think line 220 of settings.py should use os.path.dirname to set LOCAL_PATH *only if* LOCAL_PATH isn't set yet.

Moreover, in Debian, the default value for LOCAL_PATH in local_settings.py should be /var/lock/apache2 (or maybe /var/lib/horizon), but certainly not something in /usr/share/openstack-dashboard

Revision history for this message
Matthias Runge (mrunge) wrote :

IMHO, that's a packaging thing. E.g. for Fedora packages, I'm setting this kind of stuff in local_settings: https://github.com/redhat-openstack/horizon/blob/master-patches/openstack_dashboard/local/local_settings.py.example#L91

Revision history for this message
Guillaume Subiron (maethor) wrote :

Yes of course, and the Fedora package is a good example.

But LOCAL_PATH variable in local_settings.py is ignored and completely overloaded in settings.py, line 220. This problem is in settings.py, so I really think this is a Horizon bug, not a package thing.

In the Fedora package, you don't see the bug because you also set the SECRET_KEY variable. Therefore, we should be able to set only LOCAL_PATH in local_settings.py, and to rely on the default SECRET_KEY computed by settings.py. Currently, this doesn't work, because settings.py overloads LOCAL_PATH without checking if it is already set.

Revision history for this message
Matt Fischer (mfisch) wrote :

I think simply having LOCAL_PATH respected if already set, even when SECRET_KEY is unset makes perfect sense and should not have to be fixed in a packaging branch. I'll work on it today.

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

Reviewed: https://review.openstack.org/65819
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=05ba5f81c390efbb6e5eb98db62f8f2599389ddb
Submitter: Jenkins
Branch: master

commit 05ba5f81c390efbb6e5eb98db62f8f2599389ddb
Author: Matt Fischer <email address hidden>
Date: Thu Jan 9 15:35:38 2014 -0700

    Don't reset LOCAL_PATH if it's already set

    If LOCAL_PATH is set in local_settings, then settings should
    not override it, even if SECRET_KEY is unset.

    Change-Id: I6aca03f65afddffb6cdd00e4084a8ab9b2255ef1
    Closes-Bug: #1254694

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-2 → 2014.1
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.