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


Python Config.read_config_silent方法代码示例

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


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

示例1: loadconfig

# 需要导入模块: from shinken.objects.config import Config [as 别名]
# 或者: from shinken.objects.config.Config import read_config_silent [as 别名]
def loadconfig(configfile):
    try:
        c = Config()
        c.read_config_silent = 1
        r = c.read_config(configfile)
        b = c.read_config_buf(r)
        return (True, b)
    except:
        return (False, "There was an error reading the configuration file")
开发者ID:pjjw,项目名称:shinken,代码行数:11,代码来源:skonf.py

示例2: loadconfig

# 需要导入模块: from shinken.objects.config import Config [as 别名]
# 或者: from shinken.objects.config.Config import read_config_silent [as 别名]
 def loadconfig(self):
     try:
         c=Config()
         c.read_config_silent=1
         r=c.read_config(self.configfile)
         self.config=c.read_config_buf(r)
         return (True,"Config loaded") 
     except:
         return (False,"There was an error reading the configuration file")
开发者ID:mleinart,项目名称:shinken,代码行数:11,代码来源:libskonf.py

示例3: getconf

# 需要导入模块: from shinken.objects.config import Config [as 别名]
# 或者: from shinken.objects.config.Config import read_config_silent [as 别名]
    def getconf(self, config):
        '''
        Get the data in the arbiter for a table and some properties
        like hosts  host_name realm
        '''
        files = [config]
        conf = Config()
        conf.read_config_silent = 1

        # Get hosts objects
        properties = [ 'host_name','use','act_depend_of']
        hosts = self.arb.get_objects_properties('hosts', properties)

        # Get services dependencies
        svcdep_buf = conf.read_config(files)
        svc_dep = conf.read_config_buf(svcdep_buf)['servicedependency']

        return (hosts, svc_dep)
开发者ID:A3Sec,项目名称:shinken,代码行数:20,代码来源:service_dependency_mapping.py

示例4: getconf

# 需要导入模块: from shinken.objects.config import Config [as 别名]
# 或者: from shinken.objects.config.Config import read_config_silent [as 别名]
    def getconf(self, config):
        """
        Get the data in the arbiter for a table and some properties
        like hosts  host_name realm
        """
        files = [config]
        conf = Config()
        conf.read_config_silent = 1

        # Get hosts objects
        properties = ["host_name", "use", "act_depend_of"]
        hosts = self.arb.get_objects_properties("hosts", properties)

        # Get services dependencies
        svcdep_buf = conf.read_config(files)
        svc_dep = conf.read_config_buf(svcdep_buf)["servicedependency"]

        return (hosts, svc_dep)
开发者ID:daniellawrence,项目名称:shinken,代码行数:20,代码来源:service_dependency_mapping.py


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