本文整理汇总了Python中generator_introspect_utils.VerificationGenerator类的典型用法代码示例。如果您正苦于以下问题:Python VerificationGenerator类的具体用法?Python VerificationGenerator怎么用?Python VerificationGenerator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VerificationGenerator类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: verify_vm_uve_cache
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
示例2: verify_on_setup
def verify_on_setup(self):
try:
vg = VerificationGenerator("127.0.0.1", self._http_port)
conn_status = vg.get_collector_connection_status()
except:
return False
else:
return conn_status["status"] == "Established"
示例3: verify_on_setup
def verify_on_setup(self):
try:
vg = VerificationGenerator('127.0.0.1', self._http_port, \
self._sandesh_config)
conn_status = vg.get_collector_connection_status()
except:
return False
else:
return conn_status['status'] == "Established"