当前位置: 首页>>代码示例>>Python>>正文


Python config.register_opts函数代码示例

本文整理汇总了Python中st2common.config.register_opts函数的典型用法代码示例。如果您正苦于以下问题:Python register_opts函数的具体用法?Python register_opts怎么用?Python register_opts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了register_opts函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUpClass

    def setUpClass(cls):
        super(PluginLoaderTestCase, cls).setUpClass()

        # Check to see if configs are already registered.
        # The register_opts is needed when running tests individually.
        if 'system' not in cfg.CONF:
            config.register_opts()
开发者ID:lyandut,项目名称:st2,代码行数:7,代码来源:test_util_loader.py

示例2: _parse_config

def _parse_config():
    cli_opts = [
        cfg.BoolOpt('verbose',
                    short='v',
                    default=False,
                    help='Print more verbose output'),
        cfg.StrOpt('trigger-instance-id',
                   short='t',
                   required=True,
                   dest='trigger_instance_id',
                   help='Id of trigger instance'),
    ]
    CONF.register_cli_opts(cli_opts)
    st2cfg.register_opts(ignore_errors=False)

    CONF(args=sys.argv[1:])
开发者ID:lyandut,项目名称:st2,代码行数:16,代码来源:trigger_re_fire.py

示例3: _register_common_opts

def _register_common_opts():
    common_config.register_opts()
开发者ID:BlazeMediaGroup,项目名称:st2,代码行数:2,代码来源:config.py

示例4: _register_common_opts

def _register_common_opts(ignore_errors=False):
    st2cfg.register_opts(ignore_errors=ignore_errors)
开发者ID:nzlosh,项目名称:st2,代码行数:2,代码来源:config.py

示例5: _register_common_opts

def _register_common_opts():
    try:
        common_config.register_opts(ignore_errors=True)
    except:
        LOG.exception('Common config registration failed.')
开发者ID:Gagaro,项目名称:st2,代码行数:5,代码来源:config.py

示例6: parse_args

# See the License for the specific language governing permissions and
# limitations under the License.

"""
Configuration options registration and useful routines.
"""

from __future__ import absolute_import

from oslo_config import cfg

import st2common.config as common_config
from st2common.constants.system import VERSION_STRING
from st2common.constants.system import DEFAULT_CONFIG_FILE_PATH

common_config.register_opts()

CONF = cfg.CONF


def parse_args(args=None):
    cfg.CONF(args=args, version=VERSION_STRING,
             default_config_files=[DEFAULT_CONFIG_FILE_PATH])


def get_logging_config_path():
    return cfg.CONF.exporter.logging


def register_opts():
    _register_common_opts()
开发者ID:lyandut,项目名称:st2,代码行数:31,代码来源:config.py

示例7: _register_common_opts

def _register_common_opts():
    st2cfg.register_opts()
开发者ID:bjoernbessert,项目名称:st2,代码行数:2,代码来源:config.py

示例8: hasattr

from st2common.exceptions.plugins import PluginLoadError

__all__ = [
    'BaseMetricsDriver',

    'Timer',
    'Counter',
    'CounterWithTimer',

    'metrics_initialize',
    'get_driver'
]

if not hasattr(cfg.CONF, 'metrics'):
    from st2common.config import register_opts
    register_opts()

LOG = logging.getLogger(__name__)

PLUGIN_NAMESPACE = 'st2common.metrics.driver'

# Stores reference to the metrics driver class instance.
# NOTE: This value is populated lazily on the first get_driver() function call
METRICS = None


class BaseMetricsDriver(object):
    """
    Base class for driver implementations for metric collection
    """
开发者ID:StackStorm,项目名称:st2,代码行数:30,代码来源:base.py


注:本文中的st2common.config.register_opts函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。