本文整理汇总了Python中pysandesh.connection_info.ConnectionState.get_conn_state_cb方法的典型用法代码示例。如果您正苦于以下问题:Python ConnectionState.get_conn_state_cb方法的具体用法?Python ConnectionState.get_conn_state_cb怎么用?Python ConnectionState.get_conn_state_cb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pysandesh.connection_info.ConnectionState
的用法示例。
在下文中一共展示了ConnectionState.get_conn_state_cb方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send_nodemgr_process_status
# 需要导入模块: from pysandesh.connection_info import ConnectionState [as 别名]
# 或者: from pysandesh.connection_info.ConnectionState import get_conn_state_cb [as 别名]
def send_nodemgr_process_status(self):
if self.prev_fail_status_bits == self.fail_status_bits:
return
self.prev_fail_status_bits = self.fail_status_bits
fail_status_bits = self.fail_status_bits
state, description = self._get_process_state(fail_status_bits)
conn_infos = ConnectionState._connection_map.values()
(cb_state, cb_description) = ConnectionState.get_conn_state_cb(conn_infos)
if (cb_state == ProcessState.NON_FUNCTIONAL):
state = ProcessState.NON_FUNCTIONAL
if description != '':
description += ' '
description += cb_description
process_status = ProcessStatus(
module_id=self.type_info._module_name, instance_id=self.instance_id,
state=ProcessStateNames[state], description=description)
process_status_list = []
process_status_list.append(process_status)
node_status = NodeStatus(name=self.hostname,
process_status=process_status_list)
node_status_uve = NodeStatusUVE(table=self.type_info._object_table,
data=node_status)
msg = ('send_nodemgr_process_status: Sending UVE:'
+ str(node_status_uve))
self.msg_log(msg, SandeshLevel.SYS_INFO)
node_status_uve.send()