File: globals.rst

package info (click to toggle)
python-oslo.config 1%3A10.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,324 kB
  • sloc: python: 12,639; sh: 44; makefile: 35
file content (21 lines) | stat: -rw-r--r-- 499 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
===================
 Global ConfigOpts
===================

This module also contains a global instance of the ConfigOpts class
in order to support a common usage pattern in OpenStack:

.. code-block:: python

    from oslo_config import cfg

    opts = [
        cfg.StrOpt('bind_host', default='0.0.0.0'),
        cfg.PortOpt('bind_port', default=9292),
    ]

    CONF = cfg.CONF
    CONF.register_opts(opts)

    def start(server, app):
        server.start(app, CONF.bind_port, CONF.bind_host)