From 36571c2ba9cd7e75c39df53215f6ed61e4250898 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Mon, 7 Mar 2005 17:08:38 +0000 Subject: [PATCH] - Bug fix: return [] instead of 'None' git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@87 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- utils/dns.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/utils/dns.py b/utils/dns.py index 13502cbe..91b1fdca 100644 --- a/utils/dns.py +++ b/utils/dns.py @@ -59,7 +59,7 @@ def textToDns(text): if match: return match else: - return None + return [] def searchIP(text): """ Search if an IP address if directly available and return @@ -69,7 +69,7 @@ def searchIP(text): if match: return match else: - return None + return [] def textToIp(text): """ Return the IP of DNS found in a given text. @@ -77,9 +77,8 @@ def textToIp(text): ipList = list() # Search for plain IP plainIP = searchIP(text) - if plainIP: - for element in plainIP: - ipList.append(element) + for element in plainIP: + ipList.append(element) else: # Try to get IP from possible DNS dnsList = textToDns(text)