This patch also adds checks for executable files in
pep8 job.
nose ignores executable files by default, so it is important
to ensure executable flag is not set for test files [1].
openstack_dashboard/test/test_plugins/panel_tests.py was not
tested actually and it was broken. This commit fixes it too.
[1] http://nose.readthedocs.io/en/latest/usage.html#cmdoption-exe
Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Change-Id: I3a124fa2f9f0676b2b43a094e32e3d8b18fa6005
This change is to introduce a flexible mechanism for projects to
add content to horizon's navbar.
- Introduces a new plugin file variable called ADD_HEADER_SECTIONS,
which will take a list of views. These are template views that
will be used to render individual header sections.
- There is a new view in openstack_dashboard/views.py to cycle
through these added views and combine them into the complete
header to be added to the navbar.
- This view is queried by newly added javascript after page load.
On response it is inserted into the page's navbar.
If more than one header is present, the first will be shown in
the navbar, while the rest are added to a drop-down menu.
- The currently displayed header can be changed by clicking on a
new header in the drop-down; this is stored in a cookie to
persist the selection between pages.
- Unit tests were modified/added to verify the new plugin entry
can be parsed successfully and the main header view can parse
a plugin's view successfully
Change-Id: I177b69ec4e78c17f827e540a7e669af1c29e8b59
Implements: blueprint extensible-header
Signed-off-by: Tyler Smith <tyler.smith@windriver.com>
The root cause of 1479018 was the mixed method for loading content in
horizon. This patch moves horizon to load purely from enabled files.
There are a couple of things that were required to allow this change.
1) Adding a mechanism, can_register() to horizon/base.py to handle the
configuration based loading checks that had been accumulating in the
panel.py files. This is an optional static method in Panel to
encapsulate such configuration (read settings) based panel loading
logic. And added testing for and documentation for this addition.
2) Create a numbering scheme for plugins. Moved the base dashboards to
_1000_project.py _2000_admin.py _3000_identity.py _5000_settings.py.
then populated the required panel_group and panel enabled files sparsely
in those ranges. The sparseness is to allow for future additions.
Additionally, I moved the already added Angular based panels next to
their Django counterparts.
Once the configuration loading was normalized, the bug reported in
1479018 was resolved and tests work with plugins panels in all
dashboards.
Close-Bug: #1479018
Partially implements: blueprint plugin-sanity
Change-Id: I657e7ce37b2593a901a859cebf3d6ff8ada91941
Currently, we have tests for plugin but they are not comprehensive enough.
Considering that we are adding more logic to javascript, we need to ensure
that they are properly injected in these plugin.
Change-Id: Ie9186c445962e3142f2b33027b6556f9eb3b34a5
Closes-bug: #1468547
Revert fix from bug #1329050, which adds a plugin panel to its dashboard's
class. Adding a plugin panel to a dashboard whose class has its panels defined
in a tuple will fail because the new plugin cannot be appended to the tuple.
The code errors out before the panel gets added to the dashboard's panel list.
However, at this point, the panel has already been registered with the
dashboard. This causes Dashboard.get_panels() to see the panel in its registry
but not in its panel groups. Consequently, the panel gets put in the "Other"
panel group instead of its configured one, as described in bug #1378558.
By not adding the the plugin panel to its dashboard's class, the panel gets
added to its dashboard's panel list. Now the original issue from bug #1329050
resurfaces. The root cause of that is that every time Dashboard._autodiscover()
is called, it instantiates all its panel group classes, wiping out any panels
previously added to any of the panel groups. Avoid this by always processing
all the plugin panel groups before any of the plugin panels, which also ensures
that the panel groups exist before their panels.
Making this change exposed an issue where the Horizon URLs were being loaded
twice during the plugin infrastructure's unit tests, causing plugin panels to
be added multiple times to their dashboards. Fix that by removing the second,
unnecessary call. Also create a second test plugin panel group and panel to
test the scenarios described in the two bugs addressed here, adding two panel
groups at a time.
Change-Id: Id6a99c3ff18102c8f47431638d4dda98f14ec641
Closes-Bug: 1378558
Dashboards are now configured via the pluggable dashboard/panel
mechanism and the order can be specified in the pluggable config.
On the other hand, we have HORIZON "dashboards" and its tuple order
overrides the order specified in the pluggable config.
It is confusing to be able to configure the order of dashboards
in two places, and we no longer need to have "dashboards" config
parameter in settings.py and a sample local_settings.py.
* If HORIZON_CONFIG contains "dashboards" and update_dashboards
is called, a deprecation warning will be displayed. It is useful
to warn operators to change OpenStack Dashboard settings.
* HORIZON_CONFIG "dashboard" parameter itself still works and
there is no chnage in the behavior, so it is a safe change
and have no upgrade impact.
* This change also removes default_dashboard from settings because
it can be configured via pluggable dashboard config too.
After removing "dashboards" config, the order of the dashboards
are now controlled by the order of openstack_dashboard/enabled and
"Identity" dashboard is displayed before "Settings" dashboard
in the navigation menu.
Closes-Bug: #1366270
Change-Id: Ifa35128691c4fa4843b3c3c051682392e59905a6
This reverts commit ed586a0355fb99a5b1fbeadfc0625f0ceffe8b72.
The quota_class subcommand in python-novaclient was used to set default
quota values so it shouldn't have been removed. As now it is being
restored, the defaults quota panel is being restored too.
Related mailing list thread on the topic:
http://lists.openstack.org/pipermail/openstack-dev/2014-May/035383.html
Resolved merge conflicts by hand in:
openstack_dashboard/api/cinder.py
openstack_dashboard/dashboards/admin/info/tabs.py
openstack_dashboard/dashboards/admin/info/tests.py
Updated translatable segments to match refactors in
openstack_dashboard/dashboards/admin/defaults/workflows.py
openstack_dashboard/dashboards/admin/defaults/tables.py
Fixed most egregious post-merge styling errors in
openstack_dashboard/dashboards/admin/defaults/templates/defaults/index.html
(probably should have been separate, but I just couldn't let it out that way!)
Removed unrelated file that was allowed to be part of the original commit
doc/source/topics/settings.rst
Co-Authored-By: Doug Fish <drfish@us.ibm.com>
Change-Id: Ic4c4ecec843c7ea9afd0db36ce0eb15952da15b3
Partial-Bug: #1299517
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4
at the top of source code files, except for files in
openstack/common.
Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
Panels can be added through plugin configuration, but it is broken
if the user can only use existing panel groups. This adds the
capability to create an empty panel group that can be used by panel
configuration to add itself to the group.
Change-Id: I28d6072fc05b3a4ef5a41cd68337a7864c560525
Closes-Bug: #1287981
The default quota panel has been moved to a tab in the system
info panel.
The update default quotas feature has been removed.
The cinder quota-class methods have been removed to keep consistency.
The test cases and the apis for nova and cinder have been modified
according the change.
This change is done to support the change:
I1110022d6f628d03aaf363da707f2d2ef1600437
Change-Id: I193c7209d9681b6d69afe0d996153ac86850d243
Closes-Bug: #1292589
With Django 1.6, the test are failing to load the login page
with 'openstack_auth.user.Token object is not JSON serializable'
error.
Partially-implements blueprint django-1point6
Change-Id: I8b3d62f3076d6d2071ba77848b83e1872ba69ba6
This is an extension to the plugin-based dashboard configuration.
It adds support processing panel configuration configuration file
in the openstack_dashboard/enabled/ directory.
Panels can be added, removed to/from the panel group of a dashboard.
It also provide the ability to update the default panel of the
dashboard.
Change-Id: I2d7adfb8045c244ec063a6741e3b9fe21c188525
Implements: blueprint plugin-panel-config