File: cfg.py

package info (click to toggle)
python-os-ken 3.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 21,280 kB
  • sloc: python: 100,620; erlang: 14,517; ansic: 594; sh: 338; makefile: 136
file content (48 lines) | stat: -rw-r--r-- 1,815 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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.

import oslo_config.cfg

# there are 3 ways to access the configuration.
#
#    a. os_ken.cfg.CONF  (used to register cli options)
#    b. OSKenApp.CONF  (preferred way for os_ken applications)
#    c. oslo_config.cfg.CONF
#
# Currently a. and b. shares a single ConfigOpts instance.
# We intentionally avoid using c. for our options as a python program
# which embeds os_ken applications (eg. neutron agent) might want to put
# its own set of cli options into it, which can conflict with ours.
# (Currently there seems no conflict for the neutron agent.  But who knows?)
# At some point later we might want to unshare a. and b. as well, in order
# to allow app-specific options.

CONF = oslo_config.cfg.ConfigOpts()

# re-export for convenience

from oslo_config.cfg import ConfigOpts

from oslo_config.cfg import Opt
from oslo_config.cfg import BoolOpt
from oslo_config.cfg import IntOpt
from oslo_config.cfg import ListOpt
from oslo_config.cfg import MultiStrOpt
from oslo_config.cfg import StrOpt
from oslo_config.cfg import FloatOpt

from oslo_config.cfg import RequiredOptError
from oslo_config.cfg import ConfigFilesNotFoundError