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


Python utils.config_flags_parser方法代码示例

本文整理汇总了Python中charmhelpers.contrib.openstack.utils.config_flags_parser方法的典型用法代码示例。如果您正苦于以下问题:Python utils.config_flags_parser方法的具体用法?Python utils.config_flags_parser怎么用?Python utils.config_flags_parser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在charmhelpers.contrib.openstack.utils的用法示例。


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

示例1: __call__

# 需要导入模块: from charmhelpers.contrib.openstack import utils [as 别名]
# 或者: from charmhelpers.contrib.openstack.utils import config_flags_parser [as 别名]
def __call__(self):
        conf = config('config-flags')
        if not conf:
            return {}

        conf = config_flags_parser(conf)
        if not isinstance(conf, dict):
            log("Provided config-flags is not a dictionary - ignoring",
                level=WARNING)
            return {}

        permitted = self.permitted_sections
        if permitted:
            diff = set(conf.keys()).difference(set(permitted))
            if diff:
                log("Config-flags contains invalid keys '%s' - they will be "
                    "ignored" % (', '.join(diff)), level=WARNING)

        ceph_conf = {}
        for key in conf:
            if permitted and key not in permitted:
                log("Ignoring key '%s'" % key, level=WARNING)
                continue

            ceph_conf[key] = conf[key]

        return ceph_conf 
开发者ID:openstack,项目名称:charm-swift-proxy,代码行数:29,代码来源:ceph.py

示例2: ldap_options

# 需要导入模块: from charmhelpers.contrib.openstack import utils [as 别名]
# 或者: from charmhelpers.contrib.openstack.utils import config_flags_parser [as 别名]
def ldap_options(self):
        return os_utils.config_flags_parser(
            hookenv.config('ldap-config-flags')
        ) 
开发者ID:openstack,项目名称:charm-keystone-ldap,代码行数:6,代码来源:keystone_ldap.py

示例3: __call__

# 需要导入模块: from charmhelpers.contrib.openstack import utils [as 别名]
# 或者: from charmhelpers.contrib.openstack.utils import config_flags_parser [as 别名]
def __call__(self):
        conf = config('config-flags')
        if not conf:
            return {}

        conf = config_flags_parser(conf)
        if type(conf) != dict:
            log("Provided config-flags is not a dictionary - ignoring",
                level=WARNING)
            return {}

        permitted = self.permitted_sections
        if permitted:
            diff = set(conf.keys()).difference(set(permitted))
            if diff:
                log("Config-flags contains invalid keys '%s' - they will be "
                    "ignored" % (', '.join(diff)), level=WARNING)

        ceph_conf = {}
        for key in conf:
            if permitted and key not in permitted:
                log("Ignoring key '%s'" % key, level=WARNING)
                continue

            ceph_conf[key] = conf[key]

        return ceph_conf 
开发者ID:konono,项目名称:equlipse,代码行数:29,代码来源:ceph.py


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