本文整理汇总了Python中cfgm_common.vnc_kombu.VncKombuClient.greenlets方法的典型用法代码示例。如果您正苦于以下问题:Python VncKombuClient.greenlets方法的具体用法?Python VncKombuClient.greenlets怎么用?Python VncKombuClient.greenlets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cfgm_common.vnc_kombu.VncKombuClient
的用法示例。
在下文中一共展示了VncKombuClient.greenlets方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DeviceManager
# 需要导入模块: from cfgm_common.vnc_kombu import VncKombuClient [as 别名]
# 或者: from cfgm_common.vnc_kombu.VncKombuClient import greenlets [as 别名]
#.........这里部分代码省略.........
pr_obj_list = PhysicalRouterDM.list_obj()
pr_uuid_set = set([pr_obj['uuid'] for pr_obj in pr_obj_list])
self._cassandra.handle_pr_deletes(pr_uuid_set)
for obj in pr_obj_list:
pr = PhysicalRouterDM.locate(obj['uuid'], obj)
li_set = pr.logical_interfaces
for pi_id in pr.physical_interfaces:
pi = PhysicalInterfaceDM.locate(pi_id)
if pi:
li_set |= pi.logical_interfaces
vmi_set = set()
for li_id in li_set:
li = LogicalInterfaceDM.locate(li_id)
if li and li.virtual_machine_interface:
vmi_set |= set([li.virtual_machine_interface])
for vmi_id in vmi_set:
vmi = VirtualMachineInterfaceDM.locate(vmi_id)
for obj in InstanceIpDM.list_obj():
InstanceIpDM.locate(obj['uuid'], obj)
for obj in FloatingIpDM.list_obj():
FloatingIpDM.locate(obj['uuid'], obj)
for vn in VirtualNetworkDM.values():
vn.update_instance_ip_map()
for pr in PhysicalRouterDM.values():
pr.set_config_state()
self._db_resync_done.set()
gevent.joinall(self._vnc_kombu.greenlets())
# end __init__
def connection_state_update(self, status, message=None):
ConnectionState.update(
conn_type=ConnectionType.APISERVER, name='ApiServer',
status=status, message=message or '',
server_addrs=['%s:%s' % (self._args.api_server_ip,
self._args.api_server_port)])
# end connection_state_update
def config_log(self, msg, level):
self._sandesh.logger().log(SandeshLogger.get_py_logger_level(level),
msg)
def _vnc_subscribe_callback(self, oper_info):
self._db_resync_done.wait()
dependency_tracker = None
try:
msg = "Notification Message: %s" % (pformat(oper_info))
self.config_log(msg, level=SandeshLevel.SYS_DEBUG)
obj_type = oper_info['type'].replace('-', '_')
obj_class = DBBaseDM.get_obj_type_map().get(obj_type)
if obj_class is None:
return
if oper_info['oper'] == 'CREATE':
obj_dict = oper_info['obj_dict']
obj_id = obj_dict['uuid']
obj = obj_class.locate(obj_id, obj_dict)
dependency_tracker = DependencyTracker(
DBBaseDM.get_obj_type_map(), self._REACTION_MAP)
dependency_tracker.evaluate(obj_type, obj)