mirror of
https://github.com/faucetsdn/ryu.git
synced 2025-08-08 23:57:11 +02:00
library_bgp_speaker.rst: make an example more complete
also, while i'm here, remove trailing whitespaces in the example. Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
eb602ab71d
commit
24f4a01bc4
@ -20,6 +20,18 @@ instance advertizes some prefixes.
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
|
|
||||||
|
# BGPSpeaker needs sockets patched
|
||||||
|
eventlet.patch()
|
||||||
|
|
||||||
|
# initialize a log handler
|
||||||
|
# this is not strictly necessary but useful if you get messages like:
|
||||||
|
# No handlers could be found for logger "ryu.lib.hub"
|
||||||
|
import logging
|
||||||
|
import sys
|
||||||
|
log = logging.getLogger()
|
||||||
|
log.addHandler(logging.StreamHandler(sys.stderr))
|
||||||
|
|
||||||
from ryu.services.protocols.bgp.bgpspeaker import BGPSpeaker
|
from ryu.services.protocols.bgp.bgpspeaker import BGPSpeaker
|
||||||
|
|
||||||
def dump_remote_best_path_change(event):
|
def dump_remote_best_path_change(event):
|
||||||
|
Loading…
Reference in New Issue
Block a user