diff --git a/README.rst b/README.rst index 4253f691..bd7e1e5e 100644 --- a/README.rst +++ b/README.rst @@ -57,7 +57,8 @@ Install Manila UI with all dependencies in your virtual environment:: And enable it in Horizon:: - cp ../manila-ui/manila_ui/enabled/_90_manila_*.py openstack_dashboard/local/enabled + cp ../manila-ui/manila_ui/local/enabled/_90_manila_*.py openstack_dashboard/local/enabled + cp ../manila-ui/manila_ui/local/local_settings.d/_90_manila_*.py openstack_dashboard/local/local_settings.d Starting the app @@ -89,16 +90,13 @@ _`Configuration` ---------------- It is possible to enable or disable some Manila UI features. To do so, -look for files located in "manila_ui/enabled" directory, +look for files located in "manila_ui/local/local_settings.d/" directory, where you can redefine the values of the OPENSTACK_MANILA_FEATURES dict:: * enable_replication * enable_migration * enable_public_share_type_creation -Note that there is a separate list of configurations for "admin" and -"project" dashboards. - Contributing ------------ diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 6a55bfb8..ff6a91de 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -26,7 +26,8 @@ if is_service_enabled horizon && is_service_enabled manila && is_service_enabled elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then # Configure after the other layer 1 and 2 services have been configured echo_summary "Configuring Manila UI" - cp -a ${MANILA_UI_DIR}/manila_ui/enabled/* ${DEST}/horizon/openstack_dashboard/local/enabled/ + cp -a ${MANILA_UI_DIR}/manila_ui/local/enabled/* ${DEST}/horizon/openstack_dashboard/local/enabled/ + cp -a ${MANILA_UI_DIR}/manila_ui/local/local_settings.d/* ${DEST}/horizon/openstack_dashboard/local/local_settings.d/ elif [[ "$1" == "stack" && "$2" == "extra" ]]; then # no-op : diff --git a/manila_ui/enabled/__init__.py b/manila_ui/local/__init__.py similarity index 100% rename from manila_ui/enabled/__init__.py rename to manila_ui/local/__init__.py diff --git a/manila_ui/enabled/_90_manila_admin_shares.py b/manila_ui/local/enabled/_90_manila_admin_shares.py similarity index 77% rename from manila_ui/enabled/_90_manila_admin_shares.py rename to manila_ui/local/enabled/_90_manila_admin_shares.py index 48e9f895..92bf11a6 100644 --- a/manila_ui/enabled/_90_manila_admin_shares.py +++ b/manila_ui/local/enabled/_90_manila_admin_shares.py @@ -16,10 +16,3 @@ PANEL_DASHBOARD = 'admin' PANEL_GROUP = 'admin' PANEL = 'shares' ADD_PANEL = 'manila_ui.dashboards.admin.shares.panel.Shares' - -# The OPENSTACK_MANILA_FEATURES settings can be used to enable or disable -# various services provided by manila. -OPENSTACK_MANILA_FEATURES = { - 'enable_replication': True, - 'enable_migration': True, -} diff --git a/manila_ui/enabled/_90_manila_project_shares.py b/manila_ui/local/enabled/_90_manila_project_shares.py similarity index 85% rename from manila_ui/enabled/_90_manila_project_shares.py rename to manila_ui/local/enabled/_90_manila_project_shares.py index d7b241dc..99258b3b 100644 --- a/manila_ui/enabled/_90_manila_project_shares.py +++ b/manila_ui/local/enabled/_90_manila_project_shares.py @@ -27,9 +27,3 @@ ADD_EXCEPTIONS = { 'not_found': exceptions.NOT_FOUND, 'unauthorized': exceptions.UNAUTHORIZED, } - -# The OPENSTACK_MANILA_FEATURES settings can be used to enable or disable -# various services provided by manila. -OPENSTACK_MANILA_FEATURES = { - 'enable_replication': True, -} diff --git a/manila_ui/local/enabled/__init__.py b/manila_ui/local/enabled/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/manila_ui/local/local_settings.d/_90_manila_shares.py b/manila_ui/local/local_settings.d/_90_manila_shares.py new file mode 100644 index 00000000..f643aae0 --- /dev/null +++ b/manila_ui/local/local_settings.d/_90_manila_shares.py @@ -0,0 +1,20 @@ +# Copyright 2016 Red Hat Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +# The OPENSTACK_MANILA_FEATURES settings can be used to enable or disable +# the UI for the various services provided by Manila. +OPENSTACK_MANILA_FEATURES = { + 'enable_replication': True, + 'enable_migration': True, +} diff --git a/manila_ui/tests/settings.py b/manila_ui/tests/settings.py index e78e7283..f92a701a 100644 --- a/manila_ui/tests/settings.py +++ b/manila_ui/tests/settings.py @@ -15,14 +15,14 @@ from horizon.test.settings import * # noqa from openstack_dashboard.test.settings import * # noqa # Load the pluggable dashboard settings -import manila_ui.enabled +import manila_ui.local.enabled import openstack_dashboard.enabled from openstack_dashboard.utils import settings MANILA_UI_APPS = list(INSTALLED_APPS) + ['manila_ui.dashboards'] settings.update_dashboards( [ - manila_ui.enabled, + manila_ui.local.enabled, openstack_dashboard.enabled, ], HORIZON_CONFIG,