Browse Source

Moves OPENSTACK_MANILA_SETTINGS TO local_settings.d/

The enabled/ directory allows toggling of panels and plugins
while the local_settings.d/ allows overriding of settings.
We had OPENSTACK_MANILA_SETTINGS dict under enabled/ and for this
reason the settings overriden there were not taking effect.
This patch set moves OPENSTACK_MANILA_SETTINGS under local_settings.d/

Change-Id: Ie4cd49216f1a4a93c5fe1358c97682f8e4044b43
Closes-Bug: #1641624
changes/26/397926/6
Victoria Martinez de la Cruz 5 years ago
parent
commit
43bbdcdb1f
  1. 8
      README.rst
  2. 3
      devstack/plugin.sh
  3. 0
      manila_ui/local/__init__.py
  4. 18
      manila_ui/local/enabled/_90_manila_admin_shares.py
  5. 6
      manila_ui/local/enabled/_90_manila_project_shares.py
  6. 0
      manila_ui/local/enabled/__init__.py
  7. 9
      manila_ui/local/local_settings.d/_90_manila_shares.py
  8. 4
      manila_ui/tests/settings.py

8
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
------------

3
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
:

0
manila_ui/enabled/__init__.py → manila_ui/local/__init__.py

18
manila_ui/local/enabled/_90_manila_admin_shares.py

@ -0,0 +1,18 @@
# Copyright 2016 Mirantis 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.
PANEL_DASHBOARD = 'admin'
PANEL_GROUP = 'admin'
PANEL = 'shares'
ADD_PANEL = 'manila_ui.dashboards.admin.shares.panel.Shares'

6
manila_ui/enabled/_90_manila_project_shares.py → 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,
}

0
manila_ui/local/enabled/__init__.py

9
manila_ui/enabled/_90_manila_admin_shares.py → manila_ui/local/local_settings.d/_90_manila_shares.py

@ -1,4 +1,4 @@
# Copyright 2016 Mirantis Inc.
# 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
@ -12,13 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
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.
# the UI for the various services provided by Manila.
OPENSTACK_MANILA_FEATURES = {
'enable_replication': True,
'enable_migration': True,

4
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,

Loading…
Cancel
Save