Debian Codegraph @

magnum/conf/certificates.py

raw
1 # Licensed under the Apache License, Version 2.0 (the "License"); you may not
2 # use this file except in compliance with the License. You may obtain a copy
3 # of the License at
4 #
5 # http://www.apache.org/licenses/LICENSE-2.0
6 #
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 # See the License for the specific language governing permissions and
11 # limitations under the License.
12
13 import itertools
14 from oslo_config import cfg
15
16 DEFAULT_CERT_MANAGER = 'barbican'
17 TLS_STORAGE_DEFAULT = '/var/lib/magnum/certificates/'
18
19 certificates_group = cfg.OptGroup(name='certificates',
20 title='Certificate options for the '
21 'cert manager.')
22
23 cert_manager_opts = [
24 cfg.StrOpt('cert_manager_type',
25 default=DEFAULT_CERT_MANAGER,
26 help='Certificate Manager plugin.')
27 ]
28
29 local_cert_manager_opts = [
30 cfg.StrOpt('storage_path',
31 default=TLS_STORAGE_DEFAULT,
32 help='Absolute path of the certificate storage directory.')
33 ]
34
35 ALL_OPTS = list(itertools.chain(
36 cert_manager_opts,
37 local_cert_manager_opts
38 ))
39
40
41 def register_opts(conf):
42 conf.register_group(certificates_group)
43 conf.register_opts(ALL_OPTS, group=certificates_group)
44
45
46 def list_opts():
47 return {
48 certificates_group: ALL_OPTS
49 }