[Openstack] horizon customization_module example???

2013-03-04 Thread Wyllys Ingersoll
Can someone elaborate on how to use the customization_module setting in 
local_settings.py?

Im running openstack-dashboard Version: 2012.2.1-0ubuntu1~cloud0 on Ubuntu 
12.04 LTS.

I read the documentation here - 
http://docs.openstack.org/developer/horizon/topics/customizing.html but several 
things are still unclear to me, even for a simple mod such as removing and/or 
renaming some panels.

I want to just make a few modifications to the standard dashboard and panel, I 
don't want to write a whole new dashboard or write entirely new panels.  I just 
want to eliminate some of the existing ones (as a start).

For example, say I want to eliminate the volumes and instances panels from 
the project dashboards.  I'd prefer to NOT have to modifying the original 
system modules deep down in 
/usr/share/pyshared/horizon/dashboards/nova/dashboard.py.  I hope that's not 
the answer.

The documentation seems to indicate that this could be done with the 
customization_module, but I can't figure out where it goes or what the 
structure would look like.

Questions:
- If I name the customization_module as my_dashboard.overrides - where does 
the overrides file need to be created (i.e. what directory - full path) ?
- Does it require other files to be present in that directory also such as the 
__init__.py or models.py  like a complete dashboard would?

I think once I can figure out where to put my custom mods without making 
horizon barf all over itself, I can make my changes, but getting started is 
proving difficult.

thanks,
  Wyllys






___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp


Re: [Openstack] horizon customization_module example???

2013-03-04 Thread Kieran Spear
Hi Wyllys,

On 5 March 2013 08:59, Wyllys Ingersoll wyllys.ingers...@evault.com wrote:
 Questions:
 - If I name the customization_module as my_dashboard.overrides - where does 
 the overrides file need to be created (i.e. what directory - full path) ?

my_dashboard.overrides needs to be importable by the process running
Horizon. So your my_dashboard module needs to be on your python path
somehow. Probably the easiest way is to add a python-path argument to
the WSGIDaemonProcess line in Apache's Horizon config. I'm not sure
where this lives exactly for the ubuntu package (should be somewhere
under /etc/apache2/).

Assuming your my_dashboard module lives in /opt/python/my_dashboard,
you'd make it look like the following:

WSGIDaemonProcess [... existing options ...] python-path=/opt/python

Alternatively you can make your module an installable python package
and install it system-wide (e.g., create a setup.py).

 - Does it require other files to be present in that directory also such as 
 the __init__.py or models.py  like a complete dashboard would?

It will need a __init__.py but should be fine without a models.py.

I'll see about getting this info added to the docs.

Cheers,
Kieran


 I think once I can figure out where to put my custom mods without making 
 horizon barf all over itself, I can make my changes, but getting started is 
 proving difficult.

 thanks,
   Wyllys







 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp


Re: [Openstack] horizon customization_module example???

2013-03-04 Thread Wyllys Ingersoll

Thanks!

Any hints on how to remove some of the default Nova panels from the dashboard 
using the customization_module?




On Mar 4, 2013, at 6:52 PM, Kieran Spear kisp...@gmail.com wrote:

 Hi Wyllys,
 
 On 5 March 2013 08:59, Wyllys Ingersoll wyllys.ingers...@evault.com wrote:
 Questions:
 - If I name the customization_module as my_dashboard.overrides - where 
 does the overrides file need to be created (i.e. what directory - full 
 path) ?
 
 my_dashboard.overrides needs to be importable by the process running
 Horizon. So your my_dashboard module needs to be on your python path
 somehow. Probably the easiest way is to add a python-path argument to
 the WSGIDaemonProcess line in Apache's Horizon config. I'm not sure
 where this lives exactly for the ubuntu package (should be somewhere
 under /etc/apache2/).
 
 Assuming your my_dashboard module lives in /opt/python/my_dashboard,
 you'd make it look like the following:
 
 WSGIDaemonProcess [... existing options ...] python-path=/opt/python
 
 Alternatively you can make your module an installable python package
 and install it system-wide (e.g., create a setup.py).
 
 - Does it require other files to be present in that directory also such as 
 the __init__.py or models.py  like a complete dashboard would?
 
 It will need a __init__.py but should be fine without a models.py.
 
 I'll see about getting this info added to the docs.
 
 Cheers,
 Kieran
 
 
 I think once I can figure out where to put my custom mods without making 
 horizon barf all over itself, I can make my changes, but getting started is 
 proving difficult.
 
 thanks,
  Wyllys
 
 
 
 
 
 
 
 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp
 


___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp


Re: [Openstack] horizon customization_module example???

2013-03-04 Thread Kieran Spear
On 5 March 2013 12:24, Wyllys Ingersoll wyllys.ingers...@evault.com wrote:

 Thanks!

 Any hints on how to remove some of the default Nova panels from the dashboard 
 using the customization_module?

Something like:

import horizon
nova = horizon.get_dashboard('nova')

nova.unregister(nova.get_panel('instances').__class__)

Substitute projects for nova in Grizzly.


You can also limit a panel to certain keystone roles with an
openstack.roles.role permission:

nova.get_panel('instances').permissions = ('openstack.roles.admin',)

or, more robustly:

instances = nova.get_panel('instances')
permissions = list(getattr(instances, 'permissions', []))
permissions.append('openstack.roles.admin')
instances.permissions = tuple(permissions)

Cheers,
Kieran





 On Mar 4, 2013, at 6:52 PM, Kieran Spear kisp...@gmail.com wrote:

 Hi Wyllys,

 On 5 March 2013 08:59, Wyllys Ingersoll wyllys.ingers...@evault.com wrote:
 Questions:
 - If I name the customization_module as my_dashboard.overrides - where 
 does the overrides file need to be created (i.e. what directory - full 
 path) ?

 my_dashboard.overrides needs to be importable by the process running
 Horizon. So your my_dashboard module needs to be on your python path
 somehow. Probably the easiest way is to add a python-path argument to
 the WSGIDaemonProcess line in Apache's Horizon config. I'm not sure
 where this lives exactly for the ubuntu package (should be somewhere
 under /etc/apache2/).

 Assuming your my_dashboard module lives in /opt/python/my_dashboard,
 you'd make it look like the following:

 WSGIDaemonProcess [... existing options ...] python-path=/opt/python

 Alternatively you can make your module an installable python package
 and install it system-wide (e.g., create a setup.py).

 - Does it require other files to be present in that directory also such as 
 the __init__.py or models.py  like a complete dashboard would?

 It will need a __init__.py but should be fine without a models.py.

 I'll see about getting this info added to the docs.

 Cheers,
 Kieran


 I think once I can figure out where to put my custom mods without making 
 horizon barf all over itself, I can make my changes, but getting started is 
 proving difficult.

 thanks,
  Wyllys







 ___
 Mailing list: https://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp



___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp