Customization: Add an explicit example of disabling Floating IPs

The current documentation on customizing focuses on
registering/unregistering components.  While this is simple and
effective at a high-level, fine-grained customizations like overriding
individual allowed() methods uses a different approach.

This confuses n00bcakes like myself, so add an explicit example of
dropping Floating IPs support to spell it out.

Fixes Bug: 1210419

Change-Id: Ib9b1579b33d48c7b2bd9bf3ad96cd303210a4420
This commit is contained in:
Nicolas Simonds 2013-08-09 00:35:47 -07:00
parent e8b3360038
commit e1ab6c3d8c

View File

@ -76,6 +76,19 @@ Or just remove it entirely::
projects_dashboard.unregister(instances_panel.__class__)
You can also override existing methods with your own versions::
# Disable Floating IPs
from openstack_dashboard.dashboards.project.access_and_security import tabs
from openstack_dashboard.dashboards.project.instances import tables
NO = lambda *x: False
tabs.FloatingIPsTab.allowed = NO
tables.AssociateIP.allowed = NO
tables.SimpleAssociateIP.allowed = NO
tables.SimpleDisassociateIP.allowed = NO
.. NOTE::
``my_project.overrides`` needs to be importable by the python process running