From ded6ff03ce9b3e089324c10ba315d95d09964ffc Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 4 Oct 2018 10:29:22 +0100 Subject: [PATCH] Also catch gaierror in !rdns, print e.strerror instead of str(e) --- modules/ip_addresses.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ip_addresses.py b/modules/ip_addresses.py index ca8421a3..856ab288 100644 --- a/modules/ip_addresses.py +++ b/modules/ip_addresses.py @@ -62,7 +62,7 @@ class Module(ModuleManager.BaseModule): event["stderr"].set_prefix("rDNS") try: hostname, alias, ips = socket.gethostbyaddr(event["args_split"][0]) - except socket.herror as e: - event["stderr"].write(str(e)) + except (socket.herror, socket.gaierror) as e: + event["stderr"].write(e.strerror) return event["stdout"].write("%s: %s" % (ips[0], hostname))