Ask Your Question
0

how to edit override.py for horizon

asked 2014-03-31 19:28:06 -0500

anonymous user

Anonymous

updated 2014-04-01 04:57:34 -0500

jpichon gravatar image

I am trying to edit the name of a panel within Project dashboard using the overrides.py file but it isnt working and I need some help. I defined an overrides.py file under /opt/stack/horizon directory which contains the following:

from django.utils.translation import ugettext_lazy as _

import horizon

settings = horizon.get_dashboard('project')
user_panel = settings.get_panel("overview")
user_panel.name = _("Overview-Foo")

and also modified the settings.py under openstack_dashboard to include the following line: 'customization_module': 'horizon.overrides',

Thank you for your help.

edit retag flag offensive close merge delete

Comments

Done, I created a bug and uploaded a patch for this. I have added you as a reviewer. Thank you. https://review.openstack.org/84867

MJ gravatar imageMJ ( 2014-04-02 17:18:29 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2014-04-01 05:00:43 -0500

jpichon gravatar image

If the path you set in the local settings is 'horizon.overrides', you should place overrides.py in /opt/stack/horizon/horizon.

edit flag offensive delete link more

Comments

Thank you so much for pointing me in the right direction. So I made 2 changes and that helped fix the problem: - as you suggested, I moved overrides.py under /opt/stack/horizon/horizon - I added the customization_module property to local_settings.py instead of setting.py under openstack_dashboad. I tried following what was in thislink under the section: Modifying existing dashboard and panels - http://docs.openstack.org/developer/horizon/topics/customizing.html (http://docs.openstack.org/developer/h...) . It says to change the HORIZON_CONFIG in settings.py. Is this a defect and should I open one? Thanks for your help.

MJ gravatar imageMJ ( 2014-04-01 15:39:18 -0500 )edit

I think the way it's expressed might make sense for Django developers but not necessarily for people who are new to Horizon and not so familiar with Django. Feel free to open a bug at https://bugs.launchpad.net/horizon to make the docs clearer. Thank you!

jpichon gravatar imagejpichon ( 2014-04-02 03:08:18 -0500 )edit

(If you like you can submit a patch for it too!)

jpichon gravatar imagejpichon ( 2014-04-02 03:08:28 -0500 )edit
0

answered 2014-04-01 15:42:24 -0500

MJ gravatar image

The following changes helped fix the problem: - moved overrides.py under /opt/stack/horizon/horizon - added the customization_module property to local_settings.py under openstack_dashboard/local/ instead of settings.py under openstack_dashboad

Thank you Julie for helping me out with this.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2014-03-31 19:28:06 -0500

Seen: 580 times

Last updated: Apr 01 '14