本文整理汇总了Python中Products.ZenUtils.ZenScriptBase.ZenScriptBase.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python ZenScriptBase.__init__方法的具体用法?Python ZenScriptBase.__init__怎么用?Python ZenScriptBase.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.ZenUtils.ZenScriptBase.ZenScriptBase
的用法示例。
在下文中一共展示了ZenScriptBase.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self, connect=False):
ZenScriptBase.__init__(self)
if connect is True:
self.connect()
self.status = 0
self.message = ""
self.exitStatusMap = {"OK": 0, "WARNING": 1, "CRITICAL": 2}
示例2: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self):
"""
create object and and coonect to the db
"""
ZenScriptBase.__init__(self, connect=True)
self.log = logging.getLogger("EventModder")
self.api = getFacade("event")
示例3: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self):
ZenScriptBase.__init__(self, connect=True)
self.profiles = self.dmd.Profiles
self.rulesets = self.profiles.getAllRulesets()
self.rulesetfile = 'profiles-rulesets-export.txt'
self.rulefile = 'profiles-rules-export.txt'
self.exportrulesets = []
self.exportrules = []
示例4: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self, entry, connect=False, verbose=False, level=20, specparams=False):
"""Create test harness using entry.
entry can be any of the following:
* Filename of single YAML file.
* String containing YAML.
* Already-built ZenPackSpec (CFG) object.
"""
ZenScriptBase.__init__(self, connect=connect)
ZPLTestHarness.__init__(self, entry=entry, verbose=verbose, level=level, specparams=specparams,)
示例5: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self):
"""
create object and and connect to the db
"""
ZenScriptBase.__init__(self, connect=True)
self.log = logging.getLogger("TS")
self.mode = self.options.mode
self.device = self.options.device
self.template = self.options.tpath
self.min = self.options.min
self.max = self.options.max
self.value = self.options.value
示例6: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self, noopts=0):
ZenScriptBase.__init__(self, noopts=noopts, connect=False)
self.connect()
self.allSteps = allSteps[:]
# 2 phase sorting
# 1. sort by name
self.allSteps.sort(lambda x,y: cmp(x.name(), y.name()))
# 2. sort by dependencies
self.allSteps.sort()
# Log output to a file
# self.setupLogging() does *NOT* do what we want.
logFilename = zenPath('log', 'zenmigrate.log')
import logging.handlers
maxBytes = self.options.maxLogKiloBytes * 1024
backupCount = self.options.maxBackupLogs
handler = logging.handlers.RotatingFileHandler(
logFilename, maxBytes=maxBytes, backupCount=backupCount)
handler.setFormatter(logging.Formatter(
"%(asctime)s %(levelname)s %(name)s: %(message)s",
"%Y-%m-%d %H:%M:%S"))
log.addHandler(handler)
示例7: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self):
ZenScriptBase.__init__(self, connect=True)
self.getDataRoot()
self.device = None
self.usessh = False
示例8: afterSetUp
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def afterSetUp(self):
super(TestSchema, self).afterSetUp()
ZenScriptBase.__init__(self, app=self.app, connect=False)
self.cfg = self.z.cfg
示例9: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self, connect=True):
ZenScriptBase.__init__(self, connect=True)
"""
示例10: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self):
ZenScriptBase.__init__(self, connect=True)
self.getDataRoot()
示例11: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self):
ZenScriptBase.__init__(self, connect=False)
self.status = 0
self.message = ''
示例12: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self):
ZenScriptBase.__init__(self)
ZenPackLibLog.enable_log_stderr(self.LOG)
示例13: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self, noopts=0):
ZenScriptBase.__init__(self, noopts=noopts, connect=False)
示例14: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self):
"""
"""
ZenScriptBase.__init__(self, connect=True)
示例15: __init__
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import __init__ [as 别名]
def __init__(self):
"""
create object and and connect to the db
"""
ZenScriptBase.__init__(self, connect=True)
self.log = logging.getLogger("dashboard state controller")