本文整理汇总了Python中exabgp.logger.FakeLogger.notice方法的典型用法代码示例。如果您正苦于以下问题:Python FakeLogger.notice方法的具体用法?Python FakeLogger.notice怎么用?Python FakeLogger.notice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exabgp.logger.FakeLogger
的用法示例。
在下文中一共展示了FakeLogger.notice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Peer
# 需要导入模块: from exabgp.logger import FakeLogger [as 别名]
# 或者: from exabgp.logger.FakeLogger import notice [as 别名]
#.........这里部分代码省略.........
# if we mirror the ASN, we need to read first and send second
if not self.neighbor.local_as:
for sent_open in self._send_open():
if sent_open in ACTION.ALL:
yield sent_open
self.proto.negotiated.sent(sent_open)
self.fsm.change(FSM.OPENSENT)
self.proto.validate_open()
self.fsm.change(FSM.OPENCONFIRM)
self.recv_timer = ReceiveTimer(self.proto.connection.session,self.proto.negotiated.holdtime,4,0)
for action in self._send_ka():
yield action
for action in self._read_ka():
yield action
self.fsm.change(FSM.ESTABLISHED)
self.stats['complete'] = time.time()
# let the caller know that we were sucesfull
yield ACTION.NOW
def _main (self):
"""yield True if we want to come back to it asap, None if nothing urgent, and False if stopped"""
if self._teardown:
raise Notify(6,3)
self.neighbor.rib.incoming.clear()
include_withdraw = False
# Announce to the process BGP is up
self.logger.notice('connected to %s with %s' % (self.id(),self.proto.connection.name()),'reactor')
self.stats['up'] = self.stats.get('up',0) + 1
if self.neighbor.api['neighbor-changes']:
try:
self.reactor.processes.up(self.neighbor)
except ProcessError:
# Can not find any better error code than 6,0 !
# XXX: We can not restart the program so this will come back again and again - FIX
# XXX: In the main loop we do exit on this kind of error
raise Notify(6,0,'ExaBGP Internal error, sorry.')
send_eor = not self.neighbor.manual_eor
new_routes = None
self._resend_routes = SEND.NORMAL
send_families = []
# Every last asm message should be re-announced on restart
for family in self.neighbor.asm:
if family in self.neighbor.families():
self.neighbor.messages.appendleft(self.neighbor.asm[family])
operational = None
refresh = None
command_eor = None
number = 0
refresh_enhanced = True if self.proto.negotiated.refresh == REFRESH.ENHANCED else False
send_ka = KA(self.proto.connection.session,self.proto)
while not self._teardown:
for message in self.proto.read_message():
self.recv_timer.check_ka(message)