Open restena-pyg opened 3 months ago
Hi
If an IP address cannot resolved by socket.gethostbyaddr(ip) call, it throws an uncaught exception and the XML report is ignored: WARNING - Unable to parse attachment; name="<redacted>.xml"; reason="[Errno 1] Unknown host"
socket.gethostbyaddr(ip)
WARNING - Unable to parse attachment; name="<redacted>.xml"; reason="[Errno 1] Unknown host"
Such a change could fix the problem
def lookupHostFromIp(ip): host = ip try: hosts = socket.gethostbyaddr(ip) if len(hosts) > 0: host = hosts[0] segments = host.split('.') if len(segments) > 2: host = segments[-2] + "." + segments[-1] except socket.herror: pass except Exception as e: print(f"An error occurred: {e}") return host
Thanks. Would you like to submit a PR?
Resolved by #14.
@restena-pyg Please try the latest tag of this docker image and see if it's working as expected.
latest
Hi
If an IP address cannot resolved by
socket.gethostbyaddr(ip)
call, it throws an uncaught exception and the XML report is ignored:WARNING - Unable to parse attachment; name="<redacted>.xml"; reason="[Errno 1] Unknown host"
Such a change could fix the problem