From b0a69791bb65de2dd0e6d0414c2d1eb752c931b2 Mon Sep 17 00:00:00 2001 From: Toshiki Tsuboi Date: Sun, 22 Mar 2015 15:24:30 +0900 Subject: [PATCH] bmp: fix bug of logging format in bmpstation % ryu-manager bmpstation.py --verbose loading app bmpstation.py instantiating app bmpstation.py of BMPStation BRICK bmpstation listening on 0.0.0.0:11019 Traceback (most recent call last): File "/usr/lib/python2.7/logging/__init__.py", line 851, in emit msg = self.format(record) File "/usr/lib/python2.7/logging/__init__.py", line 724, in format return fmt.format(record) File "/usr/lib/python2.7/logging/__init__.py", line 464, in format record.message = record.getMessage() File "/usr/lib/python2.7/logging/__init__.py", line 328, in getMessage msg = msg % self.args TypeError: not enough arguments for format string Logged from file bmpstation.py, line 51 Signed-off-by: Toshiki Tsuboi Signed-off-by: FUJITA Tomonori --- ryu/app/bmpstation.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ryu/app/bmpstation.py b/ryu/app/bmpstation.py index cf84215f..ce313092 100644 --- a/ryu/app/bmpstation.py +++ b/ryu/app/bmpstation.py @@ -48,7 +48,8 @@ class BMPStation(app_manager.RyuApp): self.loop).serve_forever) def loop(self, sock, addr): - self.logger.debug("BMP client connected, ip=%s, port=%s", addr) + self.logger.debug("BMP client connected, ip=%s, port=%s", addr[0], + addr[1]) is_active = True buf = bytearray() required_len = bmp.BMPMessage._HDR_LEN @@ -91,5 +92,7 @@ class BMPStation(app_manager.RyuApp): required_len = bmp.BMPMessage._HDR_LEN - self.logger.debug("BMP client disconnected, ip=%s, port=%s", addr) + self.logger.debug("BMP client disconnected, ip=%s, port=%s", addr[0], + addr[1]) + sock.close()