本文整理汇总了Python中MilkCheck.Engine.BaseEntity.BaseEntity.update_target方法的典型用法代码示例。如果您正苦于以下问题:Python BaseEntity.update_target方法的具体用法?Python BaseEntity.update_target怎么用?Python BaseEntity.update_target使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MilkCheck.Engine.BaseEntity.BaseEntity
的用法示例。
在下文中一共展示了BaseEntity.update_target方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_update_target
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import update_target [as 别名]
def test_update_target(self):
'''Test update of the target of an entity'''
ent = BaseEntity(name='foo', target='fortoy[5-10]')
ent.update_target(NodeSet('fortoy[5-8]'))
self.assertTrue(ent.target == NodeSet('fortoy[5-8]'))
ent.update_target('fortoy[4-6]', mode='DIF')
self.assertTrue(ent.target == NodeSet('fortoy[7-8]'))
ent.update_target('fortoy8', mode='INT')
self.assertTrue(ent.target == NodeSet('fortoy8'))
示例2: update_target
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import update_target [as 别名]
def update_target(self, nodeset, mode=None):
'''Update the attribute target of a ServiceGroup'''
BaseEntity.update_target(self, nodeset, mode)
for service in self._subservices.values():
service.update_target(nodeset, mode)
示例3: update_target
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import update_target [as 别名]
def update_target(self, nodeset, mode=None):
"""Update the attribute target of a service"""
BaseEntity.update_target(self, nodeset, mode)
for action in self._actions.values():
action.update_target(nodeset, mode)