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 <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Toshiki Tsuboi 2015-03-22 15:24:30 +09:00 committed by FUJITA Tomonori
parent e9d7050a91
commit b0a69791bb

View File

@ -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()