05c7f35d23
The new config option 'disabled_drivers' is designed to address a typical user case: As cloud provider, I'd like to only provide some particular drivers, e.g. fedora atomic/k8s and don't expose any other driver support. With this patch, when user create a new template which is in 'disabled_drivers'. A BadRequest error will be returned. Closes-Bug: #1746961 Change-Id: Ib4c53ffed78a1847b2da9672e6348c88757ad66e
55 lines
2.1 KiB
Python
55 lines
2.1 KiB
Python
# 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.
|
|
|
|
from oslo_config import cfg
|
|
|
|
drivers_group = cfg.OptGroup(name='drivers',
|
|
title='Options for the Drivers')
|
|
|
|
drivers_opts = [
|
|
cfg.BoolOpt('verify_ca',
|
|
default=True,
|
|
help='Indicates whether the cluster nodes validate the '
|
|
'Certificate Authority when making requests to the '
|
|
'OpenStack APIs (Keystone, Magnum, Heat). If you have '
|
|
'self-signed certificates for the OpenStack APIs or '
|
|
'you have your own Certificate Authority and you '
|
|
'have not installed the Certificate Authority to all '
|
|
'nodes, you may need to disable CA validation by '
|
|
'setting this flag to False.'),
|
|
cfg.StrOpt('openstack_ca_file',
|
|
default="",
|
|
help='Path to the OpenStack CA-bundle file to pass and '
|
|
'install in all cluster nodes.'),
|
|
cfg.BoolOpt('send_cluster_metrics',
|
|
default=True,
|
|
help='Allow periodic tasks to pull COE data and send to '
|
|
'ceilometer.'),
|
|
cfg.ListOpt('disabled_drivers',
|
|
default=[],
|
|
help='Disabled driver entry points. The default value is []. '
|
|
' Means if not specified, then all available drivers '
|
|
'are enabled.'
|
|
),
|
|
]
|
|
|
|
|
|
def register_opts(conf):
|
|
conf.register_group(drivers_group)
|
|
conf.register_opts(drivers_opts, group=drivers_group)
|
|
|
|
|
|
def list_opts():
|
|
return {
|
|
drivers_group: drivers_opts,
|
|
}
|