本文整理汇总了Python中generator_introspect_utils.VerificationGenerator.get_uve方法的典型用法代码示例。如果您正苦于以下问题:Python VerificationGenerator.get_uve方法的具体用法?Python VerificationGenerator.get_uve怎么用?Python VerificationGenerator.get_uve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类generator_introspect_utils.VerificationGenerator
的用法示例。
在下文中一共展示了VerificationGenerator.get_uve方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: verify_vm_uve_cache
# 需要导入模块: from generator_introspect_utils import VerificationGenerator [as 别名]
# 或者: from generator_introspect_utils.VerificationGenerator import get_uve [as 别名]
def verify_vm_uve_cache(self, vm_id, delete=False):
try:
vg = VerificationGenerator('127.0.0.1', self._http_port)
vm_uves = vg.get_uve('UveVirtualMachineAgentTrace')
except Exception as e:
self._logger.info('Failed to get vm uves: %s' % (e))
return False
else:
if vm_uves is None:
self._logger.info('vm uve list empty')
return False
self._logger.info('%s' % (str(vm_uves)))
vm_uve = self.find_vm_entry(vm_uves, vm_id)
if vm_uve is None:
return False
if delete is True:
try:
return vm_uve['data']['UveVirtualMachineAgent']['deleted'] \
== 'true'
except:
return False
else:
try:
return vm_uve['data']['UveVirtualMachineAgent']['deleted'] \
== 'false'
except:
return True
return False