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