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


Python LadDiagnosticUtil.getEventVolumeFromLadCfg方法代码示例

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


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

示例1: setEventVolume

# 需要导入模块: from Utils import LadDiagnosticUtil [as 别名]
# 或者: from Utils.LadDiagnosticUtil import getEventVolumeFromLadCfg [as 别名]
def setEventVolume(mdsdCfg,ladCfg):
    eventVolume = LadUtil.getEventVolumeFromLadCfg(ladCfg)
    if eventVolume:
        hutil.log("Event volume found in ladCfg: " + eventVolume)
    else:
        eventVolume = readPublicConfig("eventVolume")
        if eventVolume:
            hutil.log("Event volume found in public config: " + eventVolume)
        else:
            eventVolume = "Medium"
            hutil.log("Event volume not found in config. Using default value: " + eventVolume)
            
    XmlUtil.setXmlValue(mdsdCfg,"Management","eventVolume",eventVolume)
开发者ID:Rev68,项目名称:azure-linux-extensions,代码行数:15,代码来源:diagnostic.py

示例2: _set_event_volume

# 需要导入模块: from Utils import LadDiagnosticUtil [as 别名]
# 或者: from Utils.LadDiagnosticUtil import getEventVolumeFromLadCfg [as 别名]
    def _set_event_volume(self, lad_cfg):
        """
        Set event volume in mdsd config. Check if desired event volume is specified,
        first in ladCfg then in public config. If in neither then default to Medium.
        :param lad_cfg: 'ladCfg' Json object to look up for the event volume setting.
        :return: None. The mdsd config XML tree's eventVolume attribute is directly updated.
        :rtype: str
        """
        assert self._mdsd_config_xml_tree is not None

        event_volume = LadUtil.getEventVolumeFromLadCfg(lad_cfg)
        if event_volume:
            self._logger_log("Event volume found in ladCfg: " + event_volume)
        else:
            event_volume = self._ext_settings.read_public_config("eventVolume")
            if event_volume:
                self._logger_log("Event volume found in public config: " + event_volume)
            else:
                event_volume = "Medium"
                self._logger_log("Event volume not found in config. Using default value: " + event_volume)
        XmlUtil.setXmlValue(self._mdsd_config_xml_tree, "Management", "eventVolume", event_volume)
开发者ID:SuperScottz,项目名称:azure-linux-extensions,代码行数:23,代码来源:lad_config_all.py

示例3: test_getEventVolumeFromLadCfg

# 需要导入模块: from Utils import LadDiagnosticUtil [as 别名]
# 或者: from Utils.LadDiagnosticUtil import getEventVolumeFromLadCfg [as 别名]
 def test_getEventVolumeFromLadCfg(self):
     self.assertEqual(LadUtil.getEventVolumeFromLadCfg(self.valid_config), "Large")
开发者ID:Azure,项目名称:azure-linux-extensions,代码行数:4,代码来源:test_LadDiagnosticUtil.py


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