[Openstack] [horizon] Weird behaviour of 'user_home' and 'default_dashboard" paramenters in HORIZON_CONFIG
Timur Sufiev
tsufiev at mirantis.com
Mon Oct 28 16:00:59 UTC 2013
Hello, David
Thanks for your quick response. Changing the default behaviour of Horizon
is fine :), yet it is still unclear to me how do I force Horizon to call my
custom function provided via 'user_home' config parameter. It isn't called
right now ('get_user_home' function from
/usr/share/openstack-dashboard/openstack_dashboard/views.py is called
despite I have specified HORIZON_CONFIG['user_home'] =
'muranodashboard.views.get_user_home').
On Fri, Oct 25, 2013 at 9:43 PM, Lyle, David <david.lyle at hp.com> wrote:
> Hi Timur,
>
> You have correctly analyzed the current behavior. And it is confusing.
> In our implementation,
> we have implemented a user_home method that uses the "default_dashboard"
> to give the user
> a default dashboard.
>
> Now the question is of course, should that be the default behavior for
> Horizon. I would argue yes.
> The default behavior will need to change, if the upcoming Information
> Architecture proposals
> yield changes as I expect them to. But there's no reason we couldn't fix
> this behavior now.
>
> David
>
>
> > From: Timur Sufiev [mailto:tsufiev at mirantis.com]
> > Sent: Friday, October 25, 2013 11:12 AM
> > To: openstack at lists.openstack.org
> > Cc: Ekaterina Fedorova
> > Subject: [Openstack] [horizon] Weird behaviour of 'user_home' and
> 'default_dashboard" paramenters in HORIZON_CONFIG
> >
> > Hello there!
> >
> > So I specify following config lines:
>
> > HORIZON_CONFIG['default_dashboard'] = 'murano'
> > HORIZON_CONFIG['user_home'] = 'muranodashboard.views.get_user_home'
> > HORIZON_CONFIG['dashboards'] += ('murano',)
>
> > where get_user_home function is defined in muranodashboard/views.py:
> > def get_user_home(user):
> > return horizon.get_dashboard('murano').get_absolute_url()
> >
> > and 'muranodashboard' itself is in the INSTALLED_APPS tuple.
> >
> > With all these things set I expect Horizon to show me Murano dashboard
> when I login to it, but instead it shows me the 'Admin' dashboard as usual.
> I've a bit of debugging and it seems that get_user_home from >
> /usr/share/openstack-dashboard/openstack_dashboard/views.py is called
> (Horizon installed on Ubuntu).
> >
> > I'm not quite sure whether it's a bug or something I haven't fully
> understood. What exactly I do not understand is:
> > 1) how do I call my own get_user_home function?
> > 2) in case 'user_home' works ok, why do need 'default_dashboard"
> parameter (that, in my opinion, does roughly the same)?
> >
> > Thanks in advance!
> >
> > --
> > Timur Sufiev
>
--
Timur Sufiev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20131028/7fe8f251/attachment.html>
More information about the Openstack
mailing list