rest_router: avoid assertion when ip_text is 0

Signed-off-by: Wataru ISHIDA <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Wataru ISHIDA 2013-08-28 15:56:47 +09:00 committed by FUJITA Tomonori
parent 667e41cccb
commit d5c4d774bc

View File

@ -1831,6 +1831,8 @@ def ipv4_int_to_text(ip_int):
def ipv4_text_to_int(ip_text):
if ip_text == 0:
return ip_text
assert isinstance(ip_text, str)
return struct.unpack('!I', addrconv.ipv4.text_to_bin(ip_text))[0]