当前位置: 首页>>代码示例>>Python>>正文


Python ConnectionState.get_conn_state_cb方法代码示例

本文整理汇总了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()
开发者ID:rombie,项目名称:contrail-controller,代码行数:30,代码来源:event_manager.py


注:本文中的pysandesh.connection_info.ConnectionState.get_conn_state_cb方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。