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


Python ZenScriptBase.__init__方法代码示例

本文整理汇总了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}
开发者ID:j053ph4,项目名称:ZenPacks.community.ConstructionKit,代码行数:9,代码来源:CustomCheckCommand.py

示例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")
开发者ID:cholden,项目名称:ZenossScripts,代码行数:9,代码来源:eventQueryAndLowerSevertiy.py

示例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 = []
开发者ID:j053ph4,项目名称:ZenPacks.community.zenAppProfiler,代码行数:10,代码来源:profiles-export.py

示例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,)
开发者ID:zenoss,项目名称:zenpacklib,代码行数:14,代码来源:ZPLTestHarness.py

示例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
开发者ID:cholden,项目名称:ZenossScripts,代码行数:14,代码来源:thresholdtester.py

示例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)
开发者ID:SteelHouseLabs,项目名称:zenoss-prodbin,代码行数:24,代码来源:Migrate.py

示例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
开发者ID:zenoss,项目名称:zenoss-prodbin,代码行数:7,代码来源:zentestcommand.py

示例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
开发者ID:zenoss,项目名称:zenpacklib,代码行数:6,代码来源:test_schema.py

示例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)
     """
开发者ID:Germaine01,项目名称:ZenPacks.community.ConstructionKit,代码行数:5,代码来源:migrate.py

示例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()
开发者ID:SteelHouseLabs,项目名称:zenoss-prodbin,代码行数:5,代码来源:zentestcommand.py

示例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 = ''
开发者ID:Germaine01,项目名称:ZenPacks.community.ConstructionKit,代码行数:6,代码来源:CustomCheckCommand.py

示例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)
开发者ID:zenoss,项目名称:zenpacklib,代码行数:5,代码来源:ZPLCommand.py

示例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)
开发者ID:c0ns0le,项目名称:zenoss-4,代码行数:4,代码来源:changeToNonHistoryZODB.py

示例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)
开发者ID:Germaine01,项目名称:ZenPacks.community.ConstructionKit,代码行数:6,代码来源:load-components.py

示例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")
开发者ID:cholden,项目名称:ZenossScripts,代码行数:8,代码来源:dashboardStateCopier.py


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