本文整理汇总了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")
示例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")
示例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)
示例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)