本文整理匯總了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"