From 7de390b31411b33c14ca9ea383eb5f08eca095c2 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 2 Jan 2022 21:51:37 +0900 Subject: [PATCH] Add example dashboard config file This change introduces an example dashboard config file so that users can more easily set up the recommended parameters and understand the available parameters. Horizon supports loading multiple config files from local_settings.d and it is now encouraged to implement per-dashboard config file. Change-Id: I423d4811ead2c0c8f79fc0d80f3c7fe8d3578c97 --- README.rst | 8 +++-- .../local_settings.d/_1799_dns_settings.py | 32 +++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 designatedashboard/local_settings.d/_1799_dns_settings.py diff --git a/README.rst b/README.rst index 5adc1f9..89f1ad6 100644 --- a/README.rst +++ b/README.rst @@ -48,12 +48,14 @@ Howto and should be copied to /usr/share/openstack-dashboard/openstack_dashboard/local/enabled or the equivalent directory for your openstack-dashboard install. +3. Copy default config file into your Horizon config. The file can be found in designatedashboard/local_settings.d + and should be copied to /etc/openstack-dashboard/local_settings.d or the equivalent directory + for your openstack-dashboard install. + 3. Make sure your keystone catalog contains endpoints for service type 'dns'. If no such endpoints are found, the designatedashboard panels will not render. -4. (Optional) Copy the designate policy file into horizon's policy files folder, and add this config:: - - 'dns': 'designate_policy.json', +4. (Optional) Copy the designate policy file into horizon's policy files folder. Test diff --git a/designatedashboard/local_settings.d/_1799_dns_settings.py b/designatedashboard/local_settings.d/_1799_dns_settings.py new file mode 100644 index 0000000..1e01805 --- /dev/null +++ b/designatedashboard/local_settings.d/_1799_dns_settings.py @@ -0,0 +1,32 @@ +# 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. + +# This file is to be included for configuring application which relates +# to dns(Designate) functions. +from django.conf import settings + +settings.POLICY_FILES.update({ + 'dns': 'designate_policy.yaml' +}) + +settings.DEFAULT_POLICY_FILES.update({ + 'dns': 'default_policies/designate.yaml' +}) + +# Sample +# settings.LOGGING['loggers'].update({ +# 'designateclient': { +# 'handlers': ['console'], +# 'level': 'DEBUG', +# 'propagate': False, +# } +# })